All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ST_Relate.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 terralib/dataaccess/query/ST_Relate.cpp
22 
23  \brief Spatial relation function.
24 */
25 
26 // TerraLib
27 #include "FunctionNames.h"
28 #include "LiteralString.h"
29 #include "ST_Relate.h"
30 
32  : Function(FunctionNames::sm_ST_Relate)
33 {
34  m_args.push_back(g1);
35  m_args.push_back(g2);
36 
37  if(intersectionMatrix)
38  m_args.push_back(intersectionMatrix);
39 }
40 
41 te::da::ST_Relate::ST_Relate(const Expression& g1, const Expression& g2, const std::string& intersectionMatrix)
42  : Function(FunctionNames::sm_ST_Relate)
43 {
44  m_args.push_back(g1.clone());
45  m_args.push_back(g2.clone());
46 
47  if(!intersectionMatrix.empty())
48  m_args.push_back(new LiteralString(intersectionMatrix));
49 }
50 
52  : Function(rhs)
53 {
54 }
55 
57 {
59  return *this;
60 }
61 
63 {
64  return new ST_Relate(*this);
65 }
66 
This is an abstract class that models a query expression.
Definition: Expression.h:47
ST_Relate & operator=(const ST_Relate &rhs)
Definition: ST_Relate.cpp:56
A class that models a Function expression.
Definition: Function.h:47
A class that models a Literal String value.
TE_DEFINE_VISITABLE ST_Relate(Expression *g1, Expression *g2, LiteralString *intersectionMatrix=0)
Constructor.
Definition: ST_Relate.cpp:31
A static class with global function name definitions.
Function & operator=(const Function &rhs)
Definition: Function.cpp:44
Spatial relation function.
Definition: ST_Relate.h:48
Spatial relation function.
virtual Expression * clone() const =0
It creates a new copy of this expression.
std::vector< Expression * > m_args
The list of arguments.
Definition: Function.h:118
A static class with global function name definitions.
Definition: FunctionNames.h:45
Expression * clone() const
It creates a new copy of this expression.
Definition: ST_Relate.cpp:62
This class models a string Literal value.
Definition: LiteralString.h:46