ColorMap.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/ColorMap.cpp
22 
23  \brief A ColorMap defines either the colors of a pallette-type raster source or the mapping of numeric pixel values to colors.
24 */
25 
26 // TerraLib
27 #include "Categorize.h"
28 #include "ColorMap.h"
29 #include "Interpolate.h"
30 #include "Recode.h"
31 
33  : m_categorize(nullptr),
34  m_interpolate(nullptr),
35  m_recode(nullptr)
36 {
37 }
38 
40  : m_categorize(nullptr),
41  m_interpolate(nullptr),
42  m_recode(nullptr)
43 {
44  if(rhs.m_categorize)
45  {
47  }
48 
49  if(rhs.m_interpolate)
50  {
52  }
53 
54  if (rhs.m_recode)
55  {
56  m_recode = rhs.m_recode->clone();
57  }
58 }
59 
61 {
62  delete m_categorize;
63  delete m_interpolate;
64  delete m_recode;
65 }
66 
68 {
69  delete m_categorize;
70  m_categorize = c;
71 }
72 
74 {
75  return m_categorize;
76 }
77 
79 {
80  delete m_interpolate;
81  m_interpolate = i;
82 }
83 
85 {
86  return m_interpolate;
87 }
88 
90 {
91  delete m_recode;
92  m_recode = i;
93 }
94 
96 {
97  return m_recode;
98 }
99 
101 {
102  return new ColorMap(*this);
103 }
104 
The transformation of continuous values to distinct values (Categorize function). ...
ColorMap * clone() const
Definition: ColorMap.cpp:100
The transformation of continuous values to distinct values (Categorize function). ...
Definition: Categorize.h:90
Interpolate * getInterpolate() const
Definition: ColorMap.cpp:84
virtual Categorize * clone() const
It returns a clone of this object.
Definition: Categorize.cpp:76
void setCategorize(Categorize *c)
Definition: ColorMap.cpp:67
The transformation of continuous values to a number of values (Interpolate function).
Definition: Interpolate.h:88
Categorize * m_categorize
Categorize function. (Mandatory if interpolate_ is not defined or empty otherwise) ...
Definition: ColorMap.h:108
virtual Recode * clone() const
It returns a clone of this object.
Definition: Recode.cpp:57
Interpolate * m_interpolate
Interpolate function. (Mandatory if categorize_ is not defined or empty otherwise) ...
Definition: ColorMap.h:109
~ColorMap()
Destructor.
Definition: ColorMap.cpp:60
Recode * getRecode() const
Definition: ColorMap.cpp:95
Transformation of discrete values to other values.
Definition: Recode.h:75
void setRecode(Recode *i)
Definition: ColorMap.cpp:89
ColorMap()
It initializes a new ColorMap.
Definition: ColorMap.cpp:32
Categorize * getCategorize() const
Definition: ColorMap.cpp:73
A ColorMap defines either the colors of a pallette-type raster source or the mapping of numeric pixel...
Recode * m_recode
Recode function.
Definition: ColorMap.h:110
void setInterpolate(Interpolate *i)
Definition: ColorMap.cpp:78
A ColorMap defines either the colors of a pallette-type raster source or the mapping of numeric pixel...
Definition: ColorMap.h:61
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
Transformation of discrete values to other values.