BBOXOp.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 BBOXOp.cpp
22 
23  \brief A convenient and more compact way of encoding the very common bounding box constraint based on an envelope.
24  */
25 
26 // TerraLib
27 #include "../gml/Envelope.h"
28 #include "BBOXOp.h"
29 #include "Globals.h"
30 #include "PropertyName.h"
31 
33  : SpatialOp(Globals::sm_bbox),
34  m_property(nullptr),
35  m_envelope(nullptr)
36 {
37 }
38 
40 {
41  delete m_property;
42  delete m_envelope;
43 }
44 
46 {
47  delete m_property;
48  m_property = p;
49 }
50 
52 {
53  return m_property;
54 }
55 
57 {
58  delete m_envelope;
59  m_envelope = e;
60 }
61 
63 {
64  return m_envelope;
65 }
66 
68 {
69  BBOXOp* bboxop = new BBOXOp;
70 
71  if(m_envelope)
73 
74  if(m_property)
75  bboxop->setProperty(new PropertyName(m_property->getName()));
76 
77  return bboxop;
78 }
const std::string & getName() const
It returns the property name.
te::gm::Envelope * getCoordinates() const
A convenient and more compact way of encoding the very common bounding box constraint based on an env...
te::gml::Envelope * m_envelope
Bounding box constraint. (Mandatory)
Definition: BBOXOp.h:145
A convenient and more compact way of encoding the very common bounding box constraint based on an env...
Definition: BBOXOp.h:71
A spatial operator determines whether its geometric arguments satisfy the stated spatial relationship...
Definition: SpatialOp.h:52
void setEnvelope(te::gml::Envelope *e)
It sets the envelope.
Definition: BBOXOp.cpp:56
~BBOXOp()
Destructor.
Definition: BBOXOp.cpp:39
int getSRID() const
PropertyName * m_property
A geometric property. (theoretically it is optional, but it is required by the XML schema) ...
Definition: BBOXOp.h:144
An static class with global definitions.
te::gml::Envelope * getEnvelope() const
It returns the envelope.
Definition: BBOXOp.cpp:62
This class is used to encode the name of any property of an object.
An static class with global definitions.
te::gm::Polygon * p
Envelope defines an extent using a pair of positions defining opposite corners in arbitrary dimension...
Definition: gml/Envelope.h:52
An abstract interface for operators.
Definition: AbstractOp.h:47
PropertyName * getProperty() const
It returns the property name.
Definition: BBOXOp.cpp:51
void setProperty(PropertyName *p)
It sets property name.
Definition: BBOXOp.cpp:45
AbstractOp * clone() const
It creates a new copy of this object.
Definition: BBOXOp.cpp:67
BBOXOp()
It initializes a new BBOXOp.
Definition: BBOXOp.cpp:32