Loading...
Searching...
No Matches
BinarySpatialOp.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/fe/BinarySpatialOp.h
22
23 \brief A class for binary spatial operators.
24 */
25
26#ifndef __TERRALIB_FE_INTERNAL_BINARYSPATIALOP_H
27#define __TERRALIB_FE_INTERNAL_BINARYSPATIALOP_H
28
29// TerraLib
30#include "SpatialOp.h"
31
32namespace te
33{
34 namespace gm { class Geometry; }
35 namespace gml { class Envelope; }
36
37 namespace fe
38 {
39// Forward declarations
40 class PropertyName;
41
42 /*!
43 \class BinarySpatialOp
44
45 \brief A class for binary spatial operators.
46
47 Binary spatial operators are used to test whether
48 the value of a geometric property, referenced using the name
49 of the property, and a literal geometric value satisfy the
50 spatial relationship implied by the operator.<br>
51 The following operators are defined in the Filter
52 Encoding specification:
53 <ul>
54 <li>Equals</li>
55 <li>Disjoint</li>
56 <li>Touches</li>
57 <li>Within</li>
58 <li>Overlaps</li>
59 <li>Crosses</li>
60 <li>Intersects</li>
61 <li>Contains</li>
62 </ul>
63
64 \ingroup fe
65
66 \sa SpatialOp, PropertyName
67 */
69 {
70 public:
71
73
74 /** @name Initializer Methods
75 * Methods related to instantiation and destruction.
76 */
77 //@{
78
79 /*!
80 \brief It initializes the BinarySpatialOp.
81
82 \param opName The operator name.
83
84 \note The BinarySpatialOp will not take the ownership of the given name.
85 */
86 BinarySpatialOp(const char* opName = 0);
87
88 /*!
89 \brief It initializes the BinarySpatialOp.
90
91 \param opName The operator name.
92 \param p The property name.
93 \param g The geometry value.
94
95 \note The BinarySpatialOp will not take the ownership of the given name.
96
97 \note The BinarySpatialOp will take the ownership of the given operands.
98 */
99 BinarySpatialOp(const char* opName, PropertyName* p, te::gm::Geometry* g);
100
101 /*!
102 \brief It initializes the BinarySpatialOp.
103
104 \param opName The operator name.
105 \param p The property name.
106 \param e The envelope value.
107
108 \note The BinarySpatialOp will not take the ownership of the given name.
109
110 \note The BinarySpatialOp will take the ownership of the given operands.
111 */
112 BinarySpatialOp(const char* opName, PropertyName* p, te::gml::Envelope* e);
113
114 /*! \brief Destructor. */
116
117 //@}
118
119 /** @name Accessor methods
120 * Methods used to get or set properties.
121 */
122 //@{
123
124 /*!
125 \brief It sets the property name.
126
127 \param p The property name.
128
129 \note It will take the ownership of the property name.
130 */
132
133 /*!
134 \brief It returns the property name.
135
136 \return The property name.
137 */
139
140 /*!
141 \brief It sets the geometry.
142
143 \param g The geometry.
144
145 \note It will take the ownership of the geometry.
146 */
148
149 /*!
150 \brief It returns the geometry.
151
152 \return The geometry.
153 */
155
156 /*!
157 \brief It sets the envelope.
158
159 \param e The envelope.
160
161 \note It will take the ownership of the envelope.
162 */
164
165 /*!
166 \brief It returns the envelope.
167
168 \return The envelope.
169 */
171
172 /*! \brief It creates a new copy of this object. */
174
175 //@}
176
177 protected:
178
179 PropertyName* m_property; //!< A geometric property. (Mandatory)
180 te::gm::Geometry* m_geom; //!< A literal geometric value. (It must be omitted if m_envelope is given)
181 te::gml::Envelope* m_box; //!< A convenient and more compact way of encoding the very common bounding box constraint. (It must be omitted ig m_box is given)
182 };
183
184 } // end namespace fe
185} // end namespace te
186
187#endif // __TERRALIB_FE_INTERNAL_BINARYSPATIALOP_H
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
A spatial operator determines whether its geometric arguments satisfy the stated spatial relationship...
An abstract interface for operators.
Definition: AbstractOp.h:48
A class for binary spatial operators.
PropertyName * getProperty() const
It returns the property name.
virtual ~BinarySpatialOp()
Destructor.
te::gml::Envelope * getEnvelope() const
It returns the envelope.
te::gml::Envelope * m_box
A convenient and more compact way of encoding the very common bounding box constraint....
BinarySpatialOp(const char *opName=0)
It initializes the BinarySpatialOp.
BinarySpatialOp(const char *opName, PropertyName *p, te::gm::Geometry *g)
It initializes the BinarySpatialOp.
void setGeometry(te::gm::Geometry *g)
It sets the geometry.
te::gm::Geometry * m_geom
A literal geometric value. (It must be omitted if m_envelope is given)
te::gm::Geometry * getGeometry() const
It returns the geometry.
void setProperty(PropertyName *p)
It sets the property name.
void setEnvelope(te::gml::Envelope *e)
It sets the envelope.
PropertyName * m_property
A geometric property. (Mandatory)
BinarySpatialOp(const char *opName, PropertyName *p, te::gml::Envelope *e)
It initializes the BinarySpatialOp.
AbstractOp * clone() const
It creates a new copy of this object.
This class is used to encode the name of any property of an object.
Definition: PropertyName.h:55
A spatial operator determines whether its geometric arguments satisfy the stated spatial relationship...
Definition: SpatialOp.h:53
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:78
Envelope defines an extent using a pair of positions defining opposite corners in arbitrary dimension...
Definition: Envelope.h:53
TerraLib.
#define TEFEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:59