RasterSlicingWizard.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 #ifndef TE_QT_WIDGETS_RASTERSLICINGWIZARD_H
22 #define TE_QT_WIDGETS_RASTERSLICINGWIZARD_H
23 
24 // TerraLib
25 #ifndef Q_MOC_RUN
26 #include "../../../maptools/AbstractLayer.h"
27 #include "../../../qt/widgets/canvas/MapDisplay.h"
28 #endif
29 #include "../Config.h"
30 //Qt
31 #include <QWizard>
32 #include <QActionGroup>
33 
34 //STL
35 #include <memory>
36 
37 namespace te
38 {
39  namespace qt
40  {
41  namespace widgets
42  {
43  //Forward declarations
44  class RasterSlicingWizardPage;
45  class LayerSearchWizardPage;
46  class RasterInfoWizardPage;
47 
48  class TEQTWIDGETSEXPORT RasterSlicingWizard : public QWizard
49  {
50  Q_OBJECT
51 
52  public:
53 
54  /*! \brief Constructor. */
55  RasterSlicingWizard(QWidget* parent=0);
56 
57  /*! \brief Destructor. */
59 
60  /*!
61  \brief Overridden function that checks if the current page's configuration is done in order to proceed to the next page.
62 
63  \return A boolean that indicates if the current page's configuration is finished.
64  */
65  bool validateCurrentPage();
66 
67  /*!
68  \brief This function sets the list of layers from which the raster that will be sliced will come from.
69 
70  \param layerList The list of AbstractLayerPtrs that will be used to get a raster from.
71  */
72  void setList(std::list<te::map::AbstractLayerPtr>& layerList);
73 
74  /*!
75  \brief This function returns the layer that has been created by the wizard with the sliced raster.
76 
77  \retunrn A new AbstractLayerPtr containing the sliced raster.
78  */
79  te::map::AbstractLayerPtr getOutputLayer();
80 
81  /*!
82  \brief This function sets the envelope that will be used to trim tha raster if the user requests it.
83 
84  \param extent A reference to the envelope that can be used to trim tha raster.
85  */
86  void setExtent(const te::gm::Envelope& extent);
87 
88  /*!
89  \brief This function sets the srid of the display when the wizard was initiated.
90 
91  \param srid The current srid of the display.
92  */
93  void setSRID(int srid = 0);
94 
95  /*!
96  \brief This function sets the map display.
97 
98  \param Map display.
99  */
100  void setMapDisplay(te::qt::widgets::MapDisplay* mapDisplay);
101 
102  /*!
103  \brief This function sets the QActionGroup.
104 
105  \param QActionGroup.
106  */
107  void setActionGroup(QActionGroup* actionGroup);
108 
109  /*!
110  \brief This function refreshes the map display when the layer extent was changed.
111  */
112  void onMapDisplayExtentChanged();
113 
114  protected:
115 
116  void addPages();
117 
118  bool execute();
119 
120  protected slots:
121 
122  void onPageChanged(int index);
123 
124  signals:
125 
126  void addLayer(te::map::AbstractLayerPtr layer);
127 
128  private:
129 
130  //No copy allowed
132  RasterSlicingWizard& operator=(const RasterSlicingWizard& rhs);
133 
134 
135  std::unique_ptr<te::qt::widgets::RasterSlicingWizardPage> m_wizardPage; //!< The wizard page used to define the slicing parameters
136  std::unique_ptr<te::qt::widgets::LayerSearchWizardPage> m_layerSearchPage; //!< The wizard page used to select an input layer
137  std::unique_ptr<te::qt::widgets::RasterInfoWizardPage> m_rasterInfoPage; //!< The wizard page used to define the output layer parameters
138 
140  };
141  } // namespace widgets
142  } // namespace qt
143 } // namespace te
144 
145 #endif // TE_QT_WIDGETS_RASTERSLICINGWIZARD_H
#define slots
A widget to control the display of a set of layers.
Definition: MapDisplay.h:71
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
URI C++ Library.
te::map::AbstractLayerPtr m_outputLayer
std::unique_ptr< te::qt::widgets::RasterInfoWizardPage > m_rasterInfoPage
The wizard page used to define the output layer parameters.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
std::unique_ptr< te::qt::widgets::RasterSlicingWizardPage > m_wizardPage
The wizard page used to define the slicing parameters.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::unique_ptr< te::qt::widgets::LayerSearchWizardPage > m_layerSearchPage
The wizard page used to select an input layer.