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  /*!
87  \brief Updates a ROI from this set.
88 
89  \param oldLabel The label of the ROI to be updated.
90 
91  \param newLabel The new label of ROI.
92  */
93  void updateROILabel(std::string oldLabel, std::string newLabel);
94 
95  /*! \brief Get the roi set map. */
96  std::map<std::string, te::cl::ROI*>& getROISet();
97 
98  /*!
99  \brief Export the ROISet to a shapefile
100 
101  \param fileName The file name path.
102 
103  \param srid The spatial reference system used to export the ROI's.
104  */
105  void exportToFile(std::string fileName, int srid);
106 
107  /*!
108  \brief Imports the ROISet from a dataset
109 
110  \param ds The dataset with the ROISet information
111 
112  \return If the dataset has a valid ROISet information, a valid ROISet pointer will be returned,
113  in other case, a NULL pointer will be returned.
114  */
115  static te::cl::ROISet* createROISet(std::unique_ptr<te::da::DataSet> ds);
116 
117  protected:
118 
119  /*! \brief Creates a dataset type that defines a roi. */
120  std::unique_ptr<te::da::DataSetType> getDataSetType(int srid);
121 
122  /*! \brief Creates a dataset that with the roi set information. */
123  std::unique_ptr<te::da::DataSet> getDataSet(int srid);
124 
125  private:
126 
127  std::map<std::string, te::cl::ROI*> m_roiMap; //!< The map of ROI's.
128  };
129  } // end namespace cl
130 } // end namespace te
131 
132 
133 #endif // __TERRALIB_CLASSIFICATION_INTERNAL_ROISET_H
A region of interest (often abbreviated ROI), is a selected subset of samples within a dataset identi...
A ROISet is a set of ROI's.
Definition: ROISet.h:54
ROISet()
Default constructor.
std::map< std::string, te::cl::ROI * > & getROISet()
Get the roi set map.
std::unique_ptr< te::da::DataSetType > getDataSetType(int srid)
Creates a dataset type that defines a roi.
void exportToFile(std::string fileName, int srid)
Export the ROISet to a shapefile.
te::cl::ROI * getROI(std::string label)
Gets a ROI from this set.
void removeROI(std::string label)
Removes a ROI from this set.
std::map< std::string, te::cl::ROI * > m_roiMap
The map of ROI's.
Definition: ROISet.h:127
static te::cl::ROISet * createROISet(std::unique_ptr< te::da::DataSet > ds)
Imports the ROISet from a dataset.
std::unique_ptr< te::da::DataSet > getDataSet(int srid)
Creates a dataset that with the roi set information.
void updateROILabel(std::string oldLabel, std::string newLabel)
Updates a ROI from this set.
virtual ~ROISet()
Virtual destructor.
void addROI(te::cl::ROI *roi)
Add a new ROI to this set.
A region of interest (often abbreviated ROI), is a selected subset of samples within a dataset identi...
Definition: ROI.h:61
TerraLib.
#define TECLEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:102
Proxy configuration file for TerraView (see terraview_config.h).