ColorSchemeGroup.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/color/ColorSchemeGroup.h
22 
23  \brief This class represents a group of color schemes.
24 */
25 
26 #ifndef __TERRALIB_COLOR_INTERNAL_COLORSCHEMEGROUP_H
27 #define __TERRALIB_COLOR_INTERNAL_COLORSCHEMEGROUP_H
28 
29 // TerraLib
30 #include "Config.h"
31 
32 // STL
33 #include <string>
34 #include <vector>
35 
36 namespace te
37 {
38  namespace color
39  {
40 // Forward declarations
41  class ColorScheme;
42  class ColorSchemeCatalog;
43 
44  /*!
45  \class ColorSchemeGroup
46 
47  \brief This class represents a group of color schemes.
48 
49  It is used to group color schemes.
50 
51  \ingroup color
52 
53  \sa ColorScheme, ColorSchemeCatalog, ColorSchemeCatalogManager
54  */
56  {
57  public:
58 
59  /** @name Initializer Methods
60  * Methods related to instantiation and destruction.
61  */
62  //@{
63 
64  /*!
65  \brief It initializes a new ColorSchemeGroup and adds it to the parent catalog.
66 
67  \param name Color scheme group name.
68  */
69  ColorSchemeGroup(const std::string& name);
70 
71  /*! \brief Destructor. */
73 
74  //@}
75 
76  /** @name Accessor methods
77  * Methods used to get or set properties.
78  */
79  //@{
80 
81  /*!
82  \brief It returns the group name.
83 
84  \return The group name.
85  */
86  const std::string& getName() const;
87 
88  /*!
89  \brief It sets the group name and adjust its entry in its the catalog if needed.
90 
91  \param name The group name.
92  */
93  void setName(const std::string& name);
94 
95  /*!
96  \brief It returns the group description.
97 
98  \return The group description.
99  */
100  const std::string& getDescription() const;
101 
102  /*!
103  \brief It sets the group description.
104 
105  \param d The group description.
106  */
107  void setDescription(const std::string& d);
108 
109  /*!
110  \brief It adds a new color scheme to the group and sets its relationship.
111 
112  \param colorScheme The color scheme that will take part of the group.
113 
114  \note The color group will take the ownership of the color scheme.
115 
116  \note Don't inform a NULL pointer.
117  */
118  void push_back(ColorScheme* colorScheme);
119 
120  /*!
121  \brief It just remove the reference to the informed color scheme.
122 
123  \param colorScheme The color scheme to be disconnected from this group.
124 
125  \note The caller of this method will take the ownership of the color scheme.
126  */
127  void disconnect(ColorScheme* colorScheme);
128 
129  /*!
130  \brief It returns a reference to the list of color schemes belonging to this group.
131 
132  \return A reference to the list of color schemes belonging to this group.
133  */
134  const std::vector<ColorScheme*>& getColorSchemes() const;
135 
136  /*!
137  \brief It returns the parent catalog or NULL if it doesn't belong to a catalog.
138 
139  \return The parent catalog or NULL if it doesn't belong to a catalog.
140  */
141  ColorSchemeCatalog* getParent() const;
142 
143  //@}
144 
145  private:
146 
147  /** @name Copy Constructor and Assignment Operator
148  * Copy constructor and assignment operator not allowed.
149  */
150  //@{
151 
152  /*!
153  \brief Copy constructor not allowed.
154 
155  \param rhs The right-hand-side copy that would be used to copy from.
156  */
158 
159  /*!
160  \brief Assignment operator not allowed.
161 
162  \param rhs The right-hand-side copy that would be used to copy from.
163 
164  \return A reference to this object.
165  */
166  ColorSchemeGroup& operator=(const ColorSchemeGroup& rhs);
167 
168  //@}
169 
170  /** @name Auxiliary Methods
171  * Auxiliary methods.
172  */
173  //@{
174 
175  /*!
176  \brief It sets the parent color catalog for this group.
177 
178  \param parent The parent catalog.
179 
180  \note This method is intended to be used by a ColorSchemeCatalog object.
181  */
182  void setParent(ColorSchemeCatalog* parent);
183 
184  //@}
185 
186  private:
187 
188  ColorSchemeCatalog* m_parent; //!< The parent catalog.
189  std::string m_name; //!< Color scheme name.
190  std::string m_description; //!< A brief description about the color scheme, that can helps someone to decide to use it or not (when its use can be best applied).
191  std::vector<ColorScheme*> m_colorSchemes; //!< The group of color schemes.
192 
193  friend class ColorSchemeCatalog;
194  };
195 
196  } // end namespace color
197 } // end namespace te
198 
199 #endif // __TERRALIB_COLOR_INTERNAL_COLORSCHEMEGROUP_H
200 
It models the concept of color scheme.
Definition: ColorScheme.h:58
std::string m_description
A brief description about the color scheme, that can helps someone to decide to use it or not (when i...
Configuration flags for the Color module of TerraLib.
URI C++ Library.
std::string m_name
Color scheme name.
ColorSchemeCatalog * m_parent
The parent catalog.
This class represents a group of color schemes.
A catalog for color schemes.
std::vector< ColorScheme * > m_colorSchemes
The group of color schemes.
#define TECOLOREXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:73