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 #include "../../../geometry/Polygon.h"
32 #include "../../../maptools/AbstractLayer.h"
33 #include "../../../maptools/Enums.h"
34 #include "../Config.h"
35 
36 // STL
37 #include <memory>
38 
39 // Qt
40 #include <QComboBox>
41 #include <QWidget>
42 
43 namespace Ui { class RasterNavigatorWidgetForm; }
44 
45 namespace te
46 {
47  namespace gm { class Envelope; }
48  namespace rst { class Raster; }
49  namespace se { class RasterSymbolizer; }
50 
51  namespace qt
52  {
53  namespace widgets
54  {
55  class AbstractTool;
56  class EyeBirdMapDisplayWidget;
57  class MapDisplay;
58  class Pan;
59  class ZoomInMapDisplayWidget;
60  class ZoomWheel;
61 
62  /*!
63  \class RasterNavigatorWidget
64 
65  \brief This class is used to navigate over a DataSetLayer (having a raster representation)
66  and given a set of tools, such as, zoom in, zoom out, pan, recompose.
67  Two new tools as created for raster interaction:
68  - point clicked
69  - geom definition
70 
71  \sa RasterFactory
72  */
74  {
75  Q_OBJECT
76 
77  public:
78 
79  RasterNavigatorWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
80 
82 
83  public:
84 
85  /*!
86  \brief This method is used to set the selected layer
87 
88  \param layer The layer ptr
89 
90  \note This layer MUST HAVE a valid raster object.
91  */
92  void set(te::map::AbstractLayerPtr layer, bool setFullScaleBox = false);
93 
94  void setVectorial(te::map::AbstractLayerPtr layer);
95 
96  void setExtent(te::gm::Envelope env);
97 
98  void removeVectorial();
99 
100  te::gm::Envelope getCurrentExtent();
101 
102  te::qt::widgets::MapDisplay* getDisplay();
103 
104  te::rst::Raster* getExtentRaster(bool fullScale = false);
105 
106  void drawRaster(te::rst::Raster* rst, te::se::Style* style = 0);
107 
108  void showAsPreview(bool asPreview, bool enableZoom = true);
109 
110  void hideColorCompositionTool(bool hide);
111 
112  void hideEditionTools(bool hide);
113 
114  void hidePickerTool(bool hide);
115 
116  void hideGeomTool(bool hide);
117 
118  void hideBoxTool(bool hide);
119 
120  void hideInfoTool(bool hide);
121 
122  void hideExtraDisplaysTool(bool hide);
123 
124  void setSelectionMode(bool mode);
125 
126  protected slots:
127 
128  void onEnvelopeAcquired(te::gm::Envelope env);
129 
130  void onGeomAquired(te::gm::Polygon* poly);
131 
132  void onPointPicked(QPointF& point);
133 
134  void onCoordTrackedChanged(QPointF& coordinate);
135 
136  void onMapDisplayExtentChanged();
137 
138  void onZoomAreaToggled(bool checked);
139 
140  void onZoomOutToggled(bool checked);
141 
142  void onPanToggled(bool checked);
143 
144  void onPointPickerToggled(bool checked);
145 
146  void onGeomToggled(bool checked);
147 
148  void onBoxToggled(bool checked);
149 
150  void onReadPixelToggled(bool checked);
151 
152  void onExtraDisplaysToggled(bool checked);
153 
154  void onRecomposeClicked();
155 
156  void onRedComboBoxActivated(int index);
157 
158  void onGreenComboBoxActivated(int index);
159 
160  void onBlueComboBoxActivated(int index);
161 
162  void onMonoComboBoxActivated(int index);
163 
164  void onMonoToolClicked(bool flag);
165 
166  void onRedToolClicked(bool flag);
167 
168  void onGreenToolClicked(bool flag);
169 
170  void onBlueToolClicked(bool flag);
171 
172  void onCompositionToolClicked(bool flag);
173 
174  void onPreviewClicked();
175 
176  void onVSliderChanged(int value);
177 
178  void onHSliderChanged(int value);
179 
180  signals:
181 
182  void previewClicked();
183 
184  void mapDisplayExtentChanged();
185 
186  void pointPicked(double x, double y);
187 
188  void geomAquired(te::gm::Polygon* poly);
189 
190  void envelopeAcquired(te::gm::Envelope env);
191 
192  protected:
193 
194  void setCurrentTool(te::qt::widgets::AbstractTool* tool);
195 
196  void listBands();
197 
198  void getCompositionInfo();
199 
200  void setComboBoxText(QComboBox* cb, std::string value);
201 
202  void drawOverlay();
203 
204  private:
205 
206  std::auto_ptr<Ui::RasterNavigatorWidgetForm> m_ui;
207 
210 
215 
216  te::qt::widgets::Pan* m_panTool; //!< Pan tool (used in preview mode)
217  te::qt::widgets::ZoomWheel* m_zoomTool; //!< Zoom tool (used in preview mode)
218 
219  int m_currentColumn; //!< The column position of mouse in map display.
220  int m_currentRow; //!< The row position of mouse in map display.
221 
223 
224  QCursor m_pointCursor;
225 
226  QPixmap* m_draftOriginal;
227  };
228 
229  } // end namespace widgets
230  } // end namespace qt
231 } // end namespace te
232 
233 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_RASTERNAVIGATORWIDGET_H
234 
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:66
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:138
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr