All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Grouping.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 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 Grouping.h
22 
23  \brief This class contains the parameters needed for grouping the values of a Property.
24 */
25 
26 #ifndef __TERRALIB_MAPTOOLS_INTERNAL_GROUPING_H
27 #define __TERRALIB_MAPTOOLS_INTERNAL_GROUPING_H
28 
29 // TerraLib
30 #include "Config.h"
31 #include "Enums.h"
32 
33 // STL
34 #include <cstdlib>
35 #include <string>
36 #include <vector>
37 
38 namespace te
39 {
40 // Forward declarations
41  namespace dt
42  {
43  class Property;
44  }
45 
46  namespace map
47  {
48  class GroupingItem;
49 
50  /*!
51  \class Grouping
52 
53  \brief This class contains the parameters needed for grouping the values of a Property.
54 
55  \ingroup map
56 
57  \sa GroupingItem, Layer
58  */
60  {
61  public:
62 
63  /*!
64  \brief It constructs a new Grouping instance.
65 
66  \param propertyName The property name whose values will be used to make the grouping.
67  \param type The grouping type.
68  \param precision The precision to be set to the property values.
69  */
70  Grouping(const std::string& propertyName, GroupingType type, size_t precision = 6);
71 
72  /*! \brief Destructor. */
73  ~Grouping();
74 
75  /*!
76  \brief It gets the property name whose values will be grouped.
77 
78  \return The property name.
79  */
80  std::string getPropertyName() const;
81 
82  /*!
83  \brief It sets the property name whose values will be grouped.
84 
85  \param name The property name.
86  */
87  void setPropertyName(const std::string& name);
88 
89  /*!
90  \brief It gets the property type whose values will be grouped.
91 
92  \return The property type.
93  */
94  int getPropertyType() const;
95 
96  /*!
97  \brief It sets the property type whose values will be grouped.
98 
99  \param type The property type.
100  */
101  void setPropertyType(const int& type);
102 
103  /*!
104  \brief It gets the grouping type.
105 
106  \return The grouping type.
107  */
108  const GroupingType getType() const;
109 
110  /*!
111  \brief It sets the grouping type.
112 
113  \param type The grouping type.
114  */
115  void setType(GroupingType type);
116 
117  /*!
118  \brief It gets the precision used for the property values.
119 
120  \output The precision used for the property values.
121  */
122  const size_t getPrecision() const;
123 
124  /*!
125  \brief It sets the precision to be used for the property values.
126 
127  \param precision The precision value.
128  */
129  void setPrecision(size_t precision);
130 
131  /*!
132  \brief It gets the number of slices used in the Equal Steps and Quantil groupings.
133 
134  \output The number of slices.
135  */
136  const size_t getNumSlices() const;
137 
138  /*!
139  \brief It sets the number of slices for the EqualSteps and Quantil groupings.
140 
141  \param numSlices The number of slices.
142  */
143  void setNumSlices(size_t numSlices);
144 
145  /*!
146  \brief It gets the standard deviation used in the Standard Deviation grouping.
147 
148  \output The standard deviation.
149  */
150  const double getStdDeviation() const;
151 
152  /*!
153  \brief It sets the standard deviation for the Standard Deviation grouping.
154 
155  \param stdDeviation The standard deviation.
156  */
157  void setStdDeviation(double stdDeviation);
158 
159  /*!
160  \brief It gets the vector of grouping items.
161 
162  \return The vector of grouping items.
163  */
164  const std::vector<te::map::GroupingItem*>& getGroupingItems() const;
165 
166  /*!
167  \brief It sets the vector of grouping items.
168 
169  \param The vector of grouping items.
170  */
171  void setGroupingItems(std::vector<te::map::GroupingItem*>& items);
172 
173  /*! \brief It gets the grouping visibility. */
174  bool isVisible() const;
175 
176  /*!
177  \brief It sets the grouping visibility.
178 
179  \param visible The visibility value.
180  */
181  void setVisibility(bool visible);
182 
183  private:
184 
185  std::string m_propertyName; //!< The property name whose values will be used to make the grouping.
186  int m_propertyType; //!< The property type whose values will be used to make the grouping.
187  GroupingType m_type; //!< The grouping type.
188  size_t m_precision; //!< The precision of the values.
189  size_t m_numSlices; //!< The number of slices used in the Equal Steps and Quantil groupings.
190  double m_stdDeviation; //!< The standard deviation used in the Standard Deviation grouping.
191  bool m_isVisible; //!< A flag that indicates if the grouping is visible.
192  std::vector<te::map::GroupingItem*> m_items; //!< The vector of grouping items.
193  };
194 
195  } // end namespace map
196 } // end namespace te
197 
198 #endif // __TERRALIB_MAPTOOLS_INTERNAL_GROUPING_H
199 
GroupingType
The grouping type associated to the layer.
Definition: Enums.h:150
This class contains the parameters needed for grouping the values of a Property.
Definition: Grouping.h:59
double m_stdDeviation
The standard deviation used in the Standard Deviation grouping.
Definition: Grouping.h:190
std::vector< te::map::GroupingItem * > m_items
The vector of grouping items.
Definition: Grouping.h:192
#define TEMAPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:98
bool m_isVisible
A flag that indicates if the grouping is visible.
Definition: Grouping.h:191
size_t m_numSlices
The number of slices used in the Equal Steps and Quantil groupings.
Definition: Grouping.h:189
int m_propertyType
The property type whose values will be used to make the grouping.
Definition: Grouping.h:186
size_t m_precision
The precision of the values.
Definition: Grouping.h:188
GroupingType m_type
The grouping type.
Definition: Grouping.h:187
std::string m_propertyName
The property name whose values will be used to make the grouping.
Definition: Grouping.h:185