TextSymbolizer.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/TextSymbolizer.h
22 
23  \brief A TextSymbolizer is used to render text labels according to various graphical parameters.
24 */
25 
26 #ifndef __TERRALIB_SE_INTERNAL_TEXTSYMBOLIZER_H
27 #define __TERRALIB_SE_INTERNAL_TEXTSYMBOLIZER_H
28 
29 // TerraLib
30 #include "Symbolizer.h"
31 
32 namespace te
33 {
34 // Forward declarations
35  namespace fe { class PropertyName; }
36 
37  namespace se
38  {
39 // Forward declarations
40  class Fill;
41  class Font;
42  class Halo;
43  class LabelPlacement;
44  class ParameterValue;
45 
46  /*!
47  \class TextSymbolizer
48 
49  \brief A TextSymbolizer is used to render text labels according to various graphical parameters.
50 
51  In this case, if a line, polygon, or raster geometry
52  is used with this Symbolizer, then the semantic is to
53  use the centroid of the geometry, or any similar
54  representative point.
55 
56  \ingroup se
57 
58  \sa Symbolizer, ParameterValue, Font, LabelPlacement, Halo, Fill, te::fe::PropertyName
59 
60  \note If a Label element is not provided in a TextSymbolizer, then no text shall be rendered.
61  */
63  {
65 
66  public:
67 
68  /** @name Initializer Methods
69  * Methods related to instantiation and destruction.
70  */
71  //@{
72 
73  /*! \brief It initializes a new TextSymbolizer. */
75 
76  /*!
77  \brief Copy constructor.
78 
79  \param rhs The other text symbolizer.
80  */
81  TextSymbolizer(const TextSymbolizer& rhs);
82 
83  /*! \brief Destructor. */
84  ~TextSymbolizer();
85 
86  //@}
87 
88  /** @name Accessor methods
89  * Methods used to get or set properties.
90  */
91  //@{
92 
93  void setGeometry(te::fe::PropertyName* g);
94 
95  void setLabel(ParameterValue* l);
96 
97  const ParameterValue* getLabel() const;
98 
99  void setFont(Font* f);
100 
101  const Font* getFont() const;
102 
103  void setLabelPlacement(LabelPlacement* l);
104 
105  const LabelPlacement* getLabelPlacement() const;
106 
107  void setHalo(Halo* h);
108 
109  const Halo* getHalo() const;
110 
111  void setFill(Fill* f);
112 
113  const Fill* getFill() const;
114 
115  const std::string& getType() const;
116 
117  //@}
118 
119  /*! \brief It creates a new copy of this object. */
120  Symbolizer* clone() const;
121 
122  private:
123 
124  te::fe::PropertyName* m_geometry; //!< The Geometry will be interpreted as a point or a line as needed by the LabelPlacement. (Optional)
125  ParameterValue* m_label; //!< The label specifies the textual content to be rendered. (Optional)
126  Font* m_font; //!< The font element specifies the text font to use. (Optional)
127  LabelPlacement* m_labelPlacement; //!< The label placement specifies where and how a text label should be rendered relative to a geometry. (Optional)
128  Halo* m_halo; //!< A Halo is a type of Fill that is applied to the backgrounds of font glyphs. (Optional)
129  Fill* m_fill; //!< It specifies how the text area will be filled. (Optional)
130 
131  static const std::string sm_type; //!< A static data member used in the implementation of getType method.
132  };
133 
134  } // end namespace se
135 } // end namespace te
136 
137 #endif // __TERRALIB_SE_INTERNAL_TEXTSYMBOLIZER_H
A TextSymbolizer is used to render text labels according to various graphical parameters.
Font * m_font
The font element specifies the text font to use. (Optional)
The LabelPlacement specifies where and how a text label should be rendered relative to a geometry...
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
The "ParameterValueType" uses WFS-Filter expressions to give values for SE graphic parameters...
static const std::string sm_type
A static data member used in the implementation of getType method.
This class is used to encode the name of any property of an object.
Definition: PropertyName.h:54
LabelPlacement * m_labelPlacement
The label placement specifies where and how a text label should be rendered relative to a geometry...
URI C++ Library.
A Font specifies the text font to use in a text symbolizer.
Definition: Font.h:63
ParameterValue * m_label
The label specifies the textual content to be rendered. (Optional)
A Fill specifies the pattern for filling an area geometry.
Definition: Fill.h:59
#define TESEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:187
te::fe::PropertyName * m_geometry
The Geometry will be interpreted as a point or a line as needed by the LabelPlacement. (Optional)
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
Halo * m_halo
A Halo is a type of Fill that is applied to the backgrounds of font glyphs. (Optional) ...
A Symbolizer describes how a Feature is to appear on a map.
A Halo is a type of Fill that is applied to the backgrounds of font glyphs.
Definition: Halo.h:64
Fill * m_fill
It specifies how the text area will be filled. (Optional)