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 
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:51
This class defines an interface for objects that can receive application events and respond to them,...
Definition: AbstractTool.h:64
This class defines the map display EyeBird, this component is only a specific map that shows the orig...
A widget to control the display of a set of layers.
Definition: MapDisplay.h:72
This class implements a concrete tool to geographic pan operation.
Definition: Pan.h:50
This class is used to navigate over a DataSetLayer (having a raster representation) and given a set o...
void onCoordTrackedChanged(QPointF &coordinate)
te::qt::widgets::EyeBirdMapDisplayWidget * m_eyeBirdMapDisplay
void pointPicked(double x, double y)
void showAsPreview(bool asPreview, bool enableZoom=true)
void onGeomAquired(te::gm::Polygon *poly)
void envelopeAcquired(te::gm::Envelope env)
int m_currentColumn
The column position of mouse in map display.
void setVectorial(te::map::AbstractLayerPtr layer)
std::unique_ptr< std::map< unsigned int, QPointF > > m_points
te::rst::Raster * getExtentRaster(bool fullScale=false)
int m_currentRow
The row position of mouse in map display.
void setPoints(std::map< unsigned int, QPointF > *points)
std::unique_ptr< Ui::RasterNavigatorWidgetForm > m_ui
te::qt::widgets::MapDisplay * getDisplay()
void pointMoving(double x, double y)
void setCurrentTool(te::qt::widgets::AbstractTool *tool)
void refresh()
Refresh the navigator display.
void geomAquired(te::gm::Polygon *poly)
RasterNavigatorWidget(QWidget *parent=0, Qt::WindowFlags f=0)
void drawRaster(te::rst::Raster *rst, te::se::Style *style=0)
void onPointMoved(QPointF &pointoriginal, QPointF &pointnew)
te::qt::widgets::ZoomWheel * m_zoomTool
Zoom tool (used in preview mode)
void setComboBoxText(QComboBox *cb, std::string value)
te::qt::widgets::AbstractTool * m_tool
void setExtent(te::gm::Envelope env)
te::qt::widgets::MapDisplay * m_mapDisplay
te::qt::widgets::ZoomInMapDisplayWidget * m_zoomInMapDisplay
void set(te::map::AbstractLayerPtr layer, bool setFullScaleBox=false)
This method is used to set the selected layer.
te::qt::widgets::Pan * m_panTool
Pan tool (used in preview mode)
void pointMoved(double xorig, double yorig, double xnew, double ynew)
void onEnvelopeAcquired(te::gm::Envelope env)
This class defines the map display ZoomIn, this component is only a specific map that shows the curre...
This class implements a concrete tool to geographic zoom operation using the mouse wheel.
Definition: ZoomWheel.h:50
An abstract class for raster data strucutures.
Definition: Raster.h:72
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos,...
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Definition: Style.h:66
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
Visibility
Each layer can have three states of visibility.
Definition: Enums.h:140
TerraLib.
#define slots
This event signals that the pan button toggled.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63