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 
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);
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 
167  TiePointData( const TiePointData& other );
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. */
199 
200  /*! \brief Uptate the current transformation information widgets. */
202 
203  /*! \brief Refresh map display 1. */
205 
206  /*! \brief Refresh map display 2. */
208  };
209  }
210  }
211 }
212 
213 
214 
215 #endif
te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay1_extentChanged
void on_mapDisplay1_extentChanged()
te::qt::widgets::TiePointsLocatorDialog::m_tiePoints
TPContainerT m_tiePoints
Internal tie-points container.
Definition: TiePointsLocatorDialog.h:194
te::qt::widgets::TiePointsLocatorDialog::m_mapDisplay1
te::qt::widgets::MapDisplay * m_mapDisplay1
Map display 1.
Definition: TiePointsLocatorDialog.h:179
te::qt::widgets::TiePointsLocatorDialog::on_addPushButton_clicked
void on_addPushButton_clicked()
te::qt::widgets::TiePointsLocatorDialog::m_selectedPointPattern
te::color::RGBAColor ** m_selectedPointPattern
The display draw pattern used for selected points.
Definition: TiePointsLocatorDialog.h:174
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::qt::widgets::TiePointsLocatorDialog::TiePointData::m_acqType
TiePointAcquisitionType m_acqType
Acquisition type.
Definition: TiePointsLocatorDialog.h:163
te::qt::widgets::TiePointsLocatorDialog::refreshMapDisplay1
void refreshMapDisplay1()
Refresh map display 1.
te::qt::widgets::TiePointsLocatorDialog::TiePointData::~TiePointData
~TiePointData()
te::qt::widgets::TiePointsLocatorDialogMDEventFilter::~TiePointsLocatorDialogMDEventFilter
~TiePointsLocatorDialogMDEventFilter()
te::qt::widgets::TiePointsLocatorDialog::m_inLayer1Ptr
te::map::DataSetLayerPtr m_inLayer1Ptr
Definition: TiePointsLocatorDialog.h:181
te::qt::widgets::TiePointsLocatorDialog::TiePointData::m_tiePoint
te::gm::GTParameters::TiePoint m_tiePoint
Tie point coordinates.
Definition: TiePointsLocatorDialog.h:164
te::qt::widgets::MapDisplay
A widget to control the display of a set of layers.
Definition: MapDisplay.h:72
te::qt::widgets::TiePointsLocatorDialog::refreshMapDisplay2
void refreshMapDisplay2()
Refresh map display 2.
te::qt::widgets::TiePointsLocatorDialog
A dialog used to execute tie points location.
Definition: TiePointsLocatorDialog.h:101
te::rst::Raster
An abstract class for raster data strucutures.
Definition: Raster.h:72
te::qt::widgets::TiePointsLocatorDialog::TiePointData::TiePointData
TiePointData()
te::qt::widgets::TiePointsLocatorDialog::TiePointData
Definition: TiePointsLocatorDialog.h:153
te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay2_extentChanged
void on_mapDisplay2_extentChanged()
te::qt::widgets::TiePointsLocatorDialogMDEventFilter::keyPressed
void keyPressed(int key)
te::qt::widgets::TiePointsLocatorDialog::TiePointData::InvalidAcquisitionT
@ InvalidAcquisitionT
Invalid acquisition type.
Definition: TiePointsLocatorDialog.h:158
te::qt::widgets::TiePointsLocatorDialog::getTiePoints
void getTiePoints(std::vector< te::gm::GTParameters::TiePoint > &tiePoints) const
Get the current acquired tie-points.
te::qt::widgets::TiePointsLocatorDialog::~TiePointsLocatorDialog
~TiePointsLocatorDialog()
Destructor.
te::qt::widgets::TiePointsLocatorDialog::TPContainerT
std::map< unsigned int, TiePointData > TPContainerT
Tie-pints container type definition.
Definition: TiePointsLocatorDialog.h:172
TEQTWIDGETSEXPORT
#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::TiePointsLocatorDialogMDEventFilter::TiePointsLocatorDialogMDEventFilter
TiePointsLocatorDialogMDEventFilter(te::qt::widgets::MapDisplay *parent)
te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay1_coordTracked
void on_mapDisplay1_coordTracked(QPointF &coordinate)
te::qt::widgets::TiePointsLocatorDialog::m_lastSelectedTiePointHasFirstOk
bool m_lastSelectedTiePointHasFirstOk
true if the last selected tie-point has the first part set;
Definition: TiePointsLocatorDialog.h:191
te::qt::widgets::TiePointsLocatorDialog::m_zoomClickEvent1
te::qt::widgets::ZoomLeftAndRightClick * m_zoomClickEvent1
Input raster 2 pointer.
Definition: TiePointsLocatorDialog.h:185
te::qt::widgets::TiePointsLocatorDialog::m_mDEventFilter2
TiePointsLocatorDialogMDEventFilter * m_mDEventFilter2
Map display 2 event filter.
Definition: TiePointsLocatorDialog.h:193
te::gm::GTParameters::TiePoint
std::pair< Coord2D, Coord2D > TiePoint
Tie point type definition.
Definition: GTParameters.h:59
te::qt::widgets::TiePointsLocatorDialog::on_okPushButton_clicked
void on_okPushButton_clicked()
te::qt::widgets::CoordTracking
This class implements a concrete tool to geographic coordinate tracking on mouse move operation.
Definition: CoordTracking.h:58
te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay1_keyPressed
void on_mapDisplay1_keyPressed(int key)
te::qt::widgets::TiePointsLocatorDialog::m_coordTracking2
CoordTracking * m_coordTracking2
Coord tracking (map display 2);.
Definition: TiePointsLocatorDialog.h:188
te::qt::widgets::TiePointsLocatorDialog::TiePointsLocatorDialog
TiePointsLocatorDialog(const te::map::DataSetLayerPtr &inLayer1Ptr, const te::map::DataSetLayerPtr &inLayer2Ptr, QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a basic dialog which is a child of parent, with widget flags set to f.
te::qt::widgets::TiePointsLocatorDialog::TiePointData::operator=
const TiePointData & operator=(const TiePointData &other)
Ui
Definition: ConfigInputAddressDialog.h:44
te::qt::widgets::TiePointsLocatorDialog::on_tiePointsTableWidget_itemSelectionChanged
void on_tiePointsTableWidget_itemSelectionChanged()
te::qt::widgets::TiePointsLocatorDialogMDEventFilter
A event filter to handle map display events.
Definition: TiePointsLocatorDialog.h:71
te::qt::widgets::TiePointsLocatorDialogMDEventFilter::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
te::qt::widgets::TiePointsLocatorDialog::m_mDEventFilter1
TiePointsLocatorDialogMDEventFilter * m_mDEventFilter1
Map display 1 event filter.
Definition: TiePointsLocatorDialog.h:192
slots
#define slots
Definition: VirtualMachine.h:48
te::qt::widgets::TiePointsLocatorDialog::m_zoomClickEvent2
te::qt::widgets::ZoomLeftAndRightClick * m_zoomClickEvent2
Zoom click event (map display 2).
Definition: TiePointsLocatorDialog.h:186
te::qt::widgets::TiePointsLocatorDialogMDEventFilter::m_mDisplay
te::qt::widgets::MapDisplay * m_mDisplay
Definition: TiePointsLocatorDialog.h:91
te::qt::widgets::TiePointsLocatorDialog::tiePointsTableUpdate
void tiePointsTableUpdate()
Uptate the tie-points table widget.
te::qt::widgets::TiePointsLocatorDialog::m_raster1
te::rst::Raster * m_raster1
Input data set layer 2 pointer.
Definition: TiePointsLocatorDialog.h:183
te::qt::widgets::TiePointsLocatorDialog::m_raster2
te::rst::Raster * m_raster2
Input raster 1 pointer.
Definition: TiePointsLocatorDialog.h:184
te::qt::widgets::TiePointsLocatorDialog::TiePointData::ManualAcquisitionT
@ ManualAcquisitionT
Manual acquisition type.
Definition: TiePointsLocatorDialog.h:159
te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay2_keyPressed
void on_mapDisplay2_keyPressed(int key)
te::map::DataSetLayerPtr
boost::intrusive_ptr< DataSetLayer > DataSetLayerPtr
Definition: DataSetLayer.h:148
te::qt::widgets::TiePointsLocatorDialog::transformationInfoUpdate
void transformationInfoUpdate()
Uptate the current transformation information widgets.
te::qt::widgets::TiePointsLocatorDialog::m_uiPtr
Ui::TiePointsLocatorForm * m_uiPtr
Definition: TiePointsLocatorDialog.h:177
te::qt::widgets::TiePointsLocatorDialog::m_lastSelectedTiePoint
te::gm::GTParameters::TiePoint m_lastSelectedTiePoint
The last mouse tracked tie-point by pressing any key over the map areas.
Definition: TiePointsLocatorDialog.h:190
te::color::RGBAColor
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:58
te::qt::widgets::TiePointsLocatorDialog::on_unselectAllPushButton_clicked
void on_unselectAllPushButton_clicked()
te::qt::widgets::TiePointsLocatorDialog::m_unselectedPointPattern
te::color::RGBAColor ** m_unselectedPointPattern
The display draw pattern used for unselected points.
Definition: TiePointsLocatorDialog.h:175
te::qt::widgets::ZoomLeftAndRightClick
This class implements a concrete tool to geographic zoom operation using the left and right mouse cli...
Definition: ZoomLeftAndRightClick.h:48
te::qt::widgets::TiePointsLocatorDialog::on_deleteSelectedPushButton_clicked
void on_deleteSelectedPushButton_clicked()
te::qt::widgets::TiePointsLocatorDialog::TiePointData::TiePointData
TiePointData(const TiePointData &other)
te::qt::widgets::TiePointsLocatorDialog::m_advDialogPtr
TiePointsLocatorAdvancedDialog * m_advDialogPtr
User interface.
Definition: TiePointsLocatorDialog.h:178
te::qt::widgets::TiePointsLocatorDialog::TiePointData::TiePointAcquisitionType
TiePointAcquisitionType
Definition: TiePointsLocatorDialog.h:157
te::qt::widgets::TiePointsLocatorDialog::m_tempPointPattern
te::color::RGBAColor ** m_tempPointPattern
The display draw pattern used for temporary points.
Definition: TiePointsLocatorDialog.h:176
te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay2_coordTracked
void on_mapDisplay2_coordTracked(QPointF &coordinate)
te::qt::widgets::TiePointsLocatorAdvancedDialog
A dialog used to execute tie points location advanced options.
Definition: TiePointsLocatorAdvancedDialog.h:57
te::qt::widgets::TiePointsLocatorDialog::m_inLayer2Ptr
te::map::DataSetLayerPtr m_inLayer2Ptr
Input data set layer 1 pointer.
Definition: TiePointsLocatorDialog.h:182
te::qt::widgets::TiePointsLocatorDialog::on_autoAcquireTiePointsPushButton_clicked
void on_autoAcquireTiePointsPushButton_clicked()
te::qt::widgets::TiePointsLocatorDialog::on_advancedOptionsPushButton_clicked
void on_advancedOptionsPushButton_clicked()
te::qt::widgets::TiePointsLocatorDialog::m_lastInsertedTPID
unsigned int m_lastInsertedTPID
A ID counter for new tie pointes inserted into m_tiePoints;.
Definition: TiePointsLocatorDialog.h:195
te::qt::widgets::TiePointsLocatorDialog::m_lastTrackedTiePoint
te::gm::GTParameters::TiePoint m_lastTrackedTiePoint
The last mouse tracked tie-point by analysing the mouse move over the map areas.
Definition: TiePointsLocatorDialog.h:189
te::qt::widgets::TiePointsLocatorDialog::m_coordTracking1
CoordTracking * m_coordTracking1
Coord tracking (map display 1);.
Definition: TiePointsLocatorDialog.h:187
te::qt::widgets::TiePointsLocatorDialog::on_selectAllPushButton_clicked
void on_selectAllPushButton_clicked()
te::qt::widgets::TiePointsLocatorDialog::m_mapDisplay2
te::qt::widgets::MapDisplay * m_mapDisplay2
Map display 2.
Definition: TiePointsLocatorDialog.h:180