All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Interpolate.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/se/Interpolate.cpp
22 
23  \brief The transformation of continuous values to a number of values (Interpolate function).
24 */
25 
26 // TerraLib
27 #include "../common/STLUtils.h"
28 #include "Interpolate.h"
29 #include "InterpolationPoint.h"
30 #include "ParameterValue.h"
31 
33  : m_lookupValue(0),
34  m_mode(LINEAR),
35  m_method(NUMERIC)
36 {
37 }
38 
40  : m_lookupValue(0),
41  m_mode(LINEAR),
42  m_method(NUMERIC)
43 {
44  if(rhs.m_lookupValue)
45  {
47  }
48 
49  for(size_t t = 0; t < rhs.m_interpolationPoints.size(); ++t)
50  {
51  m_interpolationPoints.push_back(rhs.m_interpolationPoints[t]->clone());
52  }
53 
55  m_mode = rhs.m_mode;
56  m_method = rhs.m_method;
57 }
58 
60 {
61  delete m_lookupValue;
62  te::common::FreeContents(m_interpolationPoints);
63 }
64 
66 {
67  return new Interpolate(*this);
68 }
69 
71 {
72  delete m_lookupValue;
73  m_lookupValue = v;
74 }
75 
77 {
78  m_interpolationPoints.push_back(i);
79 }
80 
82 {
83  m_mode = t;
84 }
85 
87 {
88  m_method = t;
89 }
90 
91 const std::vector<te::se::InterpolationPoint*>& te::se::Interpolate::getInterpolationPoints() const
92 {
93  return m_interpolationPoints;
94 }
const std::string & getFallbackValue() const
Definition: Function.cpp:42
void setMethodType(MethodType t)
Definition: Interpolate.cpp:86
ParameterValue * m_lookupValue
Mandatory.
Definition: Interpolate.h:167
The ParameterValueType uses WFS-Filter expressions to give values for SE graphic parameters.
const std::vector< InterpolationPoint * > & getInterpolationPoints() const
Definition: Interpolate.cpp:91
The transformation of continuous values to a number of values (Interpolate function).
Definition: Interpolate.h:88
The "ParameterValueType" uses WFS-Filter expressions to give values for SE graphic parameters...
~Interpolate()
Destructor.
Definition: Interpolate.cpp:59
void setModeType(ModeType t)
Definition: Interpolate.cpp:81
void setLookupValue(ParameterValue *v)
Definition: Interpolate.cpp:70
void add(InterpolationPoint *i)
Definition: Interpolate.cpp:76
ModeType
It controls the ...
Definition: Interpolate.h:97
MethodType
It controls the ...
Definition: Interpolate.h:109
Interpolate()
It initializes a new Interpolate.
Definition: Interpolate.cpp:32
std::vector< InterpolationPoint * > m_interpolationPoints
Mandatory.
Definition: Interpolate.h:168
ParameterValue * clone() const
It creates a new copy of this object.
MethodType m_method
Mandatory.
Definition: Interpolate.h:170
They are used to define a graph of points.
ModeType m_mode
Mandatory.
Definition: Interpolate.h:169
std::string m_fallbackValue
The value of the fallbackValue attribute is used as a default value, if the SE implementation does no...
Definition: Function.h:88
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
Definition: BoostUtils.h:55
The transformation of continuous values to a number of values (Interpolate function).
virtual Interpolate * clone() const
It returns a clone of this object.
Definition: Interpolate.cpp:65
They are used to define a graph of points.