GeometryOperands.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 GeometryOperands.cpp
22 
23  \brief Geometry operands.
24  */
25 
26 // TerraLib
27 #include "GeometryOperands.h"
28 #include "Globals.h"
29 
30 // STL
31 #include <cassert>
32 
33 std::set<const char*, te::common::LessCmp<const char*> > te::fe::GeometryOperands::sm_validGeometryOperands;
34 
36 
38 {
39 // we will not clear the vector items because they are just reference to an internal list of operands.
40 }
41 
43 {
44  return m_operands.size();
45 }
46 
48 {
49  assert(g);
50  m_operands.push_back(g);
51 }
52 
53 const char* te::fe::GeometryOperands::operator[](size_t i) const
54 {
55  assert(i < m_operands.size());
56  return m_operands[i];
57 }
58 
59 const char* te::fe::GeometryOperands::findOperand(const char* o)
60 {
61  assert(o);
62 
63  std::set<const char*, te::common::LessCmp<const char*> >::const_iterator it = sm_validGeometryOperands.find(o);
64 
65  if(it != sm_validGeometryOperands.end())
66  return *it;
67 
68  return nullptr;
69 }
70 
72 {
92 }
93 
95 {
97 }
98 
99 
100 
static const char * sm_bezier
static const char * sm_tin
static const char * sm_polyhedralSurface
static void loadValidGeometryOperandsList()
It loads the valid geometry operands list.
size_t size() const
It returns the number of available geometry operands in the object list.
static const char * sm_arcByCenterPoint
const char * operator[](size_t i) const
It returns a specified geometry operand.
static const char * sm_envelope
Geometry operands.
std::vector< const char * > m_operands
A vector of const pointer to geometry operand type name. Mandatory at least one operand type...
static const char * sm_clothoid
static const char * sm_geodesic
static const char * sm_arcByBulge
An static class with global definitions.
static const char * sm_arc
static const char * sm_circle
static const char * sm_circleByCenterPoint
GeometryOperands()
It initializes a new GeometryOperands.
static const char * sm_solid
static const char * sm_triangulatedSurface
static const char * sm_polygon
static const char * sm_lineString
static const char * sm_triangle
static const char * sm_point
static void clearValidGeometryOperandsList()
It clears the valid geometry operands list.
static const char * sm_cubicSpline
static const char * sm_offsetCurve
void push_back(const char *g)
It adds the geometry operand to the supported list of operands.
static const char * findOperand(const char *o)
It checks if operator &#39;o&#39; is a valid operator. It returns a pointer to the found operator or NULL oth...
static std::set< const char *, te::common::LessCmp< const char * > > sm_validGeometryOperands
The list of valid bynary geometry operands.