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