ClassifierDialog.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/ClassifierDialog.h
22 
23  \brief A dialog used to execute image classification.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_RP_INTERNAL_CLASSIFIERDIALOG_H
27 #define __TERRALIB_QT_WIDGETS_RP_INTERNAL_CLASSIFIERDIALOG_H
28 
29 // TerraLib
30 #include "../Config.h"
31 #include "../../../raster/Raster.h"
32 
33 // Qt
34 #include <QDialog>
35 
36 // STL
37 #include <map>
38 #include <string>
39 
40 // Boost
41 #include <boost/shared_ptr.hpp>
42 
43 // Forward user interface declaration
44 namespace Ui
45 {
46  class ClassifierForm;
47 }
48 
49 namespace te
50 {
51  namespace qt
52  {
53  namespace widgets
54  {
55  /*!
56  \class ClassifierDialog
57 
58  \brief A dialog used to execute image classification.
59  */
60  class TEQTWIDGETSEXPORT ClassifierDialog : public QDialog
61  {
62  Q_OBJECT
63 
64  public:
65 
66  /*!
67  \brief Constructs a basic dialog which is a child of parent, with widget flags set to f.
68 
69  \param inputRasterPtr Input raster pointer.
70  \param inputPolygons Vector of input polygons.
71  \param outpuRasterDSType Output raster data source type (as described in te::rst::RasterFactory).
72  \param outpuRasterInfo The necessary information to create the raster (as described in te::rst::RasterFactory).
73  \param parent Parent widget pointer.
74  \param f Widget flags.
75  */
76  ClassifierDialog(const te::rst::Raster* inputRasterPtr,
77  std::vector<te::gm::Polygon*> inputPolygons,
78  const std::string& outpuRasterDSType,
79  const std::map<std::string, std::string>& outpuRasterInfo,
80  QWidget* parent = 0,
81  Qt::WindowFlags f = 0);
82 
83  /*! \brief Destructor. */
85 
86  /*!
87  \brief Returns the output result raster.
88 
89  \param outputRasterPtr A pointer to the output result raster
90 
91  \return true if OK, false on errors.
92  */
93  bool getOutputRaster(boost::shared_ptr< te::rst::Raster >& outputRasterPtr);
94 
95  protected slots:
96 
97  void on_okPushButton_clicked();
98 
99  private:
100 
101  Ui::ClassifierForm* m_uiPtr; //!< User interface.
102  const te::rst::Raster* m_inputRasterPtr; //!< Input raster pointer.
103  std::vector<te::gm::Polygon*> m_inputPolygons; //!< Vector of input polygons.
104  std::string m_outpuRasterDSType; //!< Output raster data source type (as described in te::rst::RasterFactory).
105  std::map<std::string, std::string> m_outpuRasterInfo; //!< The necessary information to create the raster (as described in te::rst::RasterFactory).
106  boost::shared_ptr<te::rst::Raster> m_outputRasterPtr; //!< Output raster pointer.
107  };
108 
109  } // end namespace widgets
110  } // end namespace qt
111 } // end namespace te
112 
113 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_CLASSIFIERDIALOG_H
std::vector< te::gm::Polygon * > m_inputPolygons
Vector of input polygons.
A dialog used to execute image classification.
std::string m_outpuRasterDSType
Output raster data source type (as described in te::rst::RasterFactory).
An abstract class for raster data strucutures.
Definition: Raster.h:71
URI C++ Library.
const te::rst::Raster * m_inputRasterPtr
Input raster pointer.
std::map< std::string, std::string > m_outpuRasterInfo
The necessary information to create the raster (as described in te::rst::RasterFactory).
Ui::ClassifierForm * m_uiPtr
User interface.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
boost::shared_ptr< te::rst::Raster > m_outputRasterPtr
Output raster pointer.