Loading...
Searching...
No Matches
ChartDisplay.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/ChartDisplay.h
22
23 \brief A class to represent a chart display
24*/
25
26#ifndef __TERRALIB_QT_WIDGETS_INTERNAL_CHARTDISPLAY_H
27#define __TERRALIB_QT_WIDGETS_INTERNAL_CHARTDISPLAY_H
28
29//TerraLib
30#include "../Config.h"
31
32//QWT
33#include <qwt_plot.h>
34
35//STL
36#include <string>
37
38//QWT Forward declarations
39class QwtPlotGrid;
40class QwtPlotPanner;
41class QwtPlotPicker;
42class QwtPlotMagnifier;
43
44namespace te
45{
46 namespace color { class RGBAColor; }
47 namespace da { class ObjectIdSet; class DataSetType;}
48 namespace se { class Stroke; class Fill; class Font; }
49
50 namespace qt
51 {
52 namespace widgets
53 {
54
55 //Forward declaration
56 class ChartStyle;
57
58 /*!
59 \class ChartDisplay
60
61 \brief A class to represent a chart display
62
63 \ingroup widgets
64 */
65 class TEQTWIDGETSEXPORT ChartDisplay : public QwtPlot
66 {
67
68 Q_OBJECT
69
70 public:
71
72 /*!
73 \brief Constructor
74
75 It constructs a ChartDisplay with the given title and style.
76
77 \param parent this widget's parent
78 \param title this widget's title.
79
80 \note it will take the ownership of the pointer "style". If style is null, the display will be constructed with a default style.
81 */
82 ChartDisplay(QWidget* parent=NULL, QString title = "", ChartStyle* style = 0);
83
84 /*!
85 \brief Destructor
86 */
88
89 /*!
90 \brief Returns a pointer to the display's style
91
92 \return A ChartStyle type pointer to the display's style.
93 \note The caller will not take ownership of the returned pointer.
94 */
96
97 /*!
98 \brief It sets the display's style
99
100 \param newStyle The new style.
101 \note It will take ownership of the given pointer
102 */
104
105 /*!
106 \brief Highlights the objects identified by \a oids
107
108 \param oids The identifiers of plotitems to be highlighted.
109 */
111
112 /*!
113 \brief color used to hgihlight selected objects on this display.
114
115 \param selColor The color used to hgihlight selected objects on this display.
116
117 */
118 void setSelectionColor(QColor selColor);
119
120 /*!
121 \brief Updates the general display settings according to the ChartStyle.
122 The adjusted properties are:
123 Title;
124 Axis titles (x and Y);
125 Weather to display the grid or not;
126 Background color;
127 */
129
130 /*!
131 \brief Enables or disables all the tools used to execute certain mouse actions.
132 Such as selection, pan and zoomn;
133 */
134 void enableTools(bool enabled);
135
136 /*!
137 \brief Enables or disables the tools used to execute selection functions.
138 */
139 void enablePickers(bool enabled);
140
141 /*!
142 \brief Enables or disables the tool used to execute the selection functions.
143 */
144 void enableLeftPicker(bool enabled);
145
146 /*!
147 \brief Enables or disables the tool used to execute the multi selection functions.
148 */
149 void enableMultiSelection(bool enabled);
150
151 /*!
152 \brief Enables or disables the tool used to execute zoom functions.
153 */
154 void enableMagnifier(bool enabled);
155
156 /*!
157 \brief Enables or disables the tool used to execute pan functions.
158 */
159 void enablePan(bool enabled);
160
161 /*!
162 \brief Enables or disables the pickers used tbroadcast point selection signals.
163 */
164 void enablePointPickers(bool enabled);
165
166 protected slots:
167
168 /*!
169 \brief Called when the user selects an area of the canvas.
170 Will highlight the data, if possible, depending on the type of chart being displayed (f.e. histogram, scatter, etc).
171 */
172 void onRectPicked(const QRectF &rect);
173
174 signals:
175
176 /*!
177 \brief Emmit when objects were selected.
178 */
179 void selected(te::da::ObjectIdSet*, const bool&);
180
181 /*!
182 \brief Emmit when a clicked with left button was made.
183 */
184 void leftPointSelected(const QPointF& pos);
185
186 /*!
187 \brief Emmit when a clicked with rigth button was made.
188 */
189 void rigthPointSelected(const QPointF& pos);
190
191 private:
192
193 ChartStyle* m_chartStyle; //!< The display's style.
194 QwtPlotGrid* m_grid; //!< The display's grid
195 QwtPlotPanner* m_panner; //!< The display's panner.
196 QwtPlotPicker* m_leftPicker; //!< The display's left button picker.
197 QwtPlotPicker* m_leftPointPicker; //!< The display's left button picker.
198 QwtPlotPicker* m_rigthPointPicker; //!< The display's rigth button picker.
199 QwtPlotMagnifier* m_magnifier; //!< The display's magnifinifier.
200 QwtPlotPicker* m_ctrlPicker; //!< The display's control button picker.
201 QwtPlotPicker* m_shiftPicker; //!< The display's shift button picker.
202 };
203 } // end namespace widgets
204 } // end namespace qt
205} // end namespace te
206
207#endif // __TERRALIB_QT_WIDGETS_INTERNAL_CHARTDISPLAY_H
208
A class that models the description of a dataset.
Definition: DataSetType.h:73
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 chart display.
Definition: ChartDisplay.h:66
QwtPlotPicker * m_leftPicker
The display's left button picker.
Definition: ChartDisplay.h:196
QwtPlotPicker * m_leftPointPicker
The display's left button picker.
Definition: ChartDisplay.h:197
void enableMultiSelection(bool enabled)
Enables or disables the tool used to execute the multi selection functions.
void adjustDisplay()
Updates the general display settings according to the ChartStyle. The adjusted properties are: Title;...
void setSelectionColor(QColor selColor)
color used to hgihlight selected objects on this display.
QwtPlotGrid * m_grid
The display's grid.
Definition: ChartDisplay.h:194
void enablePickers(bool enabled)
Enables or disables the tools used to execute selection functions.
void setStyle(te::qt::widgets::ChartStyle *newStyle)
It sets the display's style.
void enableLeftPicker(bool enabled)
Enables or disables the tool used to execute the selection functions.
QwtPlotPanner * m_panner
The display's panner.
Definition: ChartDisplay.h:195
void enableMagnifier(bool enabled)
Enables or disables the tool used to execute zoom functions.
void enablePointPickers(bool enabled)
Enables or disables the pickers used tbroadcast point selection signals.
void onRectPicked(const QRectF &rect)
Called when the user selects an area of the canvas. Will highlight the data, if possible,...
ChartDisplay(QWidget *parent=NULL, QString title="", ChartStyle *style=0)
Constructor.
QwtPlotPicker * m_rigthPointPicker
The display's rigth button picker.
Definition: ChartDisplay.h:198
void rigthPointSelected(const QPointF &pos)
Emmit when a clicked with rigth button was made.
void leftPointSelected(const QPointF &pos)
Emmit when a clicked with left button was made.
void enableTools(bool enabled)
Enables or disables all the tools used to execute certain mouse actions. Such as selection,...
QwtPlotPicker * m_shiftPicker
The display's shift button picker.
Definition: ChartDisplay.h:201
void highlightOIds(const te::da::ObjectIdSet *oids, te::da::DataSetType *dataType)
Highlights the objects identified by oids.
QwtPlotMagnifier * m_magnifier
The display's magnifinifier.
Definition: ChartDisplay.h:199
void selected(te::da::ObjectIdSet *, const bool &)
Emmit when objects were selected.
te::qt::widgets::ChartStyle * getStyle()
Returns a pointer to the display's style.
void enablePan(bool enabled)
Enables or disables the tool used to execute pan functions.
QwtPlotPicker * m_ctrlPicker
The display's control button picker.
Definition: ChartDisplay.h:200
ChartStyle * m_chartStyle
The display's style.
Definition: ChartDisplay.h:193
TerraLib.
#define slots
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63