All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Chart.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 terralib/maptools/Chart.h
22 
23  \brief This class represents the informations needed to build map charts.
24 */
25 
26 #ifndef __TERRALIB_MAPTOOLS_INTERNAL_CHART_H
27 #define __TERRALIB_MAPTOOLS_INTERNAL_CHART_H
28 
29 // TerraLib
30 #include "../color/RGBAColor.h"
31 #include "Config.h"
32 #include "Enums.h"
33 
34 // STL
35 #include <string>
36 #include <vector>
37 
38 namespace te
39 {
40  namespace map
41  {
42  /*!
43  \class Chart
44 
45  \brief This class represents the informations needed to build map charts.
46 
47  \ingroup map
48 
49  \sa AbstractLayer
50  */
52  {
53  public:
54 
55  /*!
56  \brief It constructs a new Chart instance.
57 
58  \param type The chart type.
59  \param properties The property names that will be used to generate the chart.
60  */
61  Chart(ChartType type, const std::vector<std::string>& properties);
62 
63  /*!
64  \brief It constructs a new Chart instance.
65 
66  \param type The chart type.
67  \param properties The property names that will be used to generate the chart.
68  \param colors The colors that will be used to represent each property.
69  */
70  Chart(ChartType type, const std::vector<std::string>& properties, const std::vector<te::color::RGBAColor>& colors);
71 
72  /*! \brief Destructor. */
73  ~Chart();
74 
75  ChartType getType() const;
76 
77  const std::vector<std::string>& getProperties() const;
78 
79  const te::color::RGBAColor& getColor(std::size_t i) const;
80 
81  void setColor(std::size_t i, const te::color::RGBAColor& color);
82 
83  const te::color::RGBAColor& getContourColor() const;
84 
85  void setContourColor(const te::color::RGBAColor& color);
86 
87  std::size_t getContourWidth() const;
88 
89  void setContourWidth(std::size_t width);
90 
91  std::size_t getHeight() const;
92 
93  void setHeight(std::size_t height);
94 
95  std::size_t getWidth() const;
96 
97  std::size_t getBarWidth() const;
98 
99  void setBarWidth(std::size_t width);
100 
101  void setMaxValue(double value);
102 
103  double getMaxValue() const;
104 
105  /*! \brief It gets the chart visibility. */
106  bool isVisible() const;
107 
108  /*!
109  \brief It sets the chart visibility.
110 
111  \param visible The visibility value.
112  */
113  void setVisibility(bool visible);
114 
115  void setAvoidConflicts(bool on);
116 
117  bool getAvoidConflicts() const;
118 
119  private:
120 
121  ChartType m_type; //!< The chart type.
122  std::vector<std::string> m_properties; //!< The property names that will be used to generate the chart.
123  std::vector<te::color::RGBAColor> m_colors; //!< The color used to each property.
124  te::color::RGBAColor m_contourColor; //!< The chart contour color.
125  std::size_t m_contourWidth; //!< The chart contour width (in pixels).
126  std::size_t m_height; //!< The chart height (in pixels).
127  std::size_t m_barWidth; //!< The bar width for char Bar type (in pixels).
128  bool m_isVisible; //!< A flag that indicates if the chart is visible.
129  double m_maxValue; //!< The max value of the chart.
130  bool m_avoidConflicts; //!< A flag that indicates if conflicts must be avoided.
131  };
132 
133  } // end namespace map
134 } // end namespace te
135 
136 #endif // __TERRALIB_MAPTOOLS_INTERNAL_CHART_H
ChartType
The chart types.
Definition: Enums.h:163
std::size_t m_height
The chart height (in pixels).
Definition: Chart.h:126
double m_maxValue
The max value of the chart.
Definition: Chart.h:129
std::vector< te::color::RGBAColor > m_colors
The color used to each property.
Definition: Chart.h:123
std::size_t m_barWidth
The bar width for char Bar type (in pixels).
Definition: Chart.h:127
std::vector< std::string > m_properties
The property names that will be used to generate the chart.
Definition: Chart.h:122
This class represents the informations needed to build map charts.
Definition: Chart.h:51
ChartType m_type
The chart type.
Definition: Chart.h:121
te::color::RGBAColor m_contourColor
The chart contour color.
Definition: Chart.h:124
#define TEMAPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
bool m_isVisible
A flag that indicates if the chart is visible.
Definition: Chart.h:128
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
std::size_t m_contourWidth
The chart contour width (in pixels).
Definition: Chart.h:125
bool m_avoidConflicts
A flag that indicates if conflicts must be avoided.
Definition: Chart.h:130