Symbol.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/qt/widgets/se/Symbol.h
22 
23  \brief This class represents a symbol.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOL_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOL_H
28 
29 // TerraLib
30 #include "../Config.h"
31 #include "SymbolInfo.h"
32 
33 // STL
34 #include <string>
35 #include <vector>
36 
37 namespace te
38 {
39 // Forward declarations
40  namespace se
41  {
42  class Symbolizer;
43  }
44 
45  namespace qt
46  {
47  namespace widgets
48  {
49  /*!
50  \class Symbol
51 
52  \brief This class represents a symbol. TODO: More description!
53  */
55  {
56  public:
57 
58  /** @name Initializer Methods
59  * Methods related to instantiation and destruction.
60  */
61  //@{
62 
63  /*! \brief Default constructor. */
64  Symbol();
65 
66  /*! \brief Copy constructor. */
67  Symbol(const Symbol& rhs);
68 
69  /*! \brief Destructor. */
70  ~Symbol();
71 
72  //@}
73 
74  public:
75 
76  /*!
77  \brief It return the information associated to the symbol.
78 
79  \return The information associated to the symbol.
80  */
81  const SymbolInfo& getInfo() const;
82 
83  /*!
84  \brief It sets the information associated to the symbol.
85 
86  \param info The information that will be associated to this symbol.
87  */
88  void setInfo(const SymbolInfo& info);
89 
90  /*!
91  \brief It returns the number of Symbolizers that compose of the symbol.
92 
93  \return The number of Symbolizers that compose of the symbol.
94  */
95  std::size_t getSymbolizersCount() const;
96 
97  /*!
98  \brief It returns the n-th Symbolizer.
99 
100  \param i The Symbolizer index.
101 
102  \return It returns a pointer to the specified Symbolizer.
103 
104  \note The caller of this method will NOT take the ownership of the symbolizer.
105  */
106  te::se::Symbolizer* getSymbolizer(const std::size_t& i) const;
107 
108  /*!
109  \brief It returns the n-th Symbolizer.
110 
111  \param i The Symbolizer index.
112 
113  \return It returns a pointer to the specified Symbolizer.
114 
115  \note The caller of this method will NOT take the ownership of the symbolizer.
116  */
117  te::se::Symbolizer* operator[](const std::size_t& i) const;
118 
119  /*!
120  \brief It returns the list of Symbolizers that compose the symbol.
121 
122  \return The list of Symbolizers that compose the symbol.
123 
124  \note The caller of this method will NOT take the ownership of the symbolizers.
125  */
126  const std::vector<te::se::Symbolizer*>& getSymbolizers() const;
127 
128  /*!
129  \brief It adds the given Symbolizer to the list of Symbolizers of the symbol.
130 
131  \param symb The Symbolizer that will be added.
132 
133  \note The symbol will take the ownership of the given Symbolizer.
134  */
135  void addSymbolizer(te::se::Symbolizer* symb);
136 
137  /*!
138  \brief It sets the given Symbolizer at the given position.
139 
140  \param i The Symbolizer position.
141  \param symb The Symbolizer that will be added.
142 
143  \note The symbol will take the ownership of the given Symbolizer.
144  */
145  void setSymbolizer(const std::size_t& i, te::se::Symbolizer* symb);
146 
147  /*!
148  \brief It removes the specified Symbolizer from the list of Symbolizers of the symbol.
149 
150  \param i The Symbolizer index.
151  */
152  void removeSymbolizer(const std::size_t& i);
153 
154  /*!
155  \brief It swaps the position of the Symbolizers.
156 
157  \param first The first Symbolizer index.
158  \param second The second Symbolizer index.
159  */
160  void swapSymbolizers(const std::size_t& first, const std::size_t& second);
161 
162  /*! \brief It creates a new copy of this object. */
163  Symbol* clone() const;
164 
165  private:
166 
167  SymbolInfo m_info; //!< Information about the symbol.
168  std::vector<te::se::Symbolizer*> m_symbs; //!< Set of symbolizers that compose the symbol.
169  };
170 
171  } // end namespace widgets
172  } // end namespace qt
173 } // end namespace te
174 
175 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOL_H
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
Information about a given Symbol.
SymbolInfo m_info
Information about the symbol.
Definition: Symbol.h:167
URI C++ Library.
Information about a given Symbol.
Definition: SymbolInfo.h:60
This class represents a symbol. TODO: More description!
Definition: Symbol.h:54
std::vector< te::se::Symbolizer * > m_symbs
Set of symbolizers that compose the symbol.
Definition: Symbol.h:168
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63