Grouping.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 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  /*!
49  \class Grouping
50 
51  \brief This class contains the parameters needed for grouping the values of a Property.
52 
53  \ingroup map
54 
55  \sa Layer
56  */
58  {
59  public:
60 
61  /*!
62  \brief It constructs a new Grouping instance.
63 
64  \param propertyName The property name whose values will be used to make the grouping.
65  \param type The grouping type.
66  \param precision The precision to be set to the property values.
67  */
68  Grouping(const std::string& propertyName, GroupingType type, size_t precision = 6);
69 
70  /*! \brief Destructor. */
71  ~Grouping();
72 
73  /*! \brief Copy constructor. */
74  Grouping(const Grouping& rhs);
75 
76  Grouping* clone();
77 
78  /*!
79  \brief It gets the property name whose values will be grouped.
80 
81  \return The property name.
82  */
83  std::string getPropertyName() const;
84 
85  /*!
86  \brief It sets the property name whose values will be grouped.
87 
88  \param name The property name.
89  */
90  void setPropertyName(const std::string& name);
91 
92  /*!
93  \brief It gets the property type whose values will be grouped.
94 
95  \return The property type.
96  */
97  int getPropertyType() const;
98 
99  /*!
100  \brief It sets the property type whose values will be grouped.
101 
102  \param type The property type.
103  */
104  void setPropertyType(const int& type);
105 
106  /*!
107  \brief It gets the grouping type.
108 
109  \return The grouping type.
110  */
111  const GroupingType getType() const;
112 
113  /*!
114  \brief It sets the grouping type.
115 
116  \param type The grouping type.
117  */
118  void setType(GroupingType type);
119 
120  /*!
121  \brief It gets the precision used for the property values.
122 
123  \output The precision used for the property values.
124  */
125  const size_t getPrecision() const;
126 
127  /*!
128  \brief It sets the precision to be used for the property values.
129 
130  \param precision The precision value.
131  */
132  void setPrecision(size_t precision);
133 
134  /*!
135  \brief It gets the number of slices used in the Equal Steps and Quantil groupings.
136 
137  \output The number of slices.
138  */
139  const size_t getNumSlices() const;
140 
141  /*!
142  \brief It sets the number of slices for the EqualSteps and Quantil groupings.
143 
144  \param numSlices The number of slices.
145  */
146  void setNumSlices(size_t numSlices);
147 
148  /*!
149  \brief It gets the standard deviation used in the Standard Deviation grouping.
150 
151  \output The standard deviation.
152  */
153  const double getStdDeviation() const;
154 
155  /*!
156  \brief It sets the standard deviation for the Standard Deviation grouping.
157 
158  \param stdDeviation The standard deviation.
159  */
160  void setStdDeviation(double stdDeviation);
161 
162  /*! \brief It gets the grouping visibility. */
163  bool isVisible() const;
164 
165  /*!
166  \brief It sets the grouping visibility.
167 
168  \param visible The visibility value.
169  */
170  void setVisibility(bool visible);
171 
172  /*! \brief It gets the grouping summary. It is used only in case 1 to n.
173  */
174  std::string getSummary() const;
175 
176  /*!
177  \brief It gets the grouping summary. It is used only in case 1 to n.
178 
179  \param summary The summary mode. It can be: "MIN", "MAX", "SUM", "AVERAGE", "MEDIAN", "STDDEV" or "VARIANCE"
180  */
181  void setSummary(const std::string& summary);
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 
193  std::string m_summary; //!< The summary used in case 1 to n.
194  };
195 
196  } // end namespace map
197 } // end namespace te
198 
199 #endif // __TERRALIB_MAPTOOLS_INTERNAL_GROUPING_H
200 
std::string m_propertyName
The property name whose values will be used to make the grouping.
Definition: Grouping.h:185
size_t m_precision
The precision of the values.
Definition: Grouping.h:188
This class contains the parameters needed for grouping the values of a Property.
Definition: Grouping.h:57
TerraLib.
std::string m_summary
The summary used in case 1 to n.
Definition: Grouping.h:193
#define TEMAPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
int m_propertyType
The property type whose values will be used to make the grouping.
Definition: Grouping.h:186
bool m_isVisible
A flag that indicates if the grouping is visible.
Definition: Grouping.h:191
double m_stdDeviation
The standard deviation used in the Standard Deviation grouping.
Definition: Grouping.h:190
GroupingType
The grouping type associated to the layer.
Definition: Enums.h:151
size_t m_numSlices
The number of slices used in the Equal Steps and Quantil groupings.
Definition: Grouping.h:189
GroupingType m_type
The grouping type.
Definition: Grouping.h:187