ClassifierStrategy.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/rp/ClassifierStrategy.h
22 
23  \brief Raster classifier strategy base class.
24  */
25 
26 #ifndef __TERRALIB_RP_INTERNAL_CLASSIFIERSTRATEGY_H
27 #define __TERRALIB_RP_INTERNAL_CLASSIFIERSTRATEGY_H
28 
29 // TerraLib
30 #include "../raster/Raster.h"
32 #include "Config.h"
33 #include "Exception.h"
34 
35 // STL
36 #include <vector>
37 
38 namespace te
39 {
40  namespace rp
41  {
42  /*!
43  \class ClassifierStrategy
44  \brief Raster classifier strategy base class.
45  */
47  {
48  public:
49 
50  /*! \brief Virtual destructor. */
51  virtual ~ClassifierStrategy();
52 
53  /*!
54  \brief Initialize the classification strategy.
55 
56  \param strategyParams A pointer to the user given specific classification strategy parameters ou NULL if no parameters are present.
57 
58  \return true if OK, false on errors.
59  */
60  virtual bool initialize(ClassifierStrategyParameters const* const strategyParams) throw(te::rp::Exception) = 0;
61 
62  /*!
63  \brief Executes the classification strategy.
64 
65  \param inputRaster Input raster.
66  \param inputRasterBands Input raster bands.
67  \param inputPolygons The polygons to be classified when using object-based image analysis (OBIA).
68  \param outputRaster Output raster.
69  \param outputRasterBand Output raster band.
70  \param enableProgressInterface Enable the internal strategy to update the progress interface.
71 
72  \return true if OK, false on errors.
73  */
74  virtual bool execute(const te::rst::Raster& inputRaster, const std::vector<unsigned int>& inputRasterBands,
75  const std::vector<te::gm::Polygon*>& inputPolygons, te::rst::Raster& outputRaster,
76  const unsigned int outputRasterBand, const bool enableProgressInterface) throw(te::rp::Exception) = 0;
77 
78  /*!
79  \brief Returns the output raster pixel data type for each output band.
80  \return Returns the output raster pixel data type for each output band.
81  */
82  virtual std::vector< int > getOutputDataTypes() const = 0;
83 
84  protected:
85 
86  /*! \brief Default constructor. */
88 
89  private:
90 
91  /*!
92  \brief Copy constructor.
93 
94  \param rhs The right-hand side Raster.
95  */
97 
98  /*!
99  \brief Assignment operator.
100 
101  \param rhs The right-hand-side copy that would be used to copy from.
102 
103  \return A reference to this object.
104  */
105  const ClassifierStrategy& operator=(const ClassifierStrategy& rhs);
106  };
107 
108  } // end namespace rp
109 } // end namespace te
110 
111 #endif // __TERRALIB_RP_INTERNAL_CLASSIFIERSTRATEGY_H
112 
Exception class.
Raster classifier strategy parameters base class.
An abstract class for raster data strucutures.
Definition: Raster.h:71
URI C++ Library.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
Configuration flags for the Raster Processing module of TerraLib.
Raster classifier strategy base class.