RpToolsWidget.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/RpToolsWidget.h
22 
23  \brief This file has the RpToolsWidget class.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_RP_INTERNAL_ROTOOLSWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_RP_INTERNAL_ROTOOLSWIDGET_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 #include <qactiongroup.h>
45 
46 namespace Ui { class RpToolsWidgetForm; }
47 
48 namespace te
49 {
50  namespace gm { class Envelope; }
51  namespace rst { class Raster; }
52  namespace qt
53  {
54  namespace widgets
55  {
56  class AbstractTool;
57  class MapDisplay;
58 
59  /*!
60  \class RpToolsWidget
61 
62  \brief This class is used to navigate over a DataSetLayer (having a raster representation)
63  and given a set of tools, such as, zoom in, zoom out, pan, recompose.
64  Two new tools as created for raster interaction:
65  - point clicked
66  - geom definition
67 
68  \sa RasterFactory
69  */
70  class TEQTWIDGETSEXPORT RpToolsWidget : public QWidget
71  {
72  Q_OBJECT
73 
74  public:
75 
76  RpToolsWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
77 
78  ~RpToolsWidget();
79 
80  public:
81 
82  void setMapDisplay(te::qt::widgets::MapDisplay* mapDisplay);
83 
84  void setActionGroup(QActionGroup* actionGroup);
85 
86  void hideEditionTools(bool hide);
87 
88  void enablePickerAction();
89 
90  void enableGeomAction();
91 
92  void enableBoxAction();
93 
94  void setPickerTool(bool checked);
95 
96  void setGeomTool(bool checked);
97 
98  void setEnvelopeTool(bool checked);
99 
100  void setSelectionMode(bool mode);
101 
102  void onDisableToolbar();
103 
104  protected slots:
105 
106  void onEnvelopeAcquired(te::gm::Envelope env);
107 
108  void onGeomAquired(te::gm::Polygon* poly);
109 
110  void onPointPicked(QPointF& point);
111 
112  void onPointPickerToggled(bool checked);
113 
114  void onGeomToggled(bool checked);
115 
116  void onBoxToggled(bool checked);
117 
118  signals:
119 
120  void pointPicked(double x, double y);
121 
122  void geomAquired(te::gm::Polygon* poly);
123 
124  void envelopeAcquired(te::gm::Envelope env);
125 
126  private:
127 
128  std::unique_ptr<Ui::RpToolsWidgetForm> m_ui;
129 
131 
132  QActionGroup* m_actionGroup;
133 
134  QAction* m_pickerAction;
135 
136  QAction* m_geomAction;
137 
138  QAction* m_boxAction;
139 
140  QCursor m_pointCursor;
141  };
142 
143  } // end namespace widgets
144  } // end namespace qt
145 } // end namespace te
146 
147 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_ROTOOLSWIDGET_H
148 
#define slots
te::qt::widgets::MapDisplay * m_mapDisplay
A widget to control the display of a set of layers.
Definition: MapDisplay.h:71
std::unique_ptr< Ui::RpToolsWidgetForm > m_ui
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
URI C++ Library.
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...
Definition: RpToolsWidget.h:70
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63