ChartConfigurer.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 terralib/qt/widgets/charts/ChartConfigurer.h
22 
23  \brief A Symbology Enconding visitor that configures a given chart based on symbolizer elements.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_CHARTCONFIGURER_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_CHARTCONFIGURER_H
28 
29 // TerraLib
30 #include "../../../se/Visitor.h"
31 #include "../Config.h"
32 #include "ChartDisplayWidget.h"
33 #include "Enums.h"
34 
35 // Boost
36 #include <boost/noncopyable.hpp>
37 
38 namespace te
39 {
40  // Forward declarations
41  namespace map { class AbstractLayer; }
42 
43  namespace se
44  {
45  class Fill;
46  class Graphic;
47  class GraphicStroke;
48  class Stroke;
49  }
50 
51  namespace qt
52  {
53  namespace widgets
54  {
55 
56  /*!
57  \class ChartConfigurer
58 
59  \brief A Symbology Enconding visitor that configures a given chart based on symbolizers elements.
60  If you want to use this visitor, use a command like:
61  <code>
62  te::qt::widgets::ChartConfigurer cc(chart);
63  cc.config(symbolizer);
64  </code>
65 
66  \sa te::se::Visitor
67  */
68  class TEQTWIDGETSEXPORT ChartConfigurer : public te::se::Visitor, public boost::noncopyable
69  {
70  public:
71 
72  /** @name Initializer Methods
73  */
74  //@{
75 
76  /*!
77  \brief Constructor.
78 
79  \param chart A pointer to the chart that will be configured.
80 
81  \note This class will not take the ownership of the given chart.
82  */
84 
85  /*! \brief Destructor. */
86  ~ChartConfigurer();
87 
88  //@}
89 
90  /** @name Config Method
91  * Method that can be used to configure a chart based on Symbology Enconding symbolizer elements.
92  */
93  //@{
94 
95  /*!
96  \brief It configs the chart based on given symbolizer.
97 
98  \param symbolizer The symbolizer that will be used to config the chart.
99  */
100  void config(const te::se::Symbolizer* symbolizer);
101 
102  /*!
103  \brief It configs the chart based on given layer.
104 
105  \param layer The layer that will be used to config the chart.
106 
107  \note This function will simply use the first rule and symbolizer of the given layer.
108  */
109  void config(te::map::AbstractLayer* layer);
110 
111  //@}
112 
113  /** @name Visitor Methods
114  * All concrete visitors must implement these methods.
115  */
116  //@{
117 
118  void visit(const te::se::Style& visited);
119  void visit(const te::se::FeatureTypeStyle& visited);
120  void visit(const te::se::CoverageStyle& visited);
121  void visit(const te::se::Symbolizer& visited);
122  void visit(const te::se::PolygonSymbolizer& visited);
123  void visit(const te::se::LineSymbolizer& visited);
124  void visit(const te::se::PointSymbolizer& visited);
125  void visit(const te::se::TextSymbolizer& visited);
126  void visit(const te::se::RasterSymbolizer& visited);
127 
128  //@}
129 
130  private:
131 
132  /*!
133  \brief Internal method that configs the chart based on given Stroke element.
134 
135  \param stroke The Stroke element that will be used to config the chart.
136  */
137  void config(const te::se::Stroke* stroke);
138 
139  /*!
140  \brief Internal method that configs the chart based on given Fill element.
141 
142  \param fill The Fill element that will be used to config the chart.
143  */
144  void config(const te::se::Fill* fill);
145 
146  /*!
147  \brief Internal method that configs the chart based on given Graphic element.
148 
149  \param graphic The Graphic element that will be used to config the chart.
150  */
151  void config(const te::se::Graphic* graphic);
152 
153  private:
154 
155  ChartDisplayWidget* m_chart; //!< A pointer to the chart that will be configured.
156 
157  };
158 
159  } // end namespace widgets
160  } // end namespace qt
161 } // end namespace te
162 
163 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_CHARTCONFIGURER_H
A TextSymbolizer is used to render text labels according to various graphical parameters.
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Definition: Style.h:65
This is the base class for layers.
Definition: AbstractLayer.h:76
ChartDisplayWidget * m_chart
A pointer to the chart that will be configured.
A PolygonSymbolizer is used to draw a polygon (or other area-type geometries), including filling its ...
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
The CoverageStyle defines the styling that is to be applied to a subset of Coverage data...
Definition: CoverageStyle.h:45
A PointSymbolizer specifies the rendering of a graphic Symbolizer at a point.
A visitor interface for the SymbologyEncoding hierarchy.
Definition: Visitor.h:41
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
Definition: Graphic.h:66
A Symbology Enconding visitor that configures a given chart based on symbolizers elements. If you want to use this visitor, use a command like: te::qt::widgets::ChartConfigurer cc(chart); cc.config(symbolizer);
The FeatureTypeStyle defines the styling that is to be applied to a dataset that can be viewed as a f...
URI C++ Library.
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
A Fill specifies the pattern for filling an area geometry.
Definition: Fill.h:59
A wdiget used to display a chart.
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:67
A widget used to display a set of charts.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line seg...