LinePlacement.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/LinePlacement.h
22 
23  \brief A LinePlacement specifies how a text label should be rendered relative to a linear geometry.
24 */
25 
26 #ifndef __TERRALIB_SE_INTERNAL_LINEPLACEMENT_H
27 #define __TERRALIB_SE_INTERNAL_LINEPLACEMENT_H
28 
29 // TerraLib
30 #include "Config.h"
31 
32 // Boost
33 #include <boost/noncopyable.hpp>
34 
35 namespace te
36 {
37  namespace se
38  {
39 // Forward declaration
40  class ParameterValue;
41 
42  /*!
43  \class LinePlacement
44 
45  \brief A LinePlacement specifies how a text label should be rendered relative to a linear geometry.
46 
47  For a LinePlacement, a perpendicular offset can be specified,
48  to allow the line itself to be plotted also. This might be
49  useful for labelling a road or a river, for example. The default
50  behaviour of LinePlacement is to draw of the label along the line.
51  If IsRepeated is "true", the label will be repeatedly drawn along
52  the line with InitialGap and Gap defining the spaces at the
53  beginning and between labels. GeneralizeLine allows the actual
54  geometry, be it a linestring or polygon to be generalized for
55  label placement. This is e.g. useful for labelling polygons inside
56  their interior when there is need for the label to resemble the
57  shape of the polygon.
58 
59  \sa LabelPlacement, ParameterValue
60  */
61  class TESEEXPORT LinePlacement : public boost::noncopyable
62  {
63  public:
64 
65  /** @name Initializer Methods
66  * Methods related to instantiation and destruction.
67  */
68  //@{
69 
70  /*! \brief It initializes a new LinePlacement. */
71  LinePlacement();
72 
73  /*! \brief Destructor. */
74  ~LinePlacement();
75 
76  //@}
77 
78  /** @name Accessor methods
79  * Methods used to get or set properties.
80  */
81  //@{
82 
83  void setPerpendicularOffset(ParameterValue* p);
84 
85  const ParameterValue* getPerpendicularOffset() const { return m_perpendicularOffset; }
86 
87  void setIsRepeated(bool i);
88 
89  bool isRepeated() const { return m_isRepeated; }
90 
91  void setInitialGap(ParameterValue* p);
92 
93  const ParameterValue* getInitialGap() const { return m_gap; }
94 
95  void setGap(ParameterValue* p);
96 
97  const ParameterValue* getGap() const { return m_gap; }
98 
99  void setIsAligned(bool i);
100 
101  bool isAligned() const { return m_isAligned; }
102 
103  void setGeneralizeLine(bool g);
104 
105  bool getGeneralizeLine() const { return m_generalizeLine; }
106 
107  //@}
108 
109  /*! \brief It creates a new copy of this object. */
110  LinePlacement* clone() const;
111 
112  private:
113 
114  ParameterValue* m_perpendicularOffset; //!< A perpendicular offset gives the perpendicular distance away from a line to draw a label. (Optional)
115  bool m_isRepeated; //!< If IsRepeated is "true", the label will be repeatedly drawn along the line with m_initialGap and m_gap defining the spaces at the beginning and between labels. (Optional)
116  ParameterValue* m_initialGap; //!< Initial gap defines the initial empty space, before the first Graphic or Label should be rendered. (Optional)
117  ParameterValue* m_gap; //!< Gap defines the empty space between two Graphics or Labels. (Optional)
118  bool m_isAligned; //!< Labels can either be aligned to the line geometry if m_isAligned is "true" (the default) or are drawn horizontally. (Optional)
119  bool m_generalizeLine; //!< It allows the actual geometry, be it a linestring or polygon, to be generalized for label placement. This is e.g. useful for labelling polygons inside their interior when there is need for the label to resemble the shape of the polygon. (Optional)
120  };
121 
122  } // end namespace se
123 } // end namespace te
124 
125 #endif // __TERRALIB_SE_INTERNAL_LINEPLACEMENT_H
bool m_generalizeLine
It allows the actual geometry, be it a linestring or polygon, to be generalized for label placement...
bool isAligned() const
bool m_isAligned
Labels can either be aligned to the line geometry if m_isAligned is "true" (the default) or are drawn...
A LinePlacement specifies how a text label should be rendered relative to a linear geometry...
Definition: LinePlacement.h:61
bool isRepeated() const
Definition: LinePlacement.h:89
The "ParameterValueType" uses WFS-Filter expressions to give values for SE graphic parameters...
const ParameterValue * getGap() const
Definition: LinePlacement.h:97
URI C++ Library.
ParameterValue * m_perpendicularOffset
A perpendicular offset gives the perpendicular distance away from a line to draw a label...
#define TESEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:187
Configuration flags for the Symbology Encoding support of TerraLib.
const ParameterValue * getInitialGap() const
Definition: LinePlacement.h:93
bool m_isRepeated
If IsRepeated is "true", the label will be repeatedly drawn along the line with m_initialGap and m_ga...
ParameterValue * m_gap
Gap defines the empty space between two Graphics or Labels. (Optional)
ParameterValue * m_initialGap
Initial gap defines the initial empty space, before the first Graphic or Label should be rendered...
const ParameterValue * getPerpendicularOffset() const
Definition: LinePlacement.h:85
bool getGeneralizeLine() const