All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MixtureModelWizardPage.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/MixtureModelWizardPage.h
22 
23  \brief This file defines a class for a MixtureModel Wizard page.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_RP_INTERNAL_MIXTUREMODELWIZARDPAGE_H
27 #define __TERRALIB_QT_WIDGETS_RP_INTERNAL_MIXTUREMODELWIZARDPAGE_H
28 
29 // TerraLib
30 #include "../../../color/RGBAColor.h"
31 #include "../../../geometry/Coord2D.h"
32 #include "../../../maptools/AbstractLayer.h"
33 #include "../../../raster/Raster.h"
34 #include "../../../rp/MixtureModel.h"
35 #include "../Config.h"
36 
37 // STL
38 #include <memory>
39 
40 // Qt
41 #include <QtGui/QWizardPage>
42 #include <QtGui/QTableWidget>
43 
44 // Forward declaration
45 namespace Ui { class MixtureModelWizardPageForm; }
46 
47 namespace te
48 {
49  namespace se { class Mark; }
50 
51  namespace qt
52  {
53  namespace widgets
54  {
55  class MapDisplay;
56  class RasterNavigatorDialog;
57 
58  /*!
59  \class MixtureModelWizardPage
60 
61  \brief This class is GUI used to define the mixture model parameters for the RP constast operation.
62  */
63  class TEQTWIDGETSEXPORT MixtureModelWizardPage : public QWizardPage
64  {
65  Q_OBJECT
66 
68  {
70  MIXMODEL_PCA
71  };
72 
74  {
75  std::string m_id;
76  std::string m_name;
79  std::vector<double> m_values;
80  };
81 
82  public:
83 
84  MixtureModelWizardPage(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 mixture model 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 
102 
103  te::rp::MixtureModel::InputParameters getInputParams();
104 
105  te::rp::MixtureModel::OutputParameters getOutputParams();
106 
107  public slots:
108 
109  void onMapDisplayExtentChanged();
110 
111  void onPointPicked(double x, double y, te::qt::widgets::MapDisplay* map);
112 
113  void onItemChanged(QTableWidgetItem* item);
114 
115  void onRemoveToolButtonClicked();
116 
117  void showNavigator(bool show);
118 
119  void onNavigatorClosed();
120 
121  protected:
122 
123  void fillMixtureModelTypes();
124 
125  void listBands();
126 
127  void drawMarks();
128 
129  void updateComponents();
130 
131  private:
132 
133  std::auto_ptr<Ui::MixtureModelWizardPageForm> m_ui;
134  std::auto_ptr<te::qt::widgets::RasterNavigatorDialog> m_navigatorDlg;
135 
136  std::map<std::string, MixModelComponent > m_components; //!< The map of selected components
137  unsigned int m_countComponents; //!< The maximum number of components inserted.
138 
143  };
144 
145  } // end namespace widgets
146  } // end namespace qt
147 } // end namespace te
148 
149 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_MIXTUREMODELWIZARDPAGE_H
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:101
This class is GUI used to define the mixture model parameters for the RP constast operation...
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
std::map< std::string, MixModelComponent > m_components
The map of selected components.
std::auto_ptr< Ui::MixtureModelWizardPageForm > m_ui
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
A widget to control the display of a set of layers.
Definition: MapDisplay.h:65
MixtureModel output parameters.
Definition: MixtureModel.h:123
MixtureModel input parameters.
Definition: MixtureModel.h:69
unsigned int m_countComponents
The maximum number of components inserted.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::auto_ptr< te::qt::widgets::RasterNavigatorDialog > m_navigatorDlg
A Mark specifies a geometric shape and applies coloring to it.
Definition: Mark.h:84