LineSymbolizer.h
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.h
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 #ifndef __TERRALIB_SE_INTERNAL_LINESYMBOLIZER_H
27 #define __TERRALIB_SE_INTERNAL_LINESYMBOLIZER_H
28 
29 // TerraLib
30 #include "Symbolizer.h"
31 
32 namespace te
33 {
34  namespace fe { class PropertyName; }
35 
36  namespace se
37  {
38 // Forward declarations
39  class ParameterValue;
40  class Stroke;
41 
42  /*!
43  \class LineSymbolizer
44 
45  \brief A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line segments.
46 
47  \ingroup se
48 
49  \sa Symbolizer, Stroke, ParameterValue, te::fe::PropertyName, ImageOutline
50  */
52  {
53  public:
54 
56 
57  /** @name Initializer Methods
58  * Methods related to instantiation and destruction.
59  */
60  //@{
61 
62  /*! \brief It initializes a new LineSymbolizer. */
64 
65  /*!
66  \brief Copy constructor.
67 
68  \param rhs The other line symbolizer.
69  */
71 
72  /*! \brief Destructor. */
74 
75  //@}
76 
77  /** @name Accessor methods
78  * Methods used to get or set properties.
79  */
80  //@{
81 
82  /*!
83  \brief
84 
85  The Geometry element of a LineSymbolizer defines the linear
86  geometry to be used for styling. The Geometry element is
87  optional and if it is absent then the all geometry properties
88  of the feature type that is used in the containing FeatureType
89  are used. Most frequently, though, feature types will have only
90  a single geometry property. See OGC te::fe::PropertyName
91  class for more information on attribute names.
92 
93  \note Geometry types other than inherently linear types can
94  also be used. If a point geometry is used, it should be
95  interpreted as a line of "epsilon" (arbitrarily small) length
96  with a horizontal orientation centered on the point, and should
97  be rendered with two end caps. If a polygon is used (or
98  other "area" type), then its closed outline is used as the line
99  string (with no end caps). If a raster geometry is used, its
100  coverage-area outline is used for the line, rendered with no end caps.
101  */
103 
105 
106  /*!
107  \brief
108 
109  A Stroke specifies the appearance of a linear geometry.
110  The Stroke element is optional inside of LineSymbolizer
111  (and other Symbolizers), and its absence means that no
112  stroke is to be rendered.
113  */
114  void setStroke(Stroke* stroke);
115 
116  const Stroke* getStroke() const;
117 
118  /*!
119  \brief
120 
121  PerpendicularOffset allows to draw lines in parallel
122  to the original geometry. For complex line strings
123  these parallel lines have to be constructed so that
124  the distance between original geometry and drawn line
125  stays equal. This construction can result in drawn lines
126  that are actually smaller or longer than the original
127  geometry. The distance is in uoms and is positive
128  to the left-hand side of the line string. Negative numbers
129  mean right. The default offset is 0.
130  */
131  void setPerpendicularOffset(ParameterValue* perpendicularOffset);
132 
134 
135  const std::string& getType() const;
136 
137  //@}
138 
139  /*! \brief It creates a new copy of this object. */
140  Symbolizer* clone() const;
141 
142  private:
143 
144  te::fe::PropertyName* m_geometry; //!< A Geometry gives reference to a (the) geometry property of a feature to be used for rendering. (Optional)
145  Stroke* m_stroke; //!< A Stroke specifies the appearance of a linear geometry. (Optional)
146  ParameterValue* m_perpendicularOffset; //!< A PerpendicularOffset gives the perpendicular distance away from a line to draw a label. (Optional)
147 
148  static const std::string sm_type; //!< A static data member used in the implementation of getType method.
149  };
150 
151  } // end namespace se
152 } // end namespace te
153 
154 #endif // __TERRALIB_SE_INTERNAL_LINESYMBOLIZER_H
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::se::LineSymbolizer::getType
const std::string & getType() const
It returns the symbolizer type.
te::se::LineSymbolizer::m_stroke
Stroke * m_stroke
A Stroke specifies the appearance of a linear geometry. (Optional)
Definition: LineSymbolizer.h:145
te::se::LineSymbolizer::LineSymbolizer
LineSymbolizer()
It initializes a new LineSymbolizer.
te::se::LineSymbolizer::m_perpendicularOffset
ParameterValue * m_perpendicularOffset
A PerpendicularOffset gives the perpendicular distance away from a line to draw a label....
Definition: LineSymbolizer.h:146
te::se::LineSymbolizer::clone
Symbolizer * clone() const
It creates a new copy of this object.
te::se::LineSymbolizer::getGeometry
const te::fe::PropertyName * getGeometry() const
te::se::LineSymbolizer
A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line seg...
Definition: LineSymbolizer.h:52
te::se::LineSymbolizer::LineSymbolizer
LineSymbolizer(const LineSymbolizer &rhs)
Copy constructor.
te::se::LineSymbolizer::setGeometry
void setGeometry(te::fe::PropertyName *geometry)
The Geometry element of a LineSymbolizer defines the linear geometry to be used for styling....
TESEEXPORT
#define TESEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:201
Symbolizer.h
A Symbolizer describes how a Feature is to appear on a map.
te::se::LineSymbolizer::setStroke
void setStroke(Stroke *stroke)
A Stroke specifies the appearance of a linear geometry. The Stroke element is optional inside of Line...
te::se::LineSymbolizer::~LineSymbolizer
~LineSymbolizer()
Destructor.
TE_DEFINE_VISITABLE
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
te::se::LineSymbolizer::getPerpendicularOffset
const ParameterValue * getPerpendicularOffset() const
te::se::Stroke
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:68
te::fe::PropertyName
This class is used to encode the name of any property of an object.
Definition: PropertyName.h:55
te::se::LineSymbolizer::setPerpendicularOffset
void setPerpendicularOffset(ParameterValue *perpendicularOffset)
PerpendicularOffset allows to draw lines in parallel to the original geometry. For complex line strin...
te::se::ParameterValue
The "ParameterValueType" uses WFS-Filter expressions to give values for SE graphic parameters.
Definition: ParameterValue.h:55
te::se::Symbolizer
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:81
te::se::LineSymbolizer::getStroke
const Stroke * getStroke() const
te::se::LineSymbolizer::sm_type
static const std::string sm_type
A static data member used in the implementation of getType method.
Definition: LineSymbolizer.h:148
te::se::LineSymbolizer::m_geometry
te::fe::PropertyName * m_geometry
A Geometry gives reference to a (the) geometry property of a feature to be used for rendering....
Definition: LineSymbolizer.h:144