ClassifierWizardPage.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/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 "../../../classification/ROISet.h"
31 #ifndef Q_MOC_RUN
32 #include "../../../geometry/Polygon.h"
33 #include "../../../maptools/AbstractLayer.h"
34 #include "../../../raster/Raster.h"
35 #include "../../../rp/Classifier.h"
36 #include "../../../rp/ClassifierMAPStrategy.h"
37 #include "../../../rp/ClassifierEDStrategy.h"
38 #include "../../../rp/ClassifierSAMStrategy.h"
39 #include "../../../qt/widgets/canvas/MapDisplay.h"
40 #endif
41 #include "../Config.h"
42 
43 // STL
44 #include <memory>
45 
46 // Qt
47 #include <QWizardPage>
48 #include <QTableWidget>
49 #include <QActionGroup>
50 
51 // Forward declaration
52 namespace Ui { class ClassifierWizardPageForm; }
53 
54 namespace te
55 {
56  namespace qt
57  {
58  namespace widgets
59  {
60  class MapDisplay;
61  class ROIManagerDialog;
62 
63  /*!
64  \class ClassifierWizardPage
65 
66  \brief This class is GUI used to define the classifier parameters for the RP constast operation.
67  */
68  class TEQTWIDGETSEXPORT ClassifierWizardPage : public QWizardPage
69  {
70  Q_OBJECT
71 
73  {
79  CLASSIFIER_ED
80  };
81 
82  public:
83 
84  ClassifierWizardPage(QWidget* parent = 0);
85 
87 
88  bool isComplete() const;
89 
90  public:
91 
92  /*!
93  \brief This method is used to set the selected layer for classifier operation
94 
95  \param layer The layer ptr
96 
97  \note This layer MUST HAVE a valid raster object.
98  */
99  void set(te::map::AbstractLayerPtr layer);
100 
101  void setMapDisplay(te::qt::widgets::MapDisplay* mapDisplay);
102 
103  void setActionGroup(QActionGroup* actionGroup);
104 
105  void setList(std::list<te::map::AbstractLayerPtr>& layerList);
106 
107  te::rp::Classifier::InputParameters getInputParams();
108 
109  te::rp::Classifier::OutputParameters getOutputParams();
110 
111  te::cl::ROISet* getROISet();
112 
113  void clearCanvas();
114 
115  protected:
116 
117  void fillClassifierTypes();
118 
119  void listBands();
120 
122 
124 
126 
127  public slots:
128 
129  void showROIManager(bool show);
130 
131  void onROIManagerClosed(te::cl::ROISet* rs);
132 
133  void onChangeClassifier(int index);
134 
135  private:
136 
137  void fillMAPTable(te::cl::ROI* roi);
138 
139  void fillSAMTable(te::cl::ROI* roi);
140 
141  void fillEDTable(te::cl::ROI* roi);
142 
143  private:
144 
145  std::auto_ptr<Ui::ClassifierWizardPageForm> m_ui;
146  std::auto_ptr<te::qt::widgets::ROIManagerDialog> m_roiMngDlg;
147 
149 
151 
153 
155  };
156 
157  } // end namespace widgets
158  } // end namespace qt
159 } // end namespace te
160 
161 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_CLASSIFIERWIZARDPAGE_H
boost::shared_ptr< MClassesSamplesCT > MClassesSamplesCTPtr
A shared pointer to a multi classes samples container type definition.
boost::shared_ptr< MClassesSamplesCT > MClassesSamplesCTPtr
A shared pointer to a multi classes samples container type definition.
std::auto_ptr< te::qt::widgets::ROIManagerDialog > m_roiMngDlg
A widget to control the display of a set of layers.
Definition: MapDisplay.h:69
Classifier output parameters.
Definition: Classifier.h:127
boost::shared_ptr< ClassesSamplesT > ClassesSamplesTPtr
A shared pointer to a multi classes samples container type definition.
A ROISet is a set of ROI's.
Definition: ROISet.h:53
std::auto_ptr< Ui::ClassifierWizardPageForm > m_ui
An abstract class for raster data strucutures.
Definition: Raster.h:71
URI C++ Library.
This class is GUI used to define the classifier parameters for the RP constast operation.
A region of interest (often abbreviated ROI), is a selected subset of samples within a dataset identi...
Definition: ROI.h:60
#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
Classifier input parameters.
Definition: Classifier.h:74