RasterNavigatorWidget.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/RasterNavigatorWidget.h
22 
23  \brief This file has the RasterNavigatorWidget class.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_RP_INTERNAL_RASTERNAVIGATORWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_RP_INTERNAL_RASTERNAVIGATORWIDGET_H
28 
29 // TerraLib
30 #include "../../../geometry/Envelope.h"
31 #ifndef Q_MOC_RUN
32 #include "../../../geometry/Polygon.h"
33 #include "../../../maptools/AbstractLayer.h"
34 #endif
35 #include "../../../maptools/Enums.h"
36 #include "../Config.h"
37 
38 // STL
39 #include <memory>
40 
41 // Qt
42 #include <QComboBox>
43 #include <QWidget>
44 
45 namespace Ui { class RasterNavigatorWidgetForm; }
46 
47 namespace te
48 {
49  namespace gm { class Envelope; }
50  namespace rst { class Raster; }
51  namespace se { class RasterSymbolizer; }
52 
53  namespace qt
54  {
55  namespace widgets
56  {
57  class AbstractTool;
58  class EyeBirdMapDisplayWidget;
59  class MapDisplay;
60  class Pan;
61  class ZoomInMapDisplayWidget;
62  class ZoomWheel;
63 
64  /*!
65  \class RasterNavigatorWidget
66 
67  \brief This class is used to navigate over a DataSetLayer (having a raster representation)
68  and given a set of tools, such as, zoom in, zoom out, pan, recompose.
69  Two new tools as created for raster interaction:
70  - point clicked
71  - geom definition
72 
73  \sa RasterFactory
74  */
76  {
77  Q_OBJECT
78 
79  public:
80 
81  RasterNavigatorWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
82 
84 
85  public:
86 
87  /*!
88  \brief This method is used to set the selected layer
89 
90  \param layer The layer ptr
91 
92  \note This layer MUST HAVE a valid raster object.
93  */
94  void set(te::map::AbstractLayerPtr layer, bool setFullScaleBox = false);
95 
97 
99 
101 
103 
105 
106  te::rst::Raster* getExtentRaster(bool fullScale = false);
107 
108  void drawRaster(te::rst::Raster* rst, te::se::Style* style = 0);
109 
110  void showAsPreview(bool asPreview, bool enableZoom = true);
111 
112  void hideColorCompositionTool(bool hide);
113 
114  void hideEditionTools(bool hide);
115 
116  void hidePickerTool(bool hide);
117 
118  void hideGeomTool(bool hide);
119 
120  void hideBoxTool(bool hide);
121 
122  void hideInfoTool(bool hide);
123 
124  void hideExtraDisplaysTool(bool hide);
125 
126  void setSelectionMode(bool mode);
127 
128  void setPoints(std::map< unsigned int, QPointF > *points);
129 
130  /*!
131  \brief Refresh the navigator display.
132  */
133  void refresh();
134 
135  protected slots:
136 
138 
140 
141  void onPointPicked(QPointF& point);
142 
143  void onPointMoving(QPointF& point);
144 
145  void onPointMoved(QPointF& pointoriginal, QPointF& pointnew);
146 
147  void onCoordTrackedChanged(QPointF& coordinate);
148 
150 
151  void onZoomAreaToggled(bool checked);
152 
153  void onZoomOutToggled(bool checked);
154 
155  void onPanToggled(bool checked);
156 
157  void onPointPickerToggled(bool checked);
158 
159  void onPointMoveToggled(bool checked);
160 
161  void onGeomToggled(bool checked);
162 
163  void onBoxToggled(bool checked);
164 
165  void onReadPixelToggled(bool checked);
166 
167  void onExtraDisplaysToggled(bool checked);
168 
170 
171  void onRedComboBoxActivated(int index);
172 
173  void onGreenComboBoxActivated(int index);
174 
175  void onBlueComboBoxActivated(int index);
176 
177  void onMonoComboBoxActivated(int index);
178 
179  void onMonoToolClicked(bool flag);
180 
181  void onRedToolClicked(bool flag);
182 
183  void onGreenToolClicked(bool flag);
184 
185  void onBlueToolClicked(bool flag);
186 
187  void onCompositionToolClicked(bool flag);
188 
190 
191  void onVSliderChanged(int value);
192 
193  void onHSliderChanged(int value);
194 
195  signals:
196 
198 
200 
201  void pointPicked(double x, double y);
202 
203  void pointMoving(double x, double y);
204 
205  void pointMoved(double xorig, double yorig, double xnew, double ynew);
206 
208 
210 
211  protected:
212 
214 
215  void listBands();
216 
218 
219  void setComboBoxText(QComboBox* cb, std::string value);
220 
221  void drawOverlay();
222 
223  private:
224 
225  std::unique_ptr<Ui::RasterNavigatorWidgetForm> m_ui;
226 
229 
234 
235  te::qt::widgets::Pan* m_panTool; //!< Pan tool (used in preview mode)
236  te::qt::widgets::ZoomWheel* m_zoomTool; //!< Zoom tool (used in preview mode)
237 
238  int m_currentColumn; //!< The column position of mouse in map display.
239  int m_currentRow; //!< The row position of mouse in map display.
240 
242 
243  QCursor m_pointCursor;
244 
245  QPixmap* m_draftOriginal;
246 
247  std::unique_ptr< std::map< unsigned int, QPointF > > m_points;
248  };
249 
250  } // end namespace widgets
251  } // end namespace qt
252 } // end namespace te
253 
254 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_RASTERNAVIGATORWIDGET_H
255 
te::qt::widgets::RasterNavigatorWidget::envelopeAcquired
void envelopeAcquired(te::gm::Envelope env)
te::qt::widgets::AbstractTool
This class defines an interface for objects that can receive application events and respond to them,...
Definition: AbstractTool.h:64
te::gm::Envelope
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
te::qt::widgets::RasterNavigatorWidget::onEnvelopeAcquired
void onEnvelopeAcquired(te::gm::Envelope env)
te::qt::widgets::RasterNavigatorWidget::listBands
void listBands()
te::qt::widgets::RasterNavigatorWidget::getExtentRaster
te::rst::Raster * getExtentRaster(bool fullScale=false)
te::qt::widgets::RasterNavigatorWidget::onPointPicked
void onPointPicked(QPointF &point)
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::qt::widgets::RasterNavigatorWidget::onPointMoving
void onPointMoving(QPointF &point)
te::qt::widgets::RasterNavigatorWidget::showAsPreview
void showAsPreview(bool asPreview, bool enableZoom=true)
te::qt::widgets::RasterNavigatorWidget::RasterNavigatorWidget
RasterNavigatorWidget(QWidget *parent=0, Qt::WindowFlags f=0)
te::qt::widgets::MapDisplay
A widget to control the display of a set of layers.
Definition: MapDisplay.h:72
te::qt::widgets::RasterNavigatorWidget::hideGeomTool
void hideGeomTool(bool hide)
te::map::AbstractLayerPtr
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
Definition: AbstractLayer.h:626
te::qt::widgets::RasterNavigatorWidget::onExtraDisplaysToggled
void onExtraDisplaysToggled(bool checked)
te::rst::Raster
An abstract class for raster data strucutures.
Definition: Raster.h:72
te::qt::widgets::RasterNavigatorWidget::hidePickerTool
void hidePickerTool(bool hide)
te::qt::widgets::RasterNavigatorWidget::pointMoved
void pointMoved(double xorig, double yorig, double xnew, double ynew)
te::qt::widgets::ZoomInMapDisplayWidget
This class defines the map display ZoomIn, this component is only a specific map that shows the curre...
Definition: ZoomInMapDisplayWidget.h:62
te::qt::widgets::RasterNavigatorWidget::m_points
std::unique_ptr< std::map< unsigned int, QPointF > > m_points
Definition: RasterNavigatorWidget.h:247
te::qt::widgets::RasterNavigatorWidget::hideInfoTool
void hideInfoTool(bool hide)
te::qt::widgets::RasterNavigatorWidget::setCurrentTool
void setCurrentTool(te::qt::widgets::AbstractTool *tool)
te::qt::widgets::RasterNavigatorWidget::onPreviewClicked
void onPreviewClicked()
te::qt::widgets::RasterNavigatorWidget::set
void set(te::map::AbstractLayerPtr layer, bool setFullScaleBox=false)
This method is used to set the selected layer.
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::RasterNavigatorWidget::onMonoComboBoxActivated
void onMonoComboBoxActivated(int index)
te::qt::widgets::RasterNavigatorWidget::getCompositionInfo
void getCompositionInfo()
te::qt::widgets::RasterNavigatorWidget::setVectorial
void setVectorial(te::map::AbstractLayerPtr layer)
te::qt::widgets::RasterNavigatorWidget::onMapDisplayExtentChanged
void onMapDisplayExtentChanged()
te::gm::Polygon
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:51
te::qt::widgets::RasterNavigatorWidget::getCurrentExtent
te::gm::Envelope getCurrentExtent()
te::qt::widgets::RasterNavigatorWidget::onRedComboBoxActivated
void onRedComboBoxActivated(int index)
te::qt::widgets::RasterNavigatorWidget::m_visibility
te::map::Visibility m_visibility
Definition: RasterNavigatorWidget.h:241
te::qt::widgets::RasterNavigatorWidget
This class is used to navigate over a DataSetLayer (having a raster representation) and given a set o...
Definition: RasterNavigatorWidget.h:76
te::se::RasterSymbolizer
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos,...
Definition: RasterSymbolizer.h:62
te::qt::widgets::RasterNavigatorWidget::m_panTool
te::qt::widgets::Pan * m_panTool
Pan tool (used in preview mode)
Definition: RasterNavigatorWidget.h:235
te::qt::widgets::RasterNavigatorWidget::m_tool
te::qt::widgets::AbstractTool * m_tool
Definition: RasterNavigatorWidget.h:230
te::map::Visibility
Visibility
Each layer can have three states of visibility.
Definition: Enums.h:140
te::qt::widgets::RasterNavigatorWidget::m_zoomInMapDisplay
te::qt::widgets::ZoomInMapDisplayWidget * m_zoomInMapDisplay
Definition: RasterNavigatorWidget.h:232
Ui
Definition: ConfigInputAddressDialog.h:44
te::qt::widgets::RasterNavigatorWidget::onRecomposeClicked
void onRecomposeClicked()
te::qt::widgets::RasterNavigatorWidget::m_ui
std::unique_ptr< Ui::RasterNavigatorWidgetForm > m_ui
Definition: RasterNavigatorWidget.h:225
te::qt::widgets::RasterNavigatorWidget::m_layer
te::map::AbstractLayerPtr m_layer
Definition: RasterNavigatorWidget.h:227
te::qt::widgets::RasterNavigatorWidget::onPointMoveToggled
void onPointMoveToggled(bool checked)
te::qt::widgets::RasterNavigatorWidget::m_mapDisplay
te::qt::widgets::MapDisplay * m_mapDisplay
Definition: RasterNavigatorWidget.h:231
te::qt::widgets::RasterNavigatorWidget::m_currentRow
int m_currentRow
The row position of mouse in map display.
Definition: RasterNavigatorWidget.h:239
te::qt::widgets::RasterNavigatorWidget::onBlueToolClicked
void onBlueToolClicked(bool flag)
te::qt::widgets::RasterNavigatorWidget::setSelectionMode
void setSelectionMode(bool mode)
te::qt::widgets::RasterNavigatorWidget::onZoomOutToggled
void onZoomOutToggled(bool checked)
te::qt::widgets::RasterNavigatorWidget::m_draftOriginal
QPixmap * m_draftOriginal
Definition: RasterNavigatorWidget.h:245
te::qt::widgets::RasterNavigatorWidget::drawRaster
void drawRaster(te::rst::Raster *rst, te::se::Style *style=0)
te::qt::widgets::RasterNavigatorWidget::pointPicked
void pointPicked(double x, double y)
slots
#define slots
Definition: VirtualMachine.h:48
te::qt::widgets::RasterNavigatorWidget::onBoxToggled
void onBoxToggled(bool checked)
te::qt::widgets::RasterNavigatorWidget::onHSliderChanged
void onHSliderChanged(int value)
te::qt::widgets::RasterNavigatorWidget::removeVectorial
void removeVectorial()
te::qt::widgets::RasterNavigatorWidget::mapDisplayExtentChanged
void mapDisplayExtentChanged()
te::qt::widgets::RasterNavigatorWidget::hideExtraDisplaysTool
void hideExtraDisplaysTool(bool hide)
te::qt::widgets::RasterNavigatorWidget::onGreenToolClicked
void onGreenToolClicked(bool flag)
te::qt::widgets::RasterNavigatorWidget::onPointMoved
void onPointMoved(QPointF &pointoriginal, QPointF &pointnew)
te::qt::widgets::RasterNavigatorWidget::onRedToolClicked
void onRedToolClicked(bool flag)
te::qt::widgets::RasterNavigatorWidget::drawOverlay
void drawOverlay()
te::qt::widgets::RasterNavigatorWidget::hideBoxTool
void hideBoxTool(bool hide)
te::qt::widgets::RasterNavigatorWidget::hideColorCompositionTool
void hideColorCompositionTool(bool hide)
te::qt::widgets::RasterNavigatorWidget::hideEditionTools
void hideEditionTools(bool hide)
te::qt::widgets::RasterNavigatorWidget::onPointPickerToggled
void onPointPickerToggled(bool checked)
te::qt::widgets::RasterNavigatorWidget::previewClicked
void previewClicked()
te::qt::widgets::ZoomWheel
This class implements a concrete tool to geographic zoom operation using the mouse wheel.
Definition: ZoomWheel.h:50
te::qt::widgets::RasterNavigatorWidget::setComboBoxText
void setComboBoxText(QComboBox *cb, std::string value)
te::se::Style
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Definition: Style.h:66
te::qt::widgets::RasterNavigatorWidget::onBlueComboBoxActivated
void onBlueComboBoxActivated(int index)
te::qt::widgets::RasterNavigatorWidget::pointMoving
void pointMoving(double x, double y)
te::qt::widgets::RasterNavigatorWidget::m_pointCursor
QCursor m_pointCursor
Definition: RasterNavigatorWidget.h:243
te::qt::widgets::RasterNavigatorWidget::geomAquired
void geomAquired(te::gm::Polygon *poly)
te::qt::widgets::RasterNavigatorWidget::onCompositionToolClicked
void onCompositionToolClicked(bool flag)
te::qt::widgets::RasterNavigatorWidget::onCoordTrackedChanged
void onCoordTrackedChanged(QPointF &coordinate)
te::qt::widgets::RasterNavigatorWidget::onZoomAreaToggled
void onZoomAreaToggled(bool checked)
te::qt::widgets::RasterNavigatorWidget::m_eyeBirdMapDisplay
te::qt::widgets::EyeBirdMapDisplayWidget * m_eyeBirdMapDisplay
Definition: RasterNavigatorWidget.h:233
te::qt::widgets::RasterNavigatorWidget::m_zoomTool
te::qt::widgets::ZoomWheel * m_zoomTool
Zoom tool (used in preview mode)
Definition: RasterNavigatorWidget.h:236
te::qt::widgets::RasterNavigatorWidget::m_symbolizer
te::se::RasterSymbolizer * m_symbolizer
Definition: RasterNavigatorWidget.h:228
te::qt::widgets::RasterNavigatorWidget::onGeomAquired
void onGeomAquired(te::gm::Polygon *poly)
te::qt::widgets::EyeBirdMapDisplayWidget
This class defines the map display EyeBird, this component is only a specific map that shows the orig...
Definition: EyeBirdMapDisplayWidget.h:59
te::qt::widgets::RasterNavigatorWidget::~RasterNavigatorWidget
~RasterNavigatorWidget()
te::qt::widgets::RasterNavigatorWidget::onReadPixelToggled
void onReadPixelToggled(bool checked)
te::qt::widgets::RasterNavigatorWidget::onGreenComboBoxActivated
void onGreenComboBoxActivated(int index)
te::qt::widgets::RasterNavigatorWidget::setPoints
void setPoints(std::map< unsigned int, QPointF > *points)
te::qt::widgets::RasterNavigatorWidget::onPanToggled
void onPanToggled(bool checked)
te::qt::widgets::RasterNavigatorWidget::setExtent
void setExtent(te::gm::Envelope env)
te::qt::widgets::RasterNavigatorWidget::onVSliderChanged
void onVSliderChanged(int value)
te::qt::widgets::RasterNavigatorWidget::m_currentColumn
int m_currentColumn
The column position of mouse in map display.
Definition: RasterNavigatorWidget.h:238
te::qt::widgets::RasterNavigatorWidget::refresh
void refresh()
Refresh the navigator display.
te::qt::widgets::RasterNavigatorWidget::getDisplay
te::qt::widgets::MapDisplay * getDisplay()
te::qt::widgets::Pan
This class implements a concrete tool to geographic pan operation.
Definition: Pan.h:50
te::qt::widgets::RasterNavigatorWidget::onGeomToggled
void onGeomToggled(bool checked)
te::qt::widgets::RasterNavigatorWidget::onMonoToolClicked
void onMonoToolClicked(bool flag)
Pan
This event signals that the pan button toggled.