All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClassifierWizardPage.h
Go to the documentation of this file.
1 /* Copyright (C) 2011-2012 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/ClassifierWizardPage.h
22 
23  \brief This file defines a class for a Classifier Wizard page.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_RP_INTERNAL_CLASSIFIERWIZARDPAGE_H
27 #define __TERRALIB_QT_WIDGETS_RP_INTERNAL_CLASSIFIERWIZARDPAGE_H
28 
29 // TerraLib
30 #include "../../../geometry/Polygon.h"
31 #include "../../../maptools/AbstractLayer.h"
32 #include "../../../rp/Classifier.h"
33 #include "../Config.h"
34 
35 // STL
36 #include <memory>
37 
38 // Qt
39 #include <QtGui/QWizardPage>
40 #include <QtGui/QTableWidget>
41 
42 // Forward declaration
43 namespace Ui { class ClassifierWizardPageForm; }
44 
45 namespace te
46 {
47  namespace qt
48  {
49  namespace widgets
50  {
51  class MapDisplay;
52 
53  /*!
54  \class ClassifierWizardPage
55 
56  \brief This class is GUI used to define the classifier parameters for the RP constast operation.
57  */
58  class TEQTWIDGETSEXPORT ClassifierWizardPage : public QWizardPage
59  {
60  Q_OBJECT
61 
63  {
64  CLASSIFIER_ISOSEG
65  };
66 
68  {
69  std::string m_id;
70  std::string m_name;
72  };
73 
74  public:
75 
76  ClassifierWizardPage(QWidget* parent = 0);
77 
79 
80  public:
81 
82  /*!
83  \brief This method is used to set the selected layer for classifier 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  te::rp::Classifier::InputParameters getInputParams();
92 
93  te::rp::Classifier::OutputParameters getOutputParams();
94 
95  protected:
96 
97  void fillClassifierTypes();
98 
99  void listBands();
100 
101  void drawSamples();
102 
103  void updateSamples();
104 
105  public slots:
106 
107  void onMapDisplayExtentChanged();
108 
109  void onGeomAquired(te::gm::Polygon* poly, te::qt::widgets::MapDisplay* map);
110 
111  void onItemChanged(QTableWidgetItem* item);
112 
113  void onRemoveToolButtonClicked();
114 
115  private:
116 
117  std::auto_ptr<Ui::ClassifierWizardPageForm> m_ui;
118 
119  std::map<std::string, ClassifierSamples > m_samples; //!< The map of selected samples
120  unsigned int m_countSamples; //!< The maximum number of samples inserted.
121 
124  };
125 
126  } // end namespace widgets
127  } // end namespace qt
128 } // end namespace te
129 
130 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_CLASSIFIERWIZARDPAGE_H
std::map< std::string, ClassifierSamples > m_samples
The map of selected samples.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:101
std::auto_ptr< Ui::ClassifierWizardPageForm > m_ui
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:50
unsigned int m_countSamples
The maximum number of samples inserted.
Classifier output parameters.
Definition: Classifier.h:127
A widget to control the display of a set of layers.
Definition: MapDisplay.h:65
te::qt::widgets::MapDisplay * m_display
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
Classifier input parameters.
Definition: Classifier.h:74
This class is GUI used to define the classifier parameters for the RP constast operation.