PolygonSymbolizer.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/PolygonSymbolizer.cpp
22 
23  \brief A PolygonSymbolizer is used to draw a polygon (or other area-type geometries), including filling its interior and stroking its border (outline).
24 */
25 
26 // TerraLib
27 #include "../fe/PropertyName.h"
28 #include "Displacement.h"
29 #include "Fill.h"
30 #include "ParameterValue.h"
31 #include "PolygonSymbolizer.h"
32 #include "Stroke.h"
33 
34 const std::string te::se::PolygonSymbolizer::sm_type("PolygonSymbolizer");
35 
37  : m_geometry(nullptr),
38  m_fill(nullptr),
39  m_stroke(nullptr),
40  m_displacement(nullptr),
41  m_perpendicularOffset(nullptr)
42 {
43 }
44 
46  : te::se::Symbolizer(rhs),
47  m_geometry(nullptr),
48  m_fill(nullptr),
49  m_stroke(nullptr),
50  m_displacement(nullptr),
51  m_perpendicularOffset(nullptr)
52 {
53  if(rhs.m_geometry)
55 
56  if(rhs.m_fill)
57  m_fill = rhs.m_fill->clone();
58 
59  if(rhs.m_stroke)
60  m_stroke = rhs.m_stroke->clone();
61 
62  if(rhs.m_displacement)
64 
65  if(rhs.m_perpendicularOffset)
67 }
68 
70 {
71  delete m_geometry;
72  delete m_fill;
73  delete m_stroke;
74  delete m_displacement;
75  delete m_perpendicularOffset;
76 }
77 
79 {
80  delete m_geometry;
81  m_geometry = geometry;
82 }
83 
85 {
86  return m_geometry;
87 }
88 
90 {
91  delete m_fill;
92  m_fill = f;
93 }
94 
96 {
97  return m_fill;
98 }
99 
101 {
102  delete m_stroke;
103  m_stroke = stroke;
104 }
105 
107 {
108  return m_stroke;
109 }
110 
112 {
113  delete m_displacement;
114  m_displacement = d;
115 }
116 
118 {
119  return m_displacement;
120 }
121 
123 {
124  delete m_perpendicularOffset;
125  m_perpendicularOffset = perpendicularOffset;
126 }
127 
129 {
130  return m_perpendicularOffset;
131 }
132 
133 const std::string& te::se::PolygonSymbolizer::getType() const
134 {
135  return sm_type;
136 }
137 
139 {
140  return new PolygonSymbolizer(*this);
141 }
Displacement * m_displacement
The Displacement gives the X and Y displacements from the original geometry. (Optional) ...
Stroke * clone() const
It creates a new copy of this object.
Definition: Stroke.cpp:158
const std::string & getName() const
It returns the property name.
const Fill * getFill() const
Gets the Fill associates with the PolygonSymbolizer.
Stroke * m_stroke
A "Stroke" specifies the appearance of a linear geometry. (Optional)
A PolygonSymbolizer is used to draw a polygon (or other area-type geometries), including filling its ...
A Displacement gives X and Y offset displacements to use for rendering a text label, graphic or other Symbolizer near a point.
Definition: Displacement.h:58
A Fill specifies the pattern for filling an area geometry.
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
te::fe::PropertyName * m_geometry
A Geometry gives reference to a (the) geometry property of a feature to be used for rendering...
const te::fe::PropertyName * getGeometry() const
void setPerpendicularOffset(ParameterValue *perpendicularOffset)
PerpendicularOffset works as defined for LineSymbolizer, allowing to draw polygons smaller or larger ...
The ParameterValueType uses WFS-Filter expressions to give values for SE graphic parameters.
The "ParameterValueType" uses WFS-Filter expressions to give values for SE graphic parameters...
void setGeometry(te::fe::PropertyName *geometry)
The Geometry element of a PolygonSymbolizer defines the linear geometry to be used for styling...
This class is used to encode the name of any property of an object.
URI C++ Library.
Definition: Attributes.h:37
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
const Stroke * getStroke() const
Gets the Stroke associates with the PolygonSymbolizer.
A PolygonSymbolizer is used to draw a polygon (or other area-type geometries), including filling its ...
A Fill specifies the pattern for filling an area geometry.
Definition: Fill.h:59
const Displacement * getDisplacement() const
ParameterValue * clone() const
It creates a new copy of this object.
Fill * clone() const
It creates a new copy of this object.
Definition: Fill.cpp:86
static const std::string sm_type
A static data member used in the implementation of getType method.
const ParameterValue * getPerpendicularOffset() const
Fill * m_fill
Specifies how the area of the geometry will be filled. (Optional)
A Displacement gives X and Y offset displacements to use for rendering a text label, graphic or other Symbolizer near a point.
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:67
const std::string & getType() const
It returns the symbolizer type.
void setStroke(Stroke *stroke)
A Stroke specifies the appearance of a linear geometry.
Symbolizer * clone() const
It creates a new copy of this object.
ParameterValue * m_perpendicularOffset
A "PerpendicularOffset" gives the perpendicular distance away from a line to draw a label...
void setFill(Fill *f)
A Fill specifies the pattern for filling an area geometry.
Displacement * clone() const
It creates a new copy of this object.
void setDisplacement(Displacement *d)
The Displacement gives the X and Y displacements from the original geometry.
PolygonSymbolizer()
It initializes a new PolygonSymbolizer.
A Stroke specifies the appearance of a linear geometry.