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  : m_geometry(nullptr), m_stroke(nullptr), m_perpendicularOffset(nullptr)
36 {
37 }
38 
40  : te::se::Symbolizer(rhs),
41  m_geometry(nullptr),
42  m_stroke(nullptr),
43  m_perpendicularOffset(nullptr)
44 {
45  if(rhs.m_geometry)
47 
48  if(rhs.m_stroke)
49  m_stroke = rhs.m_stroke->clone();
50 
51  if(rhs.m_perpendicularOffset)
53 }
54 
56 {
57  delete m_geometry;
58  delete m_stroke;
59  delete m_perpendicularOffset;
60 }
61 
63 {
64  delete m_geometry;
65  m_geometry = geometry;
66 }
67 
69 {
70  return m_geometry;
71 }
72 
74 {
75  delete m_stroke;
76  m_stroke = stroke;
77 }
78 
80 {
81  return m_stroke;
82 }
83 
85 {
86  delete m_perpendicularOffset;
87  m_perpendicularOffset = perpendicularOffset;
88 }
89 
91 {
92  return m_perpendicularOffset;
93 }
94 
95 const std::string& te::se::LineSymbolizer::getType() const
96 {
97  return sm_type;
98 }
99 
101 {
102  return new LineSymbolizer(*this);
103 }
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.
URI C++ Library.
Definition: Attributes.h:37
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.