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 
96  void setVectorial(te::map::AbstractLayerPtr layer);
97 
98  void setExtent(te::gm::Envelope env);
99 
100  void removeVectorial();
101 
102  te::gm::Envelope getCurrentExtent();
103 
104  te::qt::widgets::MapDisplay* getDisplay();
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  protected slots:
129 
130  void onEnvelopeAcquired(te::gm::Envelope env);
131 
132  void onGeomAquired(te::gm::Polygon* poly);
133 
134  void onPointPicked(QPointF& point);
135 
136  void onCoordTrackedChanged(QPointF& coordinate);
137 
138  void onMapDisplayExtentChanged();
139 
140  void onZoomAreaToggled(bool checked);
141 
142  void onZoomOutToggled(bool checked);
143 
144  void onPanToggled(bool checked);
145 
146  void onPointPickerToggled(bool checked);
147 
148  void onGeomToggled(bool checked);
149 
150  void onBoxToggled(bool checked);
151 
152  void onReadPixelToggled(bool checked);
153 
154  void onExtraDisplaysToggled(bool checked);
155 
156  void onRecomposeClicked();
157 
158  void onRedComboBoxActivated(int index);
159 
160  void onGreenComboBoxActivated(int index);
161 
162  void onBlueComboBoxActivated(int index);
163 
164  void onMonoComboBoxActivated(int index);
165 
166  void onMonoToolClicked(bool flag);
167 
168  void onRedToolClicked(bool flag);
169 
170  void onGreenToolClicked(bool flag);
171 
172  void onBlueToolClicked(bool flag);
173 
174  void onCompositionToolClicked(bool flag);
175 
176  void onPreviewClicked();
177 
178  void onVSliderChanged(int value);
179 
180  void onHSliderChanged(int value);
181 
182  signals:
183 
184  void previewClicked();
185 
186  void mapDisplayExtentChanged();
187 
188  void pointPicked(double x, double y);
189 
190  void geomAquired(te::gm::Polygon* poly);
191 
192  void envelopeAcquired(te::gm::Envelope env);
193 
194  protected:
195 
196  void setCurrentTool(te::qt::widgets::AbstractTool* tool);
197 
198  void listBands();
199 
200  void getCompositionInfo();
201 
202  void setComboBoxText(QComboBox* cb, std::string value);
203 
204  void drawOverlay();
205 
206  private:
207 
208  std::auto_ptr<Ui::RasterNavigatorWidgetForm> m_ui;
209 
212 
217 
218  te::qt::widgets::Pan* m_panTool; //!< Pan tool (used in preview mode)
219  te::qt::widgets::ZoomWheel* m_zoomTool; //!< Zoom tool (used in preview mode)
220 
221  int m_currentColumn; //!< The column position of mouse in map display.
222  int m_currentRow; //!< The row position of mouse in map display.
223 
225 
226  QCursor m_pointCursor;
227 
228  QPixmap* m_draftOriginal;
229  };
230 
231  } // end namespace widgets
232  } // end namespace qt
233 } // end namespace te
234 
235 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_RASTERNAVIGATORWIDGET_H
236 
This class defines the map display EyeBird, this component is only a specific map that shows the orig...
te::qt::widgets::AbstractTool * m_tool
te::qt::widgets::ZoomWheel * m_zoomTool
Zoom tool (used in preview mode)
This class defines the map display ZoomIn, this component is only a specific map that shows the curre...
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Definition: Style.h:65
te::qt::widgets::MapDisplay * m_mapDisplay
te::qt::widgets::ZoomInMapDisplayWidget * m_zoomInMapDisplay
std::auto_ptr< Ui::RasterNavigatorWidgetForm > m_ui
te::qt::widgets::Pan * m_panTool
Pan tool (used in preview mode)
A widget to control the display of a set of layers.
Definition: MapDisplay.h:69
This class defines an interface for objects that can receive application events and respond to them...
Definition: AbstractTool.h:62
int m_currentRow
The row position of mouse in map display.
This class implements a concrete tool to geographic pan operation.
Definition: Pan.h:49
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
An abstract class for raster data strucutures.
Definition: Raster.h:71
URI C++ Library.
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
This event signals that the pan button toggled.
te::qt::widgets::EyeBirdMapDisplayWidget * m_eyeBirdMapDisplay
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:50
This class is used to navigate over a DataSetLayer (having a raster representation) and given a set o...
This class implements a concrete tool to geographic zoom operation using the mouse wheel...
Definition: ZoomWheel.h:49
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
int m_currentColumn
The column position of mouse in map display.
Visibility
Each layer can have three states of visibility.
Definition: Enums.h:139
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr