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
42
namespace
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
*/
71
TimeSeriesChart
(
te::st::TimeSeries
* data);
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
*/
79
TimeSeriesChart
(
te::st::TimeSeries
* data,
TimeSeriesStyle
* style,
size_t
size);
80
81
/*! \brief Destructor. */
82
~TimeSeriesChart
();
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
*/
99
te::st::TimeSeries
*
getTimeSeries
();
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
*/
115
TimeSeriesStyle
*
getTimeSeriesStyle
();
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
*/
123
void
setTimeSeriesStyle
(
TimeSeriesStyle
* newStyle);
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
te::qt::widgets::TimeSeriesChart
A class to represent a timeSeries chart.
Definition
TimeSeriesChart.h:60
te::qt::widgets::TimeSeriesChart::setData
void setData()
te::qt::widgets::TimeSeriesChart::getTimeSeries
te::st::TimeSeries * getTimeSeries()
It returns the chart's timeSeries.
te::qt::widgets::TimeSeriesChart::attach
void attach(QwtPlot *plot)
It atttaches a QwtPlot to this Cahrt.
te::qt::widgets::TimeSeriesChart::setTimeSeries
void setTimeSeries(te::st::TimeSeries *newTimeSeries)
It sets the chart's timeSeries.
te::qt::widgets::TimeSeriesChart::setTimeSeriesStyle
void setTimeSeriesStyle(TimeSeriesStyle *newStyle)
It sets the chart's style.
te::qt::widgets::TimeSeriesChart::rtti
virtual int rtti() const
Returns the chart's type.
te::qt::widgets::TimeSeriesChart::~TimeSeriesChart
~TimeSeriesChart()
Destructor.
te::qt::widgets::TimeSeriesChart::m_dates
std::set< std::string > m_dates
The dates that will be plotted on the X axis.
Definition
TimeSeriesChart.h:145
te::qt::widgets::TimeSeriesChart::getTimeSeriesStyle
TimeSeriesStyle * getTimeSeriesStyle()
Returns a clone of the pointer to the timeSeries' style.
te::qt::widgets::TimeSeriesChart::TimeSeriesChart
TimeSeriesChart(te::st::TimeSeries *data, TimeSeriesStyle *style, size_t size)
Constructor.
te::qt::widgets::TimeSeriesChart::m_timeSeriesStyle
TimeSeriesStyle * m_timeSeriesStyle
The symbol that defines the look of a scatter's point.
Definition
TimeSeriesChart.h:146
te::qt::widgets::TimeSeriesChart::TimeSeriesChart
TimeSeriesChart(te::st::TimeSeries *data)
Constructor.
te::qt::widgets::TimeSeriesChart::m_selColor
QColor m_selColor
The color used to highlight selected obecjts.
Definition
TimeSeriesChart.h:147
te::qt::widgets::TimeSeriesChart::setDateFormat
void setDateFormat(std::string dateFormat)
It sets the date format that will be used on the labels.
te::qt::widgets::TimeSeriesChart::m_timeSeries
te::st::TimeSeries * m_timeSeries
The scatter that will be shown on this chart.
Definition
TimeSeriesChart.h:144
te::qt::widgets::TimeSeriesStyle
Definition
TimeSeriesStyle.h:50
te::st::TimeSeries
A class to represent time series.
Definition
TimeSeries.h:67
te
TerraLib.
Definition
AddressGeocodingOp.h:52
TEQTWIDGETSEXPORT
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition
Config.h:63
git_release
src
terralib
qt
widgets
charts
TimeSeriesChart.h
Generated on Tue Dec 3 2024 11:28:29 for TerraLib by
1.9.7