VectorizationWizard.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_VECTORIZATIONWIZARD_H
22 #define TE_QT_WIDGETS_VECTORIZATIONWIZARD_H
23 
24 //TerraLib
25 #ifndef Q_MOC_RUN
26 #include "../../../dataaccess/datasource/DataSource.h"
27 #include "../../../maptools/AbstractLayer.h"
28 #endif
29 #include "../Config.h"
30 
31 //Qt
32 #include <QWizard>
33 
34 //STL
35 #include <memory>
36 
37 namespace te
38 {
39  //forward declarations
40  namespace da { class DataSetType; }
41  namespace mem { class DataSet; }
42 
43  namespace qt
44  {
45  namespace widgets
46  {
47  //Forward declarations
48  class VectorizationWizardPage;
49  class LayerSearchWizardPage;
50 
51  class TEQTWIDGETSEXPORT VectorizationWizard : public QWizard
52  {
53  Q_OBJECT
54 
55  public:
56 
57  VectorizationWizard(QWidget* parent=0);
58 
60 
61  bool validateCurrentPage();
62 
63  void setList(std::list<te::map::AbstractLayerPtr>& layerList);
64 
65  te::map::AbstractLayerPtr getOutputLayer();
66 
67  protected:
68 
69  void addPages();
70 
71  bool execute();
72 
73  /*! Function used to create the output dataset type */
74  std::unique_ptr<te::da::DataSetType> createDataSetType(std::string dataSetName, int srid);
75 
76  /*! Function used to create the output data */
77  std::unique_ptr<te::mem::DataSet> createDataSet(te::da::DataSetType* dsType, std::vector<te::gm::Geometry*>& geoms, std::vector< double >& geomsValues );
78 
79  /*! Function used to save the output dataset */
80  void saveDataSet(te::mem::DataSet* dataSet, te::da::DataSetType* dsType, te::da::DataSourcePtr ds, std::string dataSetName);
81 
82  protected slots:
83 
84  void onPageChanged(int index);
85 
86  private:
87 
88  std::unique_ptr<te::qt::widgets::VectorizationWizardPage> m_vectorPage;
89  std::unique_ptr<te::qt::widgets::LayerSearchWizardPage> m_layerSearchPage;
90 
92  };
93 
94  } // namespace widgets
95  } // namespace qt
96 } // namespace te
97 
98 #endif // TE_QT_WIDGETS_VECTORIZATIONWIZARD_H
#define slots
te::map::AbstractLayerPtr m_outputLayer
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1449
A class that models the description of a dataset.
Definition: DataSetType.h:72
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver...
Definition: DataSet.h:65
std::unique_ptr< te::qt::widgets::LayerSearchWizardPage > m_layerSearchPage
TerraLib.
std::unique_ptr< te::qt::widgets::VectorizationWizardPage > m_vectorPage
#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