All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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"
31 #include "StrategyParameters.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(StrategyParameters 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  protected:
79 
80  /*! \brief Default constructor. */
82 
83  private:
84 
85  /*!
86  \brief Copy constructor.
87 
88  \param rhs The right-hand side Raster.
89  */
91 
92  /*!
93  \brief Assignment operator.
94 
95  \param rhs The right-hand-side copy that would be used to copy from.
96 
97  \return A reference to this object.
98  */
99  const ClassifierStrategy& operator=(const ClassifierStrategy& rhs);
100  };
101 
102  } // end namespace rp
103 } // end namespace te
104 
105 #endif // __TERRALIB_RP_INTERNAL_CLASSIFIERSTRATEGY_H
106 
Exception class.
An abstract class for raster data strucutures.
Definition: Raster.h:71
Raster strategy parameters base class.
Raster strategy parameters base class.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:141
Configuration flags for the Raster Processing module of TerraLib.
Raster classifier strategy base class.