ST_DistanceBuffer.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/dataaccess/query/ST_DistanceBuffer.h
22 
23  \brief Spatial distance buffer operator.
24 */
25 
26 #ifndef __TERRALIB_DATAACCESS_INTERNAL_ST_DISTANCEBUFFER_H
27 #define __TERRALIB_DATAACCESS_INTERNAL_ST_DISTANCEBUFFER_H
28 
29 // TerraLib
30 #include "Function.h"
31 
32 // STL
33 #include <memory>
34 
35 namespace te
36 {
37  // Forward declarations
38  namespace common { class Distance; }
39  namespace gm { class Geometry; }
40 
41  namespace da
42  {
43  /*!
44  \class ST_DistanceBuffer
45 
46  \brief Spatial Distance Buffer operator.
47 
48  This function is just a syntatic-suggar.
49 
50  \sa Function
51  */
53  {
54  public:
55 
57 
58  /*!
59  \brief Constructor.
60 
61  \param name The distance buffer operator name.
62  \param e The expression.
63  \param g The geometry literal.
64  \param d Distance.
65 
66  \note The operator will take the ownership of the given arguments.
67  */
68  ST_DistanceBuffer(const std::string& name, Expression* e, te::gm::Geometry* g, te::common::Distance* d);
69 
70  /*!
71  \brief Constructor.
72 
73  \param name The distance buffer operator name.
74  \param e The expression.
75  \param g The geometry literal.
76  \param d Distance.
77  */
78  ST_DistanceBuffer(const std::string& name, const Expression& e, const te::gm::Geometry& g, const te::common::Distance& d);
79 
80  /*! \brief Copy constructor. */
81  ST_DistanceBuffer(const ST_DistanceBuffer& rhs);
82 
83  /*! \brief Destructor. */
84  ~ST_DistanceBuffer();
85 
86  /*! Assignment operator. */
87  ST_DistanceBuffer& operator=(const ST_DistanceBuffer& rhs);
88 
89  /*! \brief It creates a new copy of this expression. */
90  Expression* clone() const;
91 
92  /*!
93  \brief It sets the geometry.
94 
95  \param g The geometry.
96 
97  \note It will take the ownership of the geometry.
98  */
99  void setGeometry(te::gm::Geometry* g);
100 
101  /*!
102  \brief It returns the geometry.
103 
104  \return The geometry.
105  */
106  te::gm::Geometry* getGeometry() const;
107 
108  /*!
109  \brief It sets the distance.
110 
111  \param d The distance.
112 
113  \note It will take the ownership of the distance.
114  */
115  void setDistance(te::common::Distance* d);
116 
117  /*!
118  \brief It returns the distance.
119 
120  \return The distance.
121  */
122  te::common::Distance* getDistance() const;
123 
124  protected:
125 
126  std::auto_ptr<te::gm::Geometry> m_geom; //!< Geometry literal.
127  std::auto_ptr<te::common::Distance> m_d; //!< Distance.
128  };
129 
130  } // end namespace da
131 } // end namespace te
132 
133 #endif // __TERRALIB_DATAACCESS_INTERNAL_ST_DISTANCEBUFFER_H
134 
A class that models a Function expression.
double Distance(const te::gm::Coord2D &pt1, const te::gm::Coord2D &pt2)
This is an abstract class that models a query expression.
Definition: Expression.h:47
Spatial Distance Buffer operator.
URI C++ Library.
A class that models a Function expression.
Definition: Function.h:47
std::auto_ptr< te::gm::Geometry > m_geom
Geometry literal.
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:74
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97
std::auto_ptr< te::common::Distance > m_d
Distance.
A given distance has a measurement and a unit-of-measure.
Definition: Distance.h:44