TiePointsLocatorDialog.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 terralib/qt/widgets/rp/TiePointsLocatorDialog.h
22 
23  \brief A dialog used to execute tie points location.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_RP_INTERNAL_TIEPOINTSLOCATORDIALOG_H
27 #define __TERRALIB_QT_WIDGETS_RP_INTERNAL_TIEPOINTSLOCATORDIALOG_H
28 
29 // TerraLib
30 #include "../Config.h"
31 #ifndef Q_MOC_RUN
32 #include "../../../raster/Raster.h"
33 #include "../../../maptools/DataSetLayer.h"
34 #endif
35 #include "../../../geometry/GTParameters.h"
36 #include "../../../color/RGBAColor.h"
37 
38 // Qt
39 #include <QDialog>
40 #include <QtCore/QObject>
41 #include <QtCore/QPoint>
42 
43 // STL
44 
45 #include <vector>
46 #include <map>
47 
48 // Forward user interface declaration
49 namespace Ui
50 {
51  class TiePointsLocatorForm;
52 }
53 
54 namespace te
55 {
56  namespace qt
57  {
58  namespace widgets
59  {
60  class MapDisplay;
61  class ZoomLeftAndRightClick;
62  class CoordTracking;
63  class TiePointsLocatorAdvancedDialog;
64 
65  /*!
66  \class TiePointsLocatorDialogMDEventFilter
67 
68  \brief A event filter to handle map display events.
69  */
71  {
72  Q_OBJECT
73 
74  public:
75 
76 
78 
80 
81  //overload
82  bool eventFilter( QObject * watched, QEvent * event );
83 
84  signals:
85 
86  /*! This signal is emitted when a keyboar key was pressed. */
87  void keyPressed( int key );
88 
89  protected :
90 
92 
93  };
94 
95  /*!
96  \class TiePointsLocatorDialog
97 
98  \brief A dialog used to execute tie points location.
99  */
101  {
102  Q_OBJECT
103 
104  public:
105 
106  /*! \brief Constructs a basic dialog which is a child of parent, with widget flags set to f.
107 
108  \param inRaster1Ptr Input raster layer 1 pointer.
109 
110  \param inRaster1Ptr Input raster layer 2 pointer.
111 
112  \param parent Parent widget pointer.
113 
114  \param f Widget flags.
115  */
117  const te::map::DataSetLayerPtr& inLayer1Ptr,
118  const te::map::DataSetLayerPtr& inLayer2Ptr,
119  QWidget* parent = 0,
120  Qt::WindowFlags f = 0);
121 
122  /*! \brief Destructor. */
124 
125  /*!
126  \brief Get the current acquired tie-points.
127  \param tiePoints The current acquired tie-points.
128  */
129  void getTiePoints( std::vector< te::gm::GTParameters::TiePoint >&
130  tiePoints ) const;
131 
132  protected slots:
133 
134  void on_okPushButton_clicked();
135  void on_autoAcquireTiePointsPushButton_clicked();
136  void on_selectAllPushButton_clicked();
137  void on_unselectAllPushButton_clicked();
138  void on_deleteSelectedPushButton_clicked();
139  void on_advancedOptionsPushButton_clicked();
140  void on_addPushButton_clicked();
141  void on_mapDisplay1_keyPressed( int key );
142  void on_mapDisplay2_keyPressed( int key );
143  void on_mapDisplay1_coordTracked(QPointF &coordinate);
144  void on_mapDisplay2_coordTracked(QPointF &coordinate);
145  void on_tiePointsTableWidget_itemSelectionChanged();
146  void on_mapDisplay1_extentChanged();
147  void on_mapDisplay2_extentChanged();
148 
149  protected:
150 
151  /*! \class TiePointData Tie Point data. */
153  {
154  public :
155 
156  /*! \enum TiePointAcquisitionType Tie point acquisition type. */
158  InvalidAcquisitionT, //!< Invalid acquisition type.
159  ManualAcquisitionT, //!< Manual acquisition type.
160  AutomaticAcquisitionT //!< Automatic acquisition type.
161  };
162 
163  TiePointAcquisitionType m_acqType; //!< Acquisition type.
164  te::gm::GTParameters::TiePoint m_tiePoint; //!< Tie point coordinates.
165 
166  TiePointData();
167  TiePointData( const TiePointData& other );
168  ~TiePointData();
169  const TiePointData& operator=( const TiePointData& other );
170  };
171 
172  typedef std::map< unsigned int, TiePointData > TPContainerT; //!< Tie-pints container type definition.
173 
174  te::color::RGBAColor** m_selectedPointPattern; //!< The display draw pattern used for selected points.
175  te::color::RGBAColor** m_unselectedPointPattern; //!< The display draw pattern used for unselected points.
176  te::color::RGBAColor** m_tempPointPattern; //!< The display draw pattern used for temporary points.
177  Ui::TiePointsLocatorForm* m_uiPtr; //! User interface.
178  TiePointsLocatorAdvancedDialog* m_advDialogPtr; //!< Advanced options dialog.
181  te::map::DataSetLayerPtr m_inLayer1Ptr; //! Input data set layer 1 pointer.
182  te::map::DataSetLayerPtr m_inLayer2Ptr; //! Input data set layer 2 pointer.
183  te::rst::Raster* m_raster1; //! Input raster 1 pointer.
184  te::rst::Raster* m_raster2; //! Input raster 2 pointer.
185  te::qt::widgets::ZoomLeftAndRightClick* m_zoomClickEvent1; //!< Zoom click event (map display 1).
186  te::qt::widgets::ZoomLeftAndRightClick* m_zoomClickEvent2; //!< Zoom click event (map display 2).
187  CoordTracking* m_coordTracking1; //!< Coord tracking (map display 1);
188  CoordTracking* m_coordTracking2; //!< Coord tracking (map display 2);
189  te::gm::GTParameters::TiePoint m_lastTrackedTiePoint; //!< The last mouse tracked tie-point by analysing the mouse move over the map areas.
190  te::gm::GTParameters::TiePoint m_lastSelectedTiePoint; //!< The last mouse tracked tie-point by pressing any key over the map areas.
191  bool m_lastSelectedTiePointHasFirstOk; //!< true if the last selected tie-point has the first part set;
192  TiePointsLocatorDialogMDEventFilter* m_mDEventFilter1; //!< Map display 1 event filter.
193  TiePointsLocatorDialogMDEventFilter* m_mDEventFilter2; //!< Map display 2 event filter.
194  TPContainerT m_tiePoints; //!< Internal tie-points container.
195  unsigned int m_lastInsertedTPID; //!< A ID counter for new tie pointes inserted into m_tiePoints;
196 
197  /*! \brief Uptate the tie-points table widget. */
198  void tiePointsTableUpdate();
199 
200  /*! \brief Uptate the current transformation information widgets. */
201  void transformationInfoUpdate();
202 
203  /*! \brief Refresh map display 1. */
204  void refreshMapDisplay1();
205 
206  /*! \brief Refresh map display 2. */
207  void refreshMapDisplay2();
208  };
209  };
210  };
211 };
212 
213 
214 
215 #endif
TiePointsLocatorDialogMDEventFilter * m_mDEventFilter1
Map display 1 event filter.
std::map< unsigned int, TiePointData > TPContainerT
Tie-pints container type definition.
This class implements a concrete tool to geographic zoom operation using the left and right mouse cli...
A dialog used to execute tie points location.
A event filter to handle map display events.
te::qt::widgets::MapDisplay * m_mapDisplay1
Map display 1.
unsigned int m_lastInsertedTPID
A ID counter for new tie pointes inserted into m_tiePoints;.
te::qt::widgets::MapDisplay * m_mapDisplay2
Map display 2.
A widget to control the display of a set of layers.
Definition: MapDisplay.h:69
CoordTracking * m_coordTracking2
Coord tracking (map display 2);.
te::qt::widgets::ZoomLeftAndRightClick * m_zoomClickEvent2
Zoom click event (map display 2).
std::pair< Coord2D, Coord2D > TiePoint
Tie point type definition.
Definition: GTParameters.h:59
te::color::RGBAColor ** m_tempPointPattern
The display draw pattern used for temporary points.
An abstract class for raster data strucutures.
Definition: Raster.h:71
te::color::RGBAColor ** m_unselectedPointPattern
The display draw pattern used for unselected points.
CoordTracking * m_coordTracking1
Coord tracking (map display 1);.
URI C++ Library.
TiePointsLocatorDialogMDEventFilter * m_mDEventFilter2
Map display 2 event filter.
TiePointsLocatorAdvancedDialog * m_advDialogPtr
User interface.
te::gm::GTParameters::TiePoint m_lastSelectedTiePoint
The last mouse tracked tie-point by pressing any key over the map areas.
This class implements a concrete tool to geographic coordinate tracking on mouse move operation...
Definition: CoordTracking.h:52
TiePointAcquisitionType m_acqType
Acquisition type.
te::rst::Raster * m_raster2
Input raster 1 pointer.
te::map::DataSetLayerPtr m_inLayer2Ptr
Input data set layer 1 pointer.
A dialog used to execute tie points location advanced options.
boost::intrusive_ptr< DataSetLayer > DataSetLayerPtr
Definition: DataSetLayer.h:146
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
bool m_lastSelectedTiePointHasFirstOk
true if the last selected tie-point has the first part set;
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
te::qt::widgets::ZoomLeftAndRightClick * m_zoomClickEvent1
Input raster 2 pointer.
te::gm::GTParameters::TiePoint m_lastTrackedTiePoint
The last mouse tracked tie-point by analysing the mouse move over the map areas.
te::rst::Raster * m_raster1
Input data set layer 2 pointer.
TPContainerT m_tiePoints
Internal tie-points container.
te::color::RGBAColor ** m_selectedPointPattern
The display draw pattern used for selected points.
te::gm::GTParameters::TiePoint m_tiePoint
Tie point coordinates.