All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LineSymbolizer.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/LineSymbolizer.cpp
22 
23  \brief A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line segments.
24 */
25 
26 // TerraLib
27 #include "../fe/PropertyName.h"
28 #include "LineSymbolizer.h"
29 #include "ParameterValue.h"
30 #include "Stroke.h"
31 
32 const std::string te::se::LineSymbolizer::sm_type("LineSymbolizer");
33 
35  : te::se::Symbolizer(),
36  m_geometry(0),
37  m_stroke(0),
38  m_perpendicularOffset(0)
39 {
40 }
41 
43  : te::se::Symbolizer(rhs),
44  m_geometry(0),
45  m_stroke(0),
46  m_perpendicularOffset(0)
47 {
48  if(rhs.m_geometry)
50 
51  if(rhs.m_stroke)
52  m_stroke = rhs.m_stroke->clone();
53 
54  if(rhs.m_perpendicularOffset)
56 }
57 
59 {
60  delete m_geometry;
61  delete m_stroke;
62  delete m_perpendicularOffset;
63 }
64 
66 {
67  delete m_geometry;
68  m_geometry = geometry;
69 }
70 
72 {
73  return m_geometry;
74 }
75 
77 {
78  delete m_stroke;
79  m_stroke = stroke;
80 }
81 
83 {
84  return m_stroke;
85 }
86 
88 {
89  delete m_perpendicularOffset;
90  m_perpendicularOffset = perpendicularOffset;
91 }
92 
94 {
95  return m_perpendicularOffset;
96 }
97 
98 const std::string& te::se::LineSymbolizer::getType() const
99 {
100  return sm_type;
101 }
102 
104 {
105  return new LineSymbolizer(*this);
106 }
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.
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
Stroke * m_stroke
A Stroke specifies the appearance of a linear geometry. (Optional)
static const std::string sm_type
A static data member used in the implementation of getType method.
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...
A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line seg...
ParameterValue * m_perpendicularOffset
A PerpendicularOffset gives the perpendicular distance away from a line to draw a label...
LineSymbolizer()
It initializes a new LineSymbolizer.
~LineSymbolizer()
Destructor.
This class is used to encode the name of any property of an object.
Definition: PropertyName.h:54
Symbolizer * clone() const
It creates a new copy of this object.
void setStroke(Stroke *stroke)
A Stroke specifies the appearance of a linear geometry. The Stroke element is optional inside of Line...
void setGeometry(te::fe::PropertyName *geometry)
The Geometry element of a LineSymbolizer defines the linear geometry to be used for styling...
const ParameterValue * getPerpendicularOffset() const
ParameterValue * clone() const
It creates a new copy of this object.
const Stroke * getStroke() const
const te::fe::PropertyName * getGeometry() const
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:67
A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line seg...
const std::string & getType() const
It returns the symbolizer type.
te::fe::PropertyName * m_geometry
A Geometry gives reference to a (the) geometry property of a feature to be used for rendering...
void setPerpendicularOffset(ParameterValue *perpendicularOffset)
PerpendicularOffset allows to draw lines in parallel to the original geometry. For complex line strin...
A Stroke specifies the appearance of a linear geometry.