All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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  private:
116 
117  ChartType m_type; //!< The chart type.
118  std::vector<std::string> m_properties; //!< The property names that will be used to generate the chart.
119  std::vector<te::color::RGBAColor> m_colors; //!< The color used to each property.
120  te::color::RGBAColor m_contourColor; //!< The chart contour color.
121  std::size_t m_contourWidth; //!< The chart contour width (in pixels).
122  std::size_t m_height; //!< The chart height (in pixels).
123  std::size_t m_barWidth; //!< The bar width for char Bar type (in pixels).
124  bool m_isVisible; //!< A flag that indicates if the chart is visible.
125  double m_maxValue; //!< The max value of the chart.
126  };
127 
128  } // end namespace map
129 } // end namespace te
130 
131 #endif // __TERRALIB_MAPTOOLS_INTERNAL_CHART_H
te::color::RGBAColor m_contourColor
The chart contour color.
Definition: Chart.h:120
#define TEMAPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:98
std::size_t m_contourWidth
The chart contour width (in pixels).
Definition: Chart.h:121
std::vector< std::string > m_properties
The property names that will be used to generate the chart.
Definition: Chart.h:118
double m_maxValue
The max value of the chart.
Definition: Chart.h:125
std::size_t m_barWidth
The bar width for char Bar type (in pixels).
Definition: Chart.h:123
ChartType
The chart types.
Definition: Enums.h:163
ChartType m_type
The chart type.
Definition: Chart.h:117
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
std::size_t m_height
The chart height (in pixels).
Definition: Chart.h:122
bool m_isVisible
A flag that indicates if the chart is visible.
Definition: Chart.h:124
std::vector< te::color::RGBAColor > m_colors
The color used to each property.
Definition: Chart.h:119
This class represents the informations needed to build map charts.
Definition: Chart.h:51