Grouping.cpp
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.cpp
22 
23  \brief This class contains the parameters needed for grouping the values of a Property.
24 */
25 
26 // TerraLib
27 #include "../common/STLUtils.h"
28 #include "../datatype/Enums.h"
29 #include "Grouping.h"
30 
31 
32 te::map::Grouping::Grouping(const std::string& propertyName, te::map::GroupingType type, size_t precision)
33  : m_propertyName(propertyName),
34  m_type(type),
35  m_precision(precision),
36  m_isVisible(true),
37  m_summary("AVERAGE")
38 {
40 }
41 
46  m_isVisible(true),
47  m_summary(rhs.m_summary)
48 {
51 }
52 
54 
56 {
63 
64  return g;
65 }
66 
68 {
69  return m_propertyName;
70 }
71 
72 
73 void te::map::Grouping::setPropertyName(const std::string& name)
74 {
75  m_propertyName = name;
76 }
77 
79 {
80  return m_propertyType;
81 }
82 
84 {
85  m_propertyType = type;
86 }
87 
88 
90 {
91  return m_type;
92 }
93 
95 {
96  m_type = type;
97 }
98 
99 const size_t te::map::Grouping::getPrecision() const
100 {
101  return m_precision;
102 }
103 
104 void te::map::Grouping::setPrecision(size_t precision)
105 {
106  m_precision = precision;
107 }
108 
110 {
111  return m_numSlices;
112 }
113 
114 void te::map::Grouping::setNumSlices(size_t numSlices)
115 {
116  m_numSlices = numSlices;
117 }
118 
120 {
121  return m_stdDeviation;
122 }
123 
124 void te::map::Grouping::setStdDeviation(double stdDeviation)
125 {
126  m_stdDeviation = stdDeviation;
127 }
128 
130 {
131  return m_isVisible;
132 }
133 
135 {
136  m_isVisible = visible;
137 }
138 
139 std::string te::map::Grouping::getSummary() const
140 {
141  return m_summary;
142 }
143 
144 void te::map::Grouping::setSummary(const std::string& summary)
145 {
146  m_summary = summary;
147 }
void setPrecision(size_t precision)
It sets the precision to be used for the property values.
Definition: Grouping.cpp:104
const double getStdDeviation() const
It gets the standard deviation used in the Standard Deviation grouping.
Definition: Grouping.cpp:119
std::string m_propertyName
The property name whose values will be used to make the grouping.
Definition: Grouping.h:185
int getPropertyType() const
It gets the property type whose values will be grouped.
Definition: Grouping.cpp:78
~Grouping()
Destructor.
const size_t getPrecision() const
It gets the precision used for the property values.
Definition: Grouping.cpp:99
std::string getPropertyName() const
It gets the property name whose values will be grouped.
Definition: Grouping.cpp:67
void setStdDeviation(double stdDeviation)
It sets the standard deviation for the Standard Deviation grouping.
Definition: Grouping.cpp:124
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
void setPropertyName(const std::string &name)
It sets the property name whose values will be grouped.
Definition: Grouping.cpp:73
void setNumSlices(size_t numSlices)
It sets the number of slices for the EqualSteps and Quantil groupings.
Definition: Grouping.cpp:114
URI C++ Library.
Definition: Attributes.h:37
void setPropertyType(const int &type)
It sets the property type whose values will be grouped.
Definition: Grouping.cpp:83
std::string m_summary
The summary used in case 1 to n.
Definition: Grouping.h:193
void setVisibility(bool visible)
It sets the grouping visibility.
Definition: Grouping.cpp:134
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
bool isVisible() const
It gets the grouping visibility.
Definition: Grouping.cpp:129
void setSummary(const std::string &summary)
It gets the grouping summary. It is used only in case 1 to n.
Definition: Grouping.cpp:144
GroupingType
The grouping type associated to the layer.
Grouping(const std::string &propertyName, GroupingType type, size_t precision=6)
It constructs a new Grouping instance.
Definition: Grouping.cpp:32
std::string getSummary() const
It gets the grouping summary. It is used only in case 1 to n.
Definition: Grouping.cpp:139
const GroupingType getType() const
It gets the grouping type.
Definition: Grouping.cpp:89
size_t m_numSlices
The number of slices used in the Equal Steps and Quantil groupings.
Definition: Grouping.h:189
Grouping * clone()
Definition: Grouping.cpp:55
This class contains the parameters needed for grouping the values of a Property.
const size_t getNumSlices() const
It gets the number of slices used in the Equal Steps and Quantil groupings.
Definition: Grouping.cpp:109
void setType(GroupingType type)
It sets the grouping type.
Definition: Grouping.cpp:94
GroupingType m_type
The grouping type.
Definition: Grouping.h:187