InputCoordinateDialog.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9 
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14 
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19 
20 /*!
21  * \file InputCoordinateDialog.h
22  *
23  * \brief Implements a dialog used to centralize the area of visualization in some coordinate.
24  */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_INPUTCOORDINATEDIALOG_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_INPUTCOORDINATEDIALOG_H
28 
29 #include "../Config.h"
30 
31 // Qt
32 #include <QDialog>
33 
34 namespace Ui
35 {
36  // Forward declaration
37  class InputCoordinateForm;
38 }
39 
40 // Forward declarations
41 class QValidator;
42 
43 namespace te
44 {
45  namespace gm
46  {
47  // Forward declaration.
48  struct Coord2D;
49  }
50 
51  namespace qt
52  {
53  namespace widgets
54  {
55  // Forward declaration
56  class MapDisplay;
57 
58  /*!
59  * \class InputCoordinateDialog
60  *
61  * \brief A dialog that gets a coordinate ad centralize the area of visualization at it.
62  */
64  {
65  Q_OBJECT
66 
67  public:
68 
69  /*!
70  * \brief Constructor.
71  *
72  * \param display The display to be used.
73  */
75 
76  /*!
77  * \brief Destructor.
78  */
80 
81  protected slots:
82 
83  /*!
84  * \brief Called when the degree-minute-second button was selected.
85  */
86  void DMS_triggered();
87 
88  /*!
89  * \brief Called when the decimal-degree button was selected.
90  */
91  void DD_triggered();
92 
93  /*!
94  * \brief Called when the \a Ok button was pressed.
95  */
96  void ok_triggered();
97 
98  /*!
99  * \brief Called when the \a Cancel button was pressed.
100  */
101  void cancel_triggered();
102 
103  /*!
104  * \brief Called when the line-edits changed its valid state.
105  */
106  void validatorStateChanged();
107 
108  protected:
109 
110  /*!
111  * \brief Updates the validator and the mask being used on coordinate line edit.
112  *
113  * \param isDMS If \a true mask and validator for the degree-minute-second input type, and false for decimal-degree validators.
114  */
115  void updateValidator(const bool& isDMS);
116 
117  /*!
118  * \brief Returns the coordinate of the input.
119  *
120  * \return Coordinate captured by the dialog.
121  */
122  te::gm::Coord2D* getCoordinate();
123 
124  Ui::InputCoordinateForm* m_ui; //!< Pointer for Qt structure
125 
126  QValidator* m_validator; //!< Validator being used.
127 
128  MapDisplay* m_display; //!< Map display to show the result.
129  };
130  }
131  }
132 }
133 
134 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_INPUTCOORDINATEDIALOG_H
Ui::InputCoordinateForm * m_ui
Pointer for Qt structure.
#define slots
A dialog that gets a coordinate ad centralize the area of visualization at it.
MapDisplay * m_display
Map display to show the result.
A widget to control the display of a set of layers.
Definition: MapDisplay.h:71
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
TerraLib.
QValidator * m_validator
Validator being used.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63