Loading...
Searching...
No Matches
ScatterChart.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/ScatterChart.h
22
23 \brief A class to represent a scatter's chart.
24*/
25
26#ifndef __TERRALIB_QT_WIDGETS_INTERNAL_SCATTERCHART_H
27#define __TERRALIB_QT_WIDGETS_INTERNAL_SCATTERCHART_H
28
29#include "../Config.h"
30
31#include "qcolor.h"
32
33#include <qwt_plot_curve.h>
34
35#include <vector>
36
37namespace te
38{
39
40 namespace da { class ObjectIdSet; }
41 namespace qt
42 {
43 namespace widgets
44 {
45 // Forward declarations
46 class Scatter;
47 class ScatterStyle;
48
49 /*!
50 \class ScatterChart
51
52 \brief A class to represent a scatter chart.
53 */
54 class TEQTWIDGETSEXPORT ScatterChart : public QwtPlotCurve
55 {
56 public:
57
58 /*!
59 \brief Constructor
60
61 It constructs a scatter chart with a default mark and size.
62
63 \note It will take the ownership of the pointers.
64 \note it will construct a chart with a default style.
65 */
67
68 /*!
69 \brief Constructor
70
71 \note It will take the ownership of the pointer "style".
72 \note It will take the ownership of the pointer "data".
73 */
74 ScatterChart(Scatter* data, ScatterStyle* style, size_t size);
75
76 /*! \brief Destructor. */
78
79 /*! \brief Returns the chart's type. */
80 virtual int rtti() const;
81
82 /*!
83 \brief It returns the chart's scatter.
84
85 \return The chart's scatter.
86 */
88
89 /*!
90 \brief It sets the chart's scatter.
91
92 \param newHistogram The chart's new scatter.
93 \note It will take the ownership of the pointer "newScatter".
94 */
96
97 /*!
98 \brief Returns a clone of the pointer to the scatter's style
99
100 \return A ScatterStyle type pointer to the scatter's style.
101 \note The caller will take ownership of the returned pointer.
102 */
104
105 /*!
106 \brief It sets the chart's style.
107
108 \param newStyle The chart's new style.
109 \note It will take the ownership of the pointer "newStyle".
110 */
112
113 /*!
114 \brief Highlights the objects identified by \a oids
115
116 \param oids The identifiers of plotitems to be highlighted.
117 */
119
120 /*!
121 \brief Highlights the intervals identified by \a point
122
123 \param point The point to be highlighted.
124 */
126
127 /*!
128 \brief Highlights the intervals contained by \a rectangle
129
130 \param rect The rectangle containing the intervals to be highlighted.
131 */
133
134 /*!
135 \brief color used to hgihlight selected objects on this chart.
136
137 \param selColor The color used to hgihlight selected objects on this chart.
138
139 */
140 void setSelectionColor(QColor selColor);
141
142 void setData();
143
144 private:
145 Scatter* m_scatter; //!< The scatter that will be shown on this chart.
146 ScatterStyle* m_scatterStyle; //!< The symbol that defines the look of a scatter's point.
147 QColor m_selColor; //!< The color used to highlight selected obecjts.
148 QwtPlotCurve* m_selection; //!< The PlotItems to be highlighted when a selection occurs;
149 };
150 } // end namespace widgets
151 } // end namespace qt
152} // end namespace te
153
154#endif // __TERRALIB_QT_WIDGETS_INTERNAL_SCATTERCHART_H
155
This class represents a set of unique ids created in the same context. i.e. from the same data set.
Definition ObjectIdSet.h:56
A class to represent a scatter chart.
QColor m_selColor
The color used to highlight selected obecjts.
void setScatter(te::qt::widgets::Scatter *newScatter)
It sets the chart's scatter.
te::qt::widgets::Scatter * getScatter()
It returns the chart's scatter.
te::da::ObjectIdSet * highlight(QRectF rect)
Highlights the intervals contained by rectangle.
QwtPlotCurve * m_selection
The PlotItems to be highlighted when a selection occurs;.
void setScatterStyle(ScatterStyle *newStyle)
It sets the chart's style.
virtual int rtti() const
Returns the chart's type.
ScatterStyle * m_scatterStyle
The symbol that defines the look of a scatter's point.
te::da::ObjectIdSet * highlight(QPointF point)
Highlights the intervals identified by point.
Scatter * m_scatter
The scatter that will be shown on this chart.
void setSelectionColor(QColor selColor)
color used to hgihlight selected objects on this chart.
ScatterChart(Scatter *data)
Constructor.
ScatterStyle * getScatterStyle()
Returns a clone of the pointer to the scatter's style.
ScatterChart(Scatter *data, ScatterStyle *style, size_t size)
Constructor.
void highlight(const te::da::ObjectIdSet *oids)
Highlights the objects identified by oids.
A class to represent a scatter.
Definition Scatter.h:52
TerraLib.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition Config.h:63