ROISet.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/classification/ROISet.h
22 
23  \brief A ROISet is a set of ROI's.
24 */
25 
26 #ifndef __TERRALIB_CLASSIFICATION_INTERNAL_ROISET_H
27 #define __TERRALIB_CLASSIFICATION_INTERNAL_ROISET_H
28 
29 // TerraLib
30 #include "ROI.h"
31 #include "Config.h"
32 
33 // STL
34 #include <map>
35 #include <string>
36 #include <memory>
37 
38 namespace te
39 {
40  namespace da
41  {
42  class DataSet;
43  class DataSetType;
44  }
45 
46  namespace cl
47  {
48  /*!
49  \brief A ROISet is a set of ROI's.
50 
51  \sa ROI
52  */
54  {
55  public:
56 
57  /*! \brief Default constructor. */
58  ROISet();
59 
60  /*! \brief Virtual destructor. */
61  virtual ~ROISet();
62 
63  public:
64 
65  /*!
66  \brief Gets a ROI from this set.
67 
68  \param label The label of the ROI to be selected.
69  */
70  te::cl::ROI* getROI(std::string label);
71 
72  /*!
73  \brief Add a new ROI to this set.
74 
75  \param roi A pointer to a ROI object.
76  */
77  void addROI(te::cl::ROI* roi);
78 
79  /*!
80  \brief Removes a ROI from this set.
81 
82  \param label The label of the ROI to be removed.
83  */
84  void removeROI(std::string label);
85 
86  /*! \brief Get the roi set map. */
87  std::map<std::string, te::cl::ROI*>& getROISet();
88 
89  /*!
90  \brief Export the ROISet to a shapefile
91 
92  \param fileName The file name path.
93 
94  \param srid The spatial reference system used to export the ROI's.
95  */
96  void exportToFile(std::string fileName, int srid);
97 
98  /*!
99  \brief Imports the ROISet from a dataset
100 
101  \param ds The dataset with the ROISet information
102 
103  \return If the dataset has a valid ROISet information, a valid ROISet pointer will be returned,
104  in other case, a NULL pointer will be returned.
105  */
106  static te::cl::ROISet* createROISet(std::auto_ptr<te::da::DataSet> ds);
107 
108  protected:
109 
110  /*! \brief Creates a dataset type that defines a roi. */
111  std::auto_ptr<te::da::DataSetType> getDataSetType(int srid);
112 
113  /*! \brief Creates a dataset that with the roi set information. */
114  std::auto_ptr<te::da::DataSet> getDataSet(int srid);
115 
116  private:
117 
118  std::map<std::string, te::cl::ROI*> m_roiMap; //!< The map of ROI's.
119  };
120  } // end namespace cl
121 } // end namespace te
122 
123 
124 #endif // __TERRALIB_CLASSIFICATION_INTERNAL_ROISET_H
A ROISet is a set of ROI's.
Definition: ROISet.h:53
Configuration flags for the Terrralib Classification module.
URI C++ Library.
std::map< std::string, te::cl::ROI * > m_roiMap
The map of ROI's.
Definition: ROISet.h:118
A region of interest (often abbreviated ROI), is a selected subset of samples within a dataset identi...
Definition: ROI.h:60
#define TECLEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:105
A region of interest (often abbreviated ROI), is a selected subset of samples within a dataset identi...