TimeSeriesChart.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/TimeSeriesChart.h
22 
23  \brief A class to represent a timeSeries' chart.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_TIMESERIESCHART_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_TIMESERIESCHART_H
28 
29 //TerraLib
30 #include "../Config.h"
31 
32 //QWT
33 #include <qwt_plot_curve.h>
34 
35 //STL
36 #include <vector>
37 
38 namespace te
39 {
40 
41  namespace da { class ObjectIdSet; }
42  namespace st { class TimeSeries; }
43  namespace qt
44  {
45  namespace widgets
46  {
47  // Forward declarations
48  class TimeSeriesStyle;
49  class StringScaleDraw;
50 
51  /*!
52  \class TimeSeriesChart
53 
54  \brief A class to represent a timeSeries chart.
55  */
56  class TEQTWIDGETSEXPORT TimeSeriesChart : public QwtPlotCurve
57  {
58  public:
59 
60  /*!
61  \brief Constructor
62 
63  It constructs a TimeSeres chart with a default style.
64 
65  \note It will take the ownership of the pointers.
66  \note it will construct a chart with a default style.
67  */
69 
70  /*!
71  \brief Constructor
72 
73  \note It will take the ownership of the pointer "style".
74  \note It will take the ownership of the pointer "data".
75  */
76  TimeSeriesChart(te::st::TimeSeries* data, TimeSeriesStyle* style, size_t size);
77 
78  /*! \brief Destructor. */
79  ~TimeSeriesChart();
80 
81  /*! \brief Returns the chart's type. */
82  virtual int rtti() const;
83 
84  /*!
85  \brief It returns the chart's scale draw.
86 
87  \return The chart's scale draw.
88  \note The caller will not take ownership of the returned pointer.
89  */
90 
91  StringScaleDraw* getScaleDraw();
92 
93  /*!
94  \brief It sets the chart's scale draw.
95 
96  \param new_labels The new chart's scale draw.
97  \note It will take the ownership of the pointer "newScaleDraw".
98  */
99 
100  void setScaleDraw( StringScaleDraw* newScaleDraw);
101 
102  /*!
103  \brief It atttaches a QwtPlot to this Cahrt
104 
105  \param plot The QwtPlot that will be attached to this chart.
106  */
107  void attach(QwtPlot* plot);
108 
109  /*!
110  \brief It returns the chart's timeSeries.
111 
112  \return The chart's timeSeries.
113  */
114  te::st::TimeSeries* getTimeSeries();
115 
116  /*!
117  \brief It sets the chart's timeSeries.
118 
119  \param newHistogram The chart's new scatter.
120  \note It will take the ownership of the pointer "newScatter".
121  */
122  void setTimeSeries(te::st::TimeSeries* newTimeSeries);
123 
124  /*!
125  \brief Returns a clone of the pointer to the timeSeries' style
126 
127  \return A ScatterStyle type pointer to the timeSeries' style.
128  \note The caller will take ownership of the returned pointer.
129  */
130  TimeSeriesStyle* getTimeSeriesStyle();
131 
132  /*!
133  \brief It sets the chart's style.
134 
135  \param newStyle The chart's new style.
136  \note It will take the ownership of the pointer "newStyle".
137  */
138  void setTimeSeriesStyle(TimeSeriesStyle* newStyle);
139 
140  void setData();
141 
142  private:
143  te::st::TimeSeries* m_timeSeries; //!< The scatter that will be shown on this chart.
144  StringScaleDraw* m_scaleDraw; //!< Scale draw that defines how a label will be displayed on this chart.
145  TimeSeriesStyle* m_timeSeriesStyle; //!< The symbol that defines the look of a scatter's point.
146  QColor m_selColor; //!< The color used to highlight selected obecjts.
147  };
148  } // end namespace widgets
149  } // end namespace qt
150 } // end namespace te
151 
152 
153 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_TIMESERIESCHART_H
StringScaleDraw * m_scaleDraw
Scale draw that defines how a label will be displayed on this chart.
URI C++ Library.
TimeSeriesStyle * m_timeSeriesStyle
The symbol that defines the look of a scatter's point.
QColor m_selColor
The color used to highlight selected obecjts.
A class to represent time series.
Definition: TimeSeries.h:66
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
te::st::TimeSeries * m_timeSeries
The scatter that will be shown on this chart.
A class to represent a timeSeries chart.