All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  : te::se::Symbolizer(),
38  m_geometry(0),
39  m_fill(0),
40  m_stroke(0),
41  m_displacement(0),
42  m_perpendicularOffset(0)
43 {
44 }
45 
47  : te::se::Symbolizer(rhs),
48  m_geometry(0),
49  m_fill(0),
50  m_stroke(0),
51  m_displacement(0),
52  m_perpendicularOffset(0)
53 {
54  if(rhs.m_geometry)
56 
57  if(rhs.m_fill)
58  m_fill = rhs.m_fill->clone();
59 
60  if(rhs.m_stroke)
61  m_stroke = rhs.m_stroke->clone();
62 
63  if(rhs.m_displacement)
65 
66  if(rhs.m_perpendicularOffset)
68 }
69 
71 {
72  delete m_geometry;
73  delete m_fill;
74  delete m_stroke;
75  delete m_displacement;
76  delete m_perpendicularOffset;
77 }
78 
80 {
81  delete m_geometry;
82  m_geometry = geometry;
83 }
84 
86 {
87  return m_geometry;
88 }
89 
91 {
92  delete m_fill;
93  m_fill = f;
94 }
95 
97 {
98  return m_fill;
99 }
100 
102 {
103  delete m_stroke;
104  m_stroke = stroke;
105 }
106 
108 {
109  return m_stroke;
110 }
111 
113 {
114  delete m_displacement;
115  m_displacement = d;
116 }
117 
119 {
120  return m_displacement;
121 }
122 
124 {
125  delete m_perpendicularOffset;
126  m_perpendicularOffset = perpendicularOffset;
127 }
128 
130 {
131  return m_perpendicularOffset;
132 }
133 
134 const std::string& te::se::PolygonSymbolizer::getType() const
135 {
136  return sm_type;
137 }
138 
140 {
141  return new PolygonSymbolizer(*this);
142 }
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.
Definition: PropertyName.h:54
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.