Element.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/annotationtext/Element.h
22 
23  \brief An Text Element consists of a string, location, leader line and may have attribute.
24  */
25 
26 #ifndef __TERRALIB_ANNOTATIONTEXT_INTERNAL_ELEMENT_H
27 #define __TERRALIB_ANNOTATIONTEXT_INTERNAL_ELEMENT_H
28 
29 // TerraLib
30 #include "../common/STLUtils.h"
31 #include "Config.h"
32 
33 // STL
34 #include <string>
35 
36 namespace te
37 {
38 // Forward declarations
39  namespace gm
40  {
41  class Envelope;
42  class Geometry;
43  }
44 
45  namespace at
46  {
47 // Forward declarations
48  class Attributes;
49 
50  /*!
51  \class Text
52 
53  \brief A Text may contain 1 or more Text Elements.
54  */
56  {
57  public:
58 
59  /*! \brief Text Element constructor. */
60  Element();
61 
62  /*! \brief Text Element constructor.
63 
64  \param value The string value.
65  \param location The Text entry point in world coordinates.
66  \param leaderLine The Text leader line in world coordinates.
67 
68  \note The Element will become owner of location and leaderLine pointers.
69  */
70  Element(const std::string& value,
71  te::gm::Geometry* location = 0,
72  te::gm::Geometry* leaderLine = 0);
73 
74  /*! \brief Text Element destructor. */
75  ~Element();
76 
77  /*!
78  \brief It clones the Element.
79 
80  \return A copy of the given Element.
81 
82  \note The caller of this method will take the ownership of the returned Element.
83  */
84  Element* clone() const;
85 
86  /*!
87  \brief it sets the text string.
88 
89  \param value The text string.
90  */
91  void setValue(const std::string& value);
92 
93  /*!
94  \brief it returns the text string.
95 
96  \return The text string.
97  */
98  const std::string& getValue() const;
99 
100  /*!
101  \brief it sets the text location.
102 
103  \param location The text location.
104 
105  \note The Element will become owner of location pointer.
106  */
107  void setLocation(te::gm::Geometry* location);
108 
109  /*!
110  \brief it returns the text location.
111 
112  \return The text location.
113  */
114  const te::gm::Geometry* getLocation() const;
115 
116  /*!
117  \brief it sets the text leader line.
118 
119  \param leaderLine The text leader line.
120 
121  \note The Element will become owner of leaderLine pointer.
122  */
123  void setLeaderLine(te::gm::Geometry* leaderLine);
124 
125  /*!
126  \brief it returns the text leader line.
127 
128  \return The text leader line.
129  */
130  const te::gm::Geometry* getLeaderLine() const;
131 
132  /*!
133  \brief it sets the text attributes.
134 
135  \param att The text attributes.
136 
137  \note The Element will become owner of attribute pointer.
138  */
139  void setAttributes(Attributes* attribute);
140 
141  /*!
142  \brief it returns the text attributes.
143 
144  \retrun The text attributes.
145  */
146  const Attributes* getAttributes() const;
147 
148  private:
149 
150  /** @name Not Allowed Methods
151  * No copy allowed.
152  */
153  //@{
154 
155  /*!
156  \brief No copy constructor allowed.
157 
158  \param rhs The other element.
159  */
160  Element(const Element& rhs);
161 
162  /*!
163  \brief No assignment operator allowed.
164 
165  \param rhs The other element.
166 
167  \return A reference for this.
168  */
169  Element& operator=(const Element& rhs);
170 
171  private:
172 
173  std::string m_value; //!< text value
174  te::gm::Geometry* m_location; //!< location
175  te::gm::Geometry* m_leaderLine; //!< leader line
176  Attributes* m_attribute; //!< attributes
177  };
178 
179  } // end namespace at
180 } // end namespace te
181 
182 #endif // __TERRALIB_ANNOTATIONTEXT_INTERNAL_ELEMENT_H
183 
std::string m_value
text value
Definition: Element.h:173
Attributes * m_attribute
attributes
Definition: Element.h:176
Configuration flags for the TerraLib Annotation Text module.
te::gm::Geometry * m_location
location
Definition: Element.h:174
URI C++ Library.
#define TEANNOTATIONTEXTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:59
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
te::gm::Geometry * m_leaderLine
leader line
Definition: Element.h:175