RasterEditWizardPage.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/RasterEditWizardPage.h
22 
23  \brief This file defines a class for raster data edition.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_RP_INTERNAL_RASTEREDITWIZARDPAGE_H
27 #define __TERRALIB_QT_WIDGETS_RP_INTERNAL_RASTEREDITWIZARDPAGE_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 #include "../../../qt/widgets/layer/explorer/LayerItemView.h"
35 #endif
36 #include "../Config.h"
37 
38 // STL
39 #include <memory>
40 
41 // Qt
42 #include <QWizardPage>
43 #include <QActionGroup>
44 #include <QTableWidgetItem>
45 
46 // Forward declaration
47 namespace Ui { class RasterEditWizardPageForm; }
48 
49 namespace te
50 {
51  namespace qt
52  {
53  namespace widgets
54  {
55  class RpToolsWidget;
56  class RasterNavigatorDialog;
57 
58  /*!
59  \class RasterEditWizardPage
60 
61  \brief This class is GUI used to define the parameters raster data edition.
62  */
63  class TEQTWIDGETSEXPORT RasterEditWizardPage : public QWizardPage
64  {
65  Q_OBJECT
66 
67  public:
68 
69  RasterEditWizardPage(QWidget* parent,
70  te::qt::widgets::MapDisplay* mainMapDispPtr,
71  te::qt::widgets::LayerItemView* mainLayerExplorerPtr );
72 
74 
75  bool isComplete() const;
76 
77  /*!
78  \brief This method is used to set the selected layer for editing operation
79 
80  \param layer The layer ptr
81 
82  \return true if ok, false on errors.
83 
84  \note This layer MUST HAVE a valid raster object.
85  */
86  bool setLayer(te::map::AbstractLayerPtr layer);
87 
88  /*!
89  \brief Return the current output raster.
90 
91  \return Return the current output raster.
92  */
93  std::shared_ptr< te::rst::Raster > getOutputRaster();
94 
95  /*!
96  \brief Return the current output pallete indexes to their respetive descriptions.
97 
98  \brief Return the current output pallete indexes to their respetive descriptions.
99  */
100  const std::vector< std::map< unsigned int , std::string > >&
101  getPalleteIndex2Descriptions() const { return m_palleteIndex2Descriptions; };
102 
103  protected slots:
104 
105  void addRulePushButtonClicked();
106 
107  void removeRulePushButtonClicked();
108 
109  void onEnvelopeAcquired(te::gm::Envelope env);
110 
111  void onGeomAquired(te::gm::Polygon* poly);
112 
113  void onPointPicked(double x, double y);
114 
115  void onSelectRoiItem();
116 
117  void onRemoveRoiItem();
118 
119  void onReplaceAllPushButtonClicked();
120 
121  void onAddNewValuePushButtonClicked();
122 
123  void onsetNewValueColorPushButtonClicked();
124 
125  void onLoadROISPushButtonClicked();
126 
127  void oldValueComboBoxcurrentIndexChanged(int index);
128 
129  void newValueComboBoxcurrentIndexChanged(int index);
130 
131  void drawGeometries();
132 
133  void onRoiTableWidgetItemClicked( QTableWidgetItem*);
134 
135  void onTansferPushButtonClicked();
136 
137  void onPointPickedOnMainMapDisplay( QPointF& );
138 
139  protected:
140 
141  unsigned int getBand();
142 
143  void getROIs(std::vector<te::gm::Geometry*> &geomVec);
144 
145  void getReplaceValues( std::vector< std::pair< double, double > >& replaceValues ) const;
146 
147  void updateValuesCombos();
148 
149  void addRoiItem();
150 
151  private:
152 
155  std::unique_ptr<Ui::RasterEditWizardPageForm> m_ui;
156  std::vector<te::gm::Geometry*> m_geomVec;
157  std::unique_ptr< te::qt::widgets::RasterNavigatorDialog > m_rasterMavDialogPtr;
158  std::shared_ptr< te::rst::Raster > m_outputRasterPtr;
159  std::string m_outputDataSourceID;
160  std::vector< std::map< unsigned int , std::string > > m_palleteIndex2Descriptions; // One map per band
161  };
162 
163  } // end namespace widgets
164  } // end namespace qt
165 } // end namespace te
166 
167 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_RASTEREDITWIZARDPAGE_H
#define slots
te::qt::widgets::MapDisplay * m_mainMapDispPtr
std::vector< std::map< unsigned int, std::string > > m_palleteIndex2Descriptions
A widget to control the display of a set of layers.
Definition: MapDisplay.h:71
This class is GUI used to define the parameters raster data edition.
std::unique_ptr< Ui::RasterEditWizardPageForm > m_ui
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
TerraLib.
A specialization of QTreeView for manipulate layers.
Definition: LayerItemView.h:78
std::shared_ptr< te::rst::Raster > m_outputRasterPtr
const std::vector< std::map< unsigned int, std::string > > & getPalleteIndex2Descriptions() const
Return the current output pallete indexes to their respetive descriptions.
std::unique_ptr< te::qt::widgets::RasterNavigatorDialog > m_rasterMavDialogPtr
te::qt::widgets::LayerItemView * m_mainLayerExplorerPtr
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::vector< te::gm::Geometry * > m_geomVec