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 DistanceBuffer.h
22 
23  \brief Distance buffer operator.
24  */
25 
26 #ifndef __TERRALIB_FE_INTERNAL_DISTANCEBUFFER_H
27 #define __TERRALIB_FE_INTERNAL_DISTANCEBUFFER_H
28 
29 // TerraLib
30 #include "SpatialOp.h"
31 
32 namespace te
33 {
34 // Forward declarations
35  namespace common { class Distance; }
36  namespace gm { class Geometry; }
37 
38  namespace fe
39  {
40 // Forward declarations
41  class PropertyName;
42 
43  /*!
44  \class DistanceBuffer
45 
46  \brief Distance buffer operator.
47 
48  The following operators are defined in the Filter
49  Encoding specification:
50  <ul>
51  <li>DWithin</li>
52  <li>Beyond</li>
53  </ul>
54 
55  \ingroup fe
56 
57  \sa SpatialOp, PropertyName, Distance
58  */
60  {
61  public:
62 
64 
65  /** @name Initializer Methods
66  * Methods related to instantiation and destruction.
67  */
68  //@{
69 
70  /*!
71  \brief It initializes the DistanceBuffer operator.
72 
73  \param opName The operator name.
74 
75  \note The DistanceBuffer will not take the ownership of the given name.
76  */
77  DistanceBuffer(const char* opName = 0);
78 
79  /*!
80  \brief It initializes the DistanceBuffer operator.
81 
82  \param opName The operator name.
83 
84  \note The DistanceBuffer will not take the ownership of the given name.
85 
86  \note The DistanceBuffer will take the ownership of the given operands.
87  */
88  DistanceBuffer(const char* opName,
89  PropertyName* p,
92 
93  /*! \brief Destructor. */
94  virtual ~DistanceBuffer();
95 
96  //@}
97 
98  /** @name Accessor methods
99  * Methods used to get or set properties.
100  */
101  //@{
102 
103  /*!
104  \brief It sets property name.
105 
106  \param p The property name.
107 
108  \note It will take the ownership of the property name.
109  */
110  void setProperty(PropertyName* p);
111 
112  /*!
113  \brief It returns the property name.
114 
115  \return The property name.
116  */
117  PropertyName* getProperty() const;
118 
119  /*!
120  \brief It sets the geometry.
121 
122  \param g The geometry.
123 
124  \note It will take the ownership of the geometry.
125  */
126  void setGeometry(te::gm::Geometry* g);
127 
128  /*! \brief It returns the geometry.
129 
130  \return The geometry.
131  */
132  te::gm::Geometry* getGeometry() const;
133 
134  /*!
135  \brief It sets the distance.
136 
137  \param d The distance.
138 
139  \note It will take the ownership of the distance.
140  */
141  void setDistance(te::common::Distance* d);
142 
143  /*!
144  \brief It returns the distance.
145 
146  \return The distance.
147  */
148  te::common::Distance* getDistance() const;
149 
150  //@}
151 
152  protected:
153 
154  PropertyName* m_property; //!< A geometric property. (Mandatory, if m_geom is not specified)
155  te::gm::Geometry* m_geom; //!< Geometry literal. (Mandatory, if m_property is not specified)
156  te::common::Distance* m_d; //!< Distance. (mandatory)
157  };
158 
159  } // end namespace fe
160 } // end namespace te
161 
162 #endif // __TERRALIB_FE_INTERNAL_DISTANCEBUFFER_H
163 
Distance buffer operator.
te::common::Distance * m_d
Distance. (mandatory)
double Distance(const te::gm::Coord2D &pt1, const te::gm::Coord2D &pt2)
A spatial operator determines whether its geometric arguments satisfy the stated spatial relationship...
Definition: SpatialOp.h:49
#define TEFEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:59
A spatial operator determines whether its geometric arguments satisfy the stated spatial relationship...
te::gm::Geometry * m_geom
Geometry literal. (Mandatory, if m_property is not specified)
This class is used to encode the name of any property of an object.
Definition: PropertyName.h:54
URI C++ Library.
#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:73
PropertyName * m_property
A geometric property. (Mandatory, if m_geom is not specified)
A given distance has a measurement and a unit-of-measure.
Definition: Distance.h:44