All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BinarySpatialOp.cpp
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 BinarySpatialOp.cpp
22 
23  \brief A class for binary spatial operators.
24  */
25 
26 // TerraLib
27 #include "../geometry/Geometry.h"
28 #include "../gml/Envelope.h"
29 #include "BinarySpatialOp.h"
30 #include "Globals.h"
31 #include "PropertyName.h"
32 
33 // STL
34 #include <cassert>
35 
37  : SpatialOp(opName),
38  m_property(0),
39  m_geom(0),
40  m_box(0)
41 {
42 }
43 
45  : SpatialOp(opName),
46  m_property(p),
47  m_geom(g),
48  m_box(0)
49 {
50 }
51 
53  : SpatialOp(opName),
54  m_property(p),
55  m_geom(0),
56  m_box(e)
57 {
58 }
59 
61 {
62  delete m_property;
63  delete m_geom;
64  delete m_box;
65 }
66 
68 {
69  delete m_property;
70  m_property = p;
71 }
72 
74 {
75  return m_property;
76 }
77 
79 {
80  delete m_geom;
81  m_geom = g;
82 }
83 
85 {
86  return m_geom;
87 }
88 
90 {
91  delete m_box;
92  m_box = e;
93 }
94 
96 {
97  return m_box;
98 }
99 
te::gm::Geometry * getGeometry() const
It returns the geometry.
A spatial operator determines whether its geometric arguments satisfy the stated spatial relationship...
Definition: SpatialOp.h:49
void setProperty(PropertyName *p)
It sets the property name.
A class for binary spatial operators.
PropertyName * getProperty() const
It returns the property name.
BinarySpatialOp(const char *opName=0)
It initializes the BinarySpatialOp.
void setEnvelope(te::gml::Envelope *e)
It sets the envelope.
void setGeometry(te::gm::Geometry *g)
It sets the geometry.
This class is used to encode the name of any property of an object.
Definition: PropertyName.h:54
Envelope defines an extent using a pair of positions defining opposite corners in arbitrary dimension...
Definition: Envelope.h:52
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
An static class with global definitions.
te::gml::Envelope * getEnvelope() const
It returns the envelope.
virtual ~BinarySpatialOp()
Destructor.