RasterSymbolizer.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/RasterSymbolizer.cpp
22 
23  \brief The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos, DEMs).
24 */
25 
26 // TerraLib
27 #include "../fe/PropertyName.h"
28 #include "ChannelSelection.h"
29 #include "ColorMap.h"
30 #include "ContrastEnhancement.h"
31 #include "ImageOutline.h"
32 #include "ParameterValue.h"
33 #include "RasterSymbolizer.h"
34 #include "ShadedRelief.h"
35 
36 const std::string te::se::RasterSymbolizer::sm_type("RasterSymbolizer");
37 
39  : m_geometry(nullptr),
40  m_opacity(nullptr),
41  m_gain(nullptr),
42  m_offset(nullptr),
43  m_noDataValue(nullptr),
44  m_channelSelection(nullptr),
45  m_overlapBehavior(NO_BEHAVIOR),
46  m_colorMap(nullptr),
47  m_contrastEnhancement(nullptr),
48  m_shadedRelief(nullptr),
49  m_imageOutline(nullptr)
50 {
51 }
52 
54  : te::se::Symbolizer(rhs),
55  m_geometry(nullptr),
56  m_opacity(nullptr),
57  m_gain(nullptr),
58  m_offset(nullptr),
59  m_noDataValue(nullptr),
60  m_channelSelection(nullptr),
62  m_colorMap(nullptr),
63  m_contrastEnhancement(nullptr),
64  m_shadedRelief(nullptr),
65  m_imageOutline(nullptr)
66 {
67  if(rhs.m_geometry)
69 
70  if(rhs.m_opacity)
71  m_opacity = rhs.m_opacity->clone();
72 
73  if(rhs.m_gain)
74  m_gain = rhs.m_gain->clone();
75 
76  if(rhs.m_offset)
77  m_offset = rhs.m_offset->clone();
78 
79  if (rhs.m_noDataValue)
81 
82  if(rhs.m_channelSelection)
84 
85  if(rhs.m_colorMap)
86  m_colorMap = rhs.m_colorMap->clone();
87 
88  if(rhs.m_contrastEnhancement)
90 
91  if(rhs.m_shadedRelief)
93 
94  if(rhs.m_imageOutline)
96 }
97 
99 {
100  delete m_geometry;
101  delete m_opacity;
102  delete m_gain;
103  delete m_offset;
104  delete m_noDataValue;
105  delete m_channelSelection;
106  delete m_colorMap;
107  delete m_contrastEnhancement;
108  delete m_shadedRelief;
109  delete m_imageOutline;
110 }
111 
113 {
114  delete m_geometry;
115  m_geometry = g;
116 }
117 
119 {
120  delete m_opacity;
121  m_opacity = p;
122 }
123 
125 {
126  delete m_gain;
127  m_gain = p;
128 }
129 
131 {
132  delete m_offset;
133  m_offset = p;
134 }
135 
137 {
138  delete m_noDataValue;
139  m_noDataValue = p;
140 }
141 
143 {
144  delete m_channelSelection;
145  m_channelSelection = c;
146 }
147 
149 {
151 }
152 
154 {
155  delete m_colorMap;
156  m_colorMap = c;
157 }
158 
160 {
161  delete m_contrastEnhancement;
163 }
164 
166 {
167  delete m_shadedRelief;
168  m_shadedRelief = s;
169 }
170 
172 {
173  delete m_imageOutline;
174  m_imageOutline = i;
175 }
176 
177 const std::string& te::se::RasterSymbolizer::getType() const
178 {
179  return sm_type;
180 }
181 
183 {
184  return new RasterSymbolizer(*this);
185 }
ImageOutline specifies how individual source rasters in a multi-raster set (such as a set of satellit...
const std::string & getName() const
It returns the property name.
ImageOutline * clone() const
It creates a new copy of this object.
ParameterValue * m_opacity
An Opacity of 0.0 can be selected for the main raster to avoid rendering the main-raster pixels...
ColorMap * clone() const
Definition: ColorMap.cpp:100
ChannelSelection specifies the false-color channel selection for a multi-spectral raster source (such...
static const std::string sm_type
A static data member used in the implementation of getType method.
ChannelSelection * clone() const
It creates a new copy of this object.
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
const std::string & getType() const
It returns the symbolizer type.
void setGain(ParameterValue *p)
void setShadedRelief(ShadedRelief *s)
The ParameterValueType uses WFS-Filter expressions to give values for SE graphic parameters.
ContrastEnhancement defines the &#39;stretching&#39; of contrast for a channel of a false-color image or for ...
void setContrastEnhancement(ContrastEnhancement *c)
The "ParameterValueType" uses WFS-Filter expressions to give values for SE graphic parameters...
ShadedRelief * clone() const
It creates a new copy of this object.
ParameterValue * m_noDataValue
It defines the no data value used to renderer the main raster pixels, a initial value is infinite val...
ContrastEnhancement * m_contrastEnhancement
It defines contrast enhancement for a channel of a false-color image or for a color image...
int b
Definition: TsRtree.cpp:32
OverlapBehavior
OverlapBehavior tells a system how to behave when multiple raster images in a layer overlap each othe...
ParameterValue * m_gain
It defines the gain value used to renderer the main raster pixels, a initial value could be 1...
void setNoDataValue(ParameterValue *p)
This class is used to encode the name of any property of an object.
URI C++ Library.
Definition: Attributes.h:37
ColorMap * m_colorMap
It defines either the colors of a pallette-type raster source or the mapping of numeric pixel values ...
ContrastEnhancement defines the &#39;stretching&#39; of contrast for a channel of a false-color image or for ...
void setChannelSelection(ChannelSelection *c)
ImageOutline * m_imageOutline
It specifies how individual source rasters in a multi-raster set (such as a set of satellite-image sc...
te::gm::Polygon * p
ShadedRelief * m_shadedRelief
It selects the application of relief shading (or "hill shading") to an image for a three-dimensional ...
ImageOutline specifies how individual source rasters in a multi-raster set (such as a set of satellit...
Definition: ImageOutline.h:53
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
te::fe::PropertyName * m_geometry
The interpretation of Geometry is system-dependent, as raster data may be organized differently from ...
void setOpacity(ParameterValue *p)
RasterSymbolizer()
It initializes a new RasterSymbolizer.
ParameterValue * m_offset
It defines the offset value used to renderer the main raster pixels, a initial value could be 0...
ParameterValue * clone() const
It creates a new copy of this object.
void setOverlapBehavior(OverlapBehavior b)
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
ShadedRelief specifies the application of relief shading (or "hill shading") to a DEM raster to give ...
void setOffset(ParameterValue *p)
OverlapBehavior m_overlapBehavior
It tells a system how to behave when multiple raster images in a layer overlap each other...
void setColorMap(ColorMap *c)
Symbolizer * clone() const
It creates a new copy of this object.
void setGeometry(te::fe::PropertyName *g)
A ColorMap defines either the colors of a pallette-type raster source or the mapping of numeric pixel...
void setImageOutline(ImageOutline *i)
ContrastEnhancement * clone() const
It creates a new copy of this object.
A ColorMap defines either the colors of a pallette-type raster source or the mapping of numeric pixel...
Definition: ColorMap.h:61
ShadedRelief specifies the application of relief shading (or "hill shading") to a DEM raster to give ...
Definition: ShadedRelief.h:58
ChannelSelection * m_channelSelection
It specifies the false-color channel selection for a multi-spectral raster source (such as a multi-ba...
ChannelSelection specifies the false-color channel selection for a multi-spectral raster source (such...