BufferMemory.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 BufferMemory.h
22 
23  \brief
24 
25  \ingroup vp
26 */
27 
28 #ifndef __TERRALIB_VP_INTERNAL_BUFFER_MEMORY_H
29 #define __TERRALIB_VP_INTERNAL_BUFFER_MEMORY_H
30 
31 //Terralib
32 #include "../common/Exception.h"
33 #include "../datatype/Property.h"
34 #include "../dataaccess/dataset/DataSetType.h"
35 #include "../geometry/Geometry.h"
36 #include "../memory/DataSet.h"
37 #include "../statistics/core/Enums.h"
38 
39 #include "BufferOp.h"
40 #include "Config.h"
41 #include "Enums.h"
42 #include "Exception.h"
43 
44 
45 // STL
46 #include <map>
47 #include <memory>
48 #include <string>
49 #include <vector>
50 
51 namespace te
52 {
53  namespace vp
54  {
55  /*!
56  \class BufferMemory
57 
58  \brief A concrete class to compute the buffer operation.
59 
60  \ingroup vp
61  */
63  {
64 
65  public:
66 
67  /*! \brief Default constructor.*/
68  BufferMemory();
69 
70  /*! \brief Destructor. */
71  ~BufferMemory();
72 
73  /*!
74  \brief It executes the operation.
75 
76  \return A Boolean value that means if the operation successfully completed or not.
77  */
78  bool run() throw(te::common::Exception);
79 
80  protected:
81 
82  /*!
83  \brief It executes the buffer operator.
84 
85  \param geom The input geometry.
86  \param distance The distance to set buffer.
87  \param level How many levels the buffer will have.
88  \param auxGeom The auxiliar geometry that represents the previous buffer result.
89  This parameter is important when the buffer result has more than one level.
90 
91  \return A geometry with buffer result.
92  */
93  te::gm::Geometry* setBuffer(te::gm::Geometry* geom,
94  const double& distance,
95  const int& level,
96  te::gm::Geometry*& auxGeom);
97 
98  /*!
99  \brief It dissolves the bounders between buffers.
100 
101  \param outDSet The dataSet with buffers.
102  \param levels The number of levels the dataset has.
103 
104  \note The outDSet is updated with dissolved buffers.
105  */
106  void dissolveMemory(te::mem::DataSet* outDSet,
107  const int& levels);
108 
109  /*!
110  \brief It returns the distance of buffer by the attribute chosen.
111 
112  \param dataSet The input dataSet with the value.
113  \param position The position of attribute in dataSet.
114 
115  \return The distance.
116  */
117  double getDistanceByAttribute(te::da::DataSet& dataSet,
118  const int& position);
119 
120  }; // end class
121  } // end namespace vp
122 } // end namespace te
123 
124 #endif // __TERRALIB_VP_INTERNAL_BUFFER_MEMORY_H
125 
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
Buffer operation.
An abstract class to compute the buffer memory and buffer query operation.
Definition: BufferOp.h:61
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver...
Definition: DataSet.h:65
URI C++ Library.
Enumerations related to Vector Processing module.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
Definition: Exception.h:58
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:74
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:112
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
Configuration flags for the Terrralib Vector Processing module.
A concrete class to compute the buffer operation.
Definition: BufferMemory.h:62