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  */
70  LineSymbolizer(const LineSymbolizer& rhs);
71 
72  /*! \brief Destructor. */
73  ~LineSymbolizer();
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  */
102  void setGeometry(te::fe::PropertyName* geometry);
103 
104  const te::fe::PropertyName* getGeometry() const;
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 
133  const ParameterValue* getPerpendicularOffset() const;
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
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...
ParameterValue * m_perpendicularOffset
A PerpendicularOffset gives the perpendicular distance away from a line to draw a label...
This class is used to encode the name of any property of an object.
Definition: PropertyName.h:54
URI C++ Library.
#define TESEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:187
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:67
A Symbolizer describes how a Feature is to appear on a map.
A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line seg...
te::fe::PropertyName * m_geometry
A Geometry gives reference to a (the) geometry property of a feature to be used for rendering...