SpatialOperator.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 SpatialOperator.h
22 
23  \brief Spatial operator.
24  */
25 
26 #ifndef __TERRALIB_FE_INTERNAL_SPATIALOPERATOR_H
27 #define __TERRALIB_FE_INTERNAL_SPATIALOPERATOR_H
28 
29 // TerraLib
30 #include "../common/Comparators.h"
31 #include "Config.h"
32 
33 // STL
34 #include <set>
35 
36 namespace te
37 {
38  namespace fe
39  {
40 // Forward declarations
41  class GeometryOperands;
42 
43  /*!
44  \class SpatialOperator
45 
46  \brief Spatial operator.
47 
48  Spatial operator name can be one of the following names:
49  <ul>
50  <li>BBOX</li>
51  <li>Equals</li>
52  <li>Disjoint</li>
53  <li>Intersects</li>
54  <li>Touches</li>
55  <li>Crosses</li>
56  <li>Within</li>
57  <li>Contains</li>
58  <li>Overlaps</li>
59  <li>Beyond</li>
60  <li>DWithin</li>
61  </ul>
62 
63  \ingroup fe
64 
65  \sa SpatialOperators, GeometryOperands
66  */
68  {
69  public:
70 
71  /** @name Initializer Methods
72  * Methods related to instantiation and destruction.
73  */
74  //@{
75 
76  /*!
77  \brief It initializes a new SpatialOperator.
78 
79  \param The spatial operator name.
80 
81  \note The opName must be a value from the list of valid spatial operators.
82  */
83  SpatialOperator(const char* opName);
84 
85  /*! \brief Destructor. */
86  ~SpatialOperator();
87 
88  //@}
89 
90  /** @name Accessor methods
91  * Methods used to get or set properties.
92  */
93  //@{
94 
95  /*!
96  \brief It returns the operator name.
97 
98  \return The operator name.
99  */
100  const char* getOpName() const;
101 
102  /*!
103  \brief It sets the geometry operands.
104 
105  \param gOps The geometry operands.
106 
107  \note It will take the ownership of the geometry operands.
108  So, don't release the geometry operands resources.
109  */
110  void setGeometryOperands(GeometryOperands* gOps);
111 
112  /*!
113  \brief It returns the geometry operands.
114 
115  \return The geometry operands.
116  */
117  const GeometryOperands* getGeometryOperands() const;
118 
119  /*!
120  \brief It checks if operator 'o' is a valid operator. It returns a pointer
121  to the found operator or NULL otherwise.
122 
123  \param o The operator name we are looking for.
124  */
125  static const char* findOperator(const char* o);
126 
127  /*! \brief It loads the valid spatial operator list. */
128  static void loadValidOperatorList();
129 
130  /*! \brief It clears the valid operator list. */
131  static void clearValidOperatorList();
132 
133  //@}
134 
135  private:
136 
137  const char* m_name; //!< Spatial operator name.
139 
140  static std::set<const char*, te::common::LessCmp<const char*> > sm_validSpatialOperators; //!< The list of valid spatial operators.
141  };
142 
143 
144 
145  } // end namespace fe
146 } // end namespace te
147 
148 #endif // __TERRALIB_FE_INTERNAL_SPATIALOPERATOR_H
Spatial operator.
#define TEFEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:59
Geometry operands.
URI C++ Library.
const char * m_name
Spatial operator name.
Configuration flags for the TerraLib Filter Encoding module.
GeometryOperands * m_geometryOperands
Optional.
static std::set< const char *, te::common::LessCmp< const char * > > sm_validSpatialOperators
The list of valid spatial operators.