ClippingWizardPage.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/ClippingWizardPage.h
22 
23  \brief This file defines a class for a Clipping Wizard page.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_RP_INTERNAL_CLIPPINGWIZARDPAGE_H
27 #define __TERRALIB_QT_WIDGETS_RP_INTERNAL_CLIPPINGWIZARDPAGE_H
28 
29 // TerraLib
30 #include "../../../geometry/Envelope.h"
31 #ifndef Q_MOC_RUN
32 #include "../../../maptools/AbstractLayer.h"
33 #include "../../../qt/widgets/canvas/MapDisplay.h"
34 #endif
35 #include "../Config.h"
36 
37 // STL
38 #include <memory>
39 
40 // Qt
41 #include <QWizardPage>
42 #include <QActionGroup>
43 
44 // Forward declaration
45 namespace Ui { class ClippingWizardPageForm; }
46 
47 namespace te
48 {
49  namespace qt
50  {
51  namespace widgets
52  {
53  class RpToolsWidget;
54 
55  /*!
56  \class ClippingWizardPage
57 
58  \brief This class is GUI used to define the clipping parameters for the RP constast operation.
59  */
60  class TEQTWIDGETSEXPORT ClippingWizardPage : public QWizardPage
61  {
62  Q_OBJECT
63 
65  {
69  CLIPPING_LAYER
70  };
71 
72  public:
73 
74  ClippingWizardPage(QWidget* parent = 0);
75 
77 
78  bool isComplete() const;
79 
80  public:
81 
82  /*!
83  \brief This method is used to set the selected layer for clipping operation
84 
85  \param layer The layer ptr
86 
87  \note This layer MUST HAVE a valid raster object.
88  */
89  void set(te::map::AbstractLayerPtr layer);
90 
91  void setList(std::list<te::map::AbstractLayerPtr>& layerList);
92 
93  void setMapDisplay(te::qt::widgets::MapDisplay* mapDisplay);
94 
95  void setActionGroup(QActionGroup* actionGroup);
96 
98 
99  bool isExtentClipping();
100 
101  bool isLayerExtentClipping();
102 
103  bool isDimensionClipping();
104 
105  bool isLayerClipping();
106 
107  bool isSingleRasterResult();
108 
109  void getExtentClipping(std::auto_ptr<gm::GeometryCollection> &geomColl);
110 
111  void getLayerExtentClipping(te::gm::Envelope& env);
112 
113  void getDimensionClipping(int& x, int& y, int& width, int& height);
114 
115  void getLayerClipping(std::auto_ptr< te::gm::GeometryCollection> &geomColl);
116 
117  void clearCanvas();
118 
119  public slots:
120 
121  void onStrategyTypeComboBoxActivated(int index);
122 
123  void onStrategyTypeComboBoxChanged(int index);
124 
125  void onLayerComboBoxActivated(int index);
126 
127  void onLayerComboBoxChanged(int index);
128 
129  void onExtentLayerComboBoxChanged(int index);
130 
131  void onEnvelopeAcquired(te::gm::Envelope env);
132 
133  void onGeomAquired(te::gm::Polygon* poly);
134 
135  void onEnvelopeDimensionAcquired();
136 
137  void onSelectRoiItem();
138 
139  void onRemoveRoiItem();
140 
141  void onPreviewClicked();
142 
143  void drawGeom();
144 
145  protected:
146 
147  void fillClippingTypes();
148 
149  private:
150 
151  void addRoiItem();
152 
153  void showExtentLayerSelected(std::list<te::map::AbstractLayerPtr>& layerList);
154 
155  private:
156 
157  std::auto_ptr<Ui::ClippingWizardPageForm> m_ui;
158  std::auto_ptr<te::qt::widgets::RpToolsWidget> m_navigator;
159 
161 
162  std::list<te::map::AbstractLayerPtr> m_layerList;
163 
165 
167 
168  std::vector<te::gm::Geometry*> m_geomVec;
169 
171 
172  int m_count;
173  };
174 
175  } // end namespace widgets
176  } // end namespace qt
177 } // end namespace te
178 
179 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_CLIPPINGWIZARDPAGE_H
te::qt::widgets::MapDisplay * m_mapDisplay
std::auto_ptr< Ui::ClippingWizardPageForm > m_ui
std::vector< te::gm::Geometry * > m_geomVec
A widget to control the display of a set of layers.
Definition: MapDisplay.h:69
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
URI C++ Library.
std::auto_ptr< te::qt::widgets::RpToolsWidget > m_navigator
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:50
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::list< te::map::AbstractLayerPtr > m_layerList
This class is GUI used to define the clipping parameters for the RP constast operation.