All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RasterNavigatorWidget.h
Go to the documentation of this file.
1 /* Copyright (C) 2011-2012 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/Polygon.h"
31 #include "../../../maptools/AbstractLayer.h"
32 #include "../../../maptools/Enums.h"
33 #include "../Config.h"
34 
35 // STL
36 #include <memory>
37 
38 // Qt
39 #include <QtGui/QWidget>
40 #include <QtGui/QComboBox>
41 
42 namespace Ui { class RasterNavigatorWidgetForm; }
43 
44 namespace te
45 {
46  namespace gm { class Envelope; }
47  namespace rst { class Raster; }
48  namespace se { class RasterSymbolizer; }
49 
50  namespace qt
51  {
52  namespace widgets
53  {
54  class AbstractTool;
55  class EyeBirdMapDisplayWidget;
56  class MapDisplay;
57  class Pan;
58  class ZoomInMapDisplayWidget;
59  class ZoomWheel;
60 
61  /*!
62  \class RasterNavigatorWidget
63 
64  \brief This class is used to navigate over a DataSetLayer (having a raster representation)
65  and given a set of tools, such as, zoom in, zoom out, pan, recompose.
66  Two new tools as created for raster interaction:
67  - point clicked
68  - geom definition
69 
70  \sa RasterFactory
71  */
73  {
74  Q_OBJECT
75 
76  public:
77 
78  RasterNavigatorWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
79 
81 
82  public:
83 
84  /*!
85  \brief This method is used to set the selected layer for mixture model operation
86 
87  \param layer The layer ptr
88 
89  \note This layer MUST HAVE a valid raster object.
90  */
91  void set(te::map::AbstractLayerPtr layer, bool setFullScaleBox = false);
92 
93  te::gm::Envelope getCurrentExtent();
94 
95  te::qt::widgets::MapDisplay* getDisplay();
96 
97  te::rst::Raster* getExtentRaster(bool fullScale = false);
98 
99  void drawRaster(te::rst::Raster* rst, te::se::Style* style = 0);
100 
101  void showAsPreview(bool asPreview);
102 
103  void hideColorCompositionTool(bool hide);
104 
105  void hideEditionTools(bool hide);
106 
107  void hidePickerTool(bool hide);
108 
109  void hideGeomTool(bool hide);
110 
111  void hideInfoTool(bool hide);
112 
113  void hideExtraDisplaysTool(bool hide);
114 
115  protected slots:
116 
117  void onGeomAquired(te::gm::Polygon* poly);
118 
119  void onPointPicked(QPointF& point);
120 
121  void onCoordTrackedChanged(QPointF& coordinate);
122 
123  void onMapDisplayExtentChanged();
124 
125  void onZoomAreaToggled(bool checked);
126 
127  void onZoomOutToggled(bool checked);
128 
129  void onPanToggled(bool checked);
130 
131  void onPointPickerToggled(bool checked);
132 
133  void onGeomToggled(bool checked);
134 
135  void onReadPixelToggled(bool checked);
136 
137  void onExtraDisplaysToggled(bool checked);
138 
139  void onRecomposeClicked();
140 
141  void onRedComboBoxActivated(int index);
142 
143  void onGreenComboBoxActivated(int index);
144 
145  void onBlueComboBoxActivated(int index);
146 
147  void onMonoComboBoxActivated(int index);
148 
149  void onMonoToolClicked(bool flag);
150 
151  void onRedToolClicked(bool flag);
152 
153  void onGreenToolClicked(bool flag);
154 
155  void onBlueToolClicked(bool flag);
156 
157  void onCompositionToolClicked(bool flag);
158 
159  void onPreviewClicked();
160 
161  signals:
162 
163  void previewClicked();
164 
165  void mapDisplayExtentChanged();
166 
167  void pointPicked(double x, double y, te::qt::widgets::MapDisplay* map);
168 
169  void geomAquired(te::gm::Polygon* poly, te::qt::widgets::MapDisplay* map);
170 
171  protected:
172 
173  void setCurrentTool(te::qt::widgets::AbstractTool* tool);
174 
175  void listBands();
176 
177  void getCompositionInfo();
178 
179  void setComboBoxText(QComboBox* cb, std::string value);
180 
181  private:
182 
183  std::auto_ptr<Ui::RasterNavigatorWidgetForm> m_ui;
184 
187 
192 
193  te::qt::widgets::Pan* m_panTool; //!< Pan tool (used in preview mode)
194  te::qt::widgets::ZoomWheel* m_zoomTool; //!< Zoom tool (used in preview mode)
195 
196  int m_currentColumn; //!< The column position of mouse in map display.
197  int m_currentRow; //!< The row position of mouse in map display.
199  };
200 
201  } // end namespace widgets
202  } // end namespace qt
203 } // end namespace te
204 
205 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_RASTERNAVIGATORWIDGET_H
206 
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:101
int m_currentRow
The row position of mouse in map display.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:50
te::qt::widgets::ZoomInMapDisplayWidget * m_zoomInMapDisplay
te::qt::widgets::EyeBirdMapDisplayWidget * m_eyeBirdMapDisplay
This class defines an interface for objects that can receive application events and respond to them...
Definition: AbstractTool.h:62
This class implements a concrete tool to geographic zoom operation using the mouse wheel...
Definition: ZoomWheel.h:49
Visibility
Each layer can have three states of visibility.
Definition: Enums.h:138
This class implements a concrete tool to geographic pan operation.
Definition: Pan.h:49
te::qt::widgets::Pan * m_panTool
Pan tool (used in preview mode)
This class is used to navigate over a DataSetLayer (having a raster representation) and given a set o...
int m_currentColumn
The column position of mouse in map display.
This class defines the map display ZoomIn, this component is only a specific map that shows the curre...
te::qt::widgets::AbstractTool * m_tool
A widget to control the display of a set of layers.
Definition: MapDisplay.h:65
This event signals that the pan button toggled.
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::ZoomWheel * m_zoomTool
Zoom tool (used in preview mode)
te::qt::widgets::MapDisplay * m_mapDisplay
std::auto_ptr< Ui::RasterNavigatorWidgetForm > m_ui
An abstract class for raster data strucutures.
Definition: Raster.h:70
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
This class defines the map display EyeBird, this component is only a specific map that shows the orig...
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51