Loading...
Searching...
No Matches
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// QT
33#include <qcolor.h>
34
35//QWT
36#include <qwt_plot_curve.h>
37
38//STL
39#include <vector>
40#include <set>
41
42namespace te
43{
44
45 namespace da { class ObjectIdSet; }
46 namespace st { class TimeSeries; }
47 namespace qt
48 {
49 namespace widgets
50 {
51 // Forward declarations
52 class TimeSeriesStyle;
53
54 /*!
55 \class TimeSeriesChart
56
57 \brief A class to represent a timeSeries chart.
58 */
59 class TEQTWIDGETSEXPORT TimeSeriesChart : public QwtPlotCurve
60 {
61 public:
62
63 /*!
64 \brief Constructor
65
66 It constructs a TimeSeres chart with a default style.
67
68 \note It will take the ownership of the pointers.
69 \note it will construct a chart with a default style.
70 */
72
73 /*!
74 \brief Constructor
75
76 \note It will take the ownership of the pointer "style".
77 \note It will take the ownership of the pointer "data".
78 */
80
81 /*! \brief Destructor. */
83
84 /*! \brief Returns the chart's type. */
85 virtual int rtti() const;
86
87 /*!
88 \brief It atttaches a QwtPlot to this Cahrt
89
90 \param plot The QwtPlot that will be attached to this chart.
91 */
92 void attach(QwtPlot* plot);
93
94 /*!
95 \brief It returns the chart's timeSeries.
96
97 \return The chart's timeSeries.
98 */
100
101 /*!
102 \brief It sets the chart's timeSeries.
103
104 \param newHistogram The chart's new scatter.
105 \note It will take the ownership of the pointer "newScatter".
106 */
107 void setTimeSeries(te::st::TimeSeries* newTimeSeries);
108
109 /*!
110 \brief Returns a clone of the pointer to the timeSeries' style
111
112 \return A ScatterStyle type pointer to the timeSeries' style.
113 \note The caller will take ownership of the returned pointer.
114 */
116
117 /*!
118 \brief It sets the chart's style.
119
120 \param newStyle The chart's new style.
121 \note It will take the ownership of the pointer "newStyle".
122 */
124
125 /*!
126 \brief It sets the date format that will be used on the labels.
127
128 The default format strings are:
129
130 - Millisecond :hh:mm:ss:zzz\nddd dd MMM yyyy
131 - Second: hh:mm:ss\nddd dd MMM yyyy
132 - Minute: hh:mm\nddd dd MMM yyyy
133 - Hour: hh:mm\nddd dd MMM yyyy
134 - Day: ddd dd MMM yyyy
135 - Week Www yyyy
136 - Month: MMM yyyy
137 - Year: yyyy
138 */
139 void setDateFormat(std::string dateFormat);
140
141 void setData();
142
143 private:
144 te::st::TimeSeries* m_timeSeries; //!< The scatter that will be shown on this chart.
145 std::set<std::string> m_dates; //!< The dates that will be plotted on the X axis.
146 TimeSeriesStyle* m_timeSeriesStyle; //!< The symbol that defines the look of a scatter's point.
147 QColor m_selColor; //!< The color used to highlight selected obecjts.
148 };
149 } // end namespace widgets
150 } // end namespace qt
151} // end namespace te
152
153
154#endif // __TERRALIB_QT_WIDGETS_INTERNAL_TIMESERIESCHART_H
A class to represent a timeSeries chart.
te::st::TimeSeries * getTimeSeries()
It returns the chart's timeSeries.
void attach(QwtPlot *plot)
It atttaches a QwtPlot to this Cahrt.
void setTimeSeries(te::st::TimeSeries *newTimeSeries)
It sets the chart's timeSeries.
void setTimeSeriesStyle(TimeSeriesStyle *newStyle)
It sets the chart's style.
virtual int rtti() const
Returns the chart's type.
std::set< std::string > m_dates
The dates that will be plotted on the X axis.
TimeSeriesStyle * getTimeSeriesStyle()
Returns a clone of the pointer to the timeSeries' style.
TimeSeriesChart(te::st::TimeSeries *data, TimeSeriesStyle *style, size_t size)
Constructor.
TimeSeriesStyle * m_timeSeriesStyle
The symbol that defines the look of a scatter's point.
TimeSeriesChart(te::st::TimeSeries *data)
Constructor.
QColor m_selColor
The color used to highlight selected obecjts.
void setDateFormat(std::string dateFormat)
It sets the date format that will be used on the labels.
te::st::TimeSeries * m_timeSeries
The scatter that will be shown on this chart.
A class to represent time series.
Definition TimeSeries.h:67
TerraLib.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition Config.h:63