Loading...
Searching...
No Matches
ChartDisplayWidget.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/ChartDisplayWidget.h
22
23 \brief A widget used to display a set of charts.
24*/
25
26#ifndef __TERRALIB_QT_WIDGETS_INTERNAL_CHARTDISPLAYWIDGET_H
27#define __TERRALIB_QT_WIDGETS_INTERNAL_CHARTDISPLAYWIDGET_H
28
29//TerraLib
30#include "../Config.h"
31#include "Enums.h"
32
33// Qt
34#include <QWidget>
35
36//STL
37#include <memory>
38
39class QwtPlotSeriesItem;
40
41namespace Ui { class ChartDisplayWidgetForm; }
42
43namespace te
44{
45
46 namespace da { class ObjectIdSet; class DataSetType;}
47 namespace qt
48 {
49 namespace widgets
50 {
51
52 //forward declarations
53 class ChartDisplay;
54
55 /*!
56 \class ChartDisplayWidget
57
58 \brief A wdiget used to display a chart
59
60 \ingroup widgets
61 */
63 {
64
65 Q_OBJECT
66
67 public:
68
69 /*!
70 \brief Constructor
71
72 \param chart The chart that will be displayed by this widget.
73 \param display The display that will be used by this widget to display the chart
74 \param parent this widget's parent
75 \param f Window flags used to configure this widget
76 */
77 ChartDisplayWidget(QwtPlotSeriesItem* chart, int type, te::qt::widgets::ChartDisplay* display, QWidget* parent = 0, Qt::WindowFlags f = 0);
78
79
80 /*!
81 \brief Destructor
82 */
84
85 /*!
86 \brief Returns a pointer to the chart being displayed.
87
88 \return A QwtPlotSeriesItem type pointer to the chart being used.
89 \note The caller will not take ownership of the returned pointer.
90 */
91 QwtPlotSeriesItem* getChart();
92
93 /*!
94 \brief It sets the chart that will be displayed
95.
96 \param newChart The new chart.
97 \note It will take ownership of the given pointer
98 */
99 void setChart(QwtPlotSeriesItem* newChart);
100
101 /*!
102 \brief Returns a pointer to the display being used.
103
104 \return A ChartDisplay type pointer to the display being used.
105 \note The caller will not take ownership of the returned pointer.
106 */
108
109 /*!
110 \brief It sets the display that will be used
111.
112 \param newDisplay The new display.
113 \note It will take ownership of the given pointer
114 */
116
117 int getType();
118
119 /*!
120 \brief Highlights the objects identified by \a oids
121
122 \param oids The identifiers of plotitems to be highlighted.
123 */
125
126 /*!
127 \brief color used to hgihlight selected objects on this display.
128
129 \param selColor The color used to hgihlight selected objects on this display.
130
131 */
132 void setSelectionColor(QColor selColor);
133
134 protected slots:
135
136 /*!
137 \brief Called when the user clicks on the export tool button.
138 */
140
141 /*!
142 \brief Called when the user clicks on the Settings tool button.
143 */
145
146 /*!
147 \brief Called when objects were selected.
148 */
149 void selectionChanged(te::da::ObjectIdSet* oids, const bool& add);
150
151 signals:
152
153 /*!
154 \brief Emmit when objects were selected.
155 */
156 void selected(te::da::ObjectIdSet*, const bool&);
157
158 private:
159
160 std::unique_ptr<Ui::ChartDisplayWidgetForm> m_ui; //!< The widget form.
161 QwtPlotSeriesItem* m_chart; //!< The chart that will be plotted by this widget.
162 int m_type; //!< The type of the chart that will be plotted by this widget.
163 ChartDisplay* m_display; //!< The display that will be used to plot the chart.
164 };
165 } // end namespace widgets
166 } // end namespace qt
167} // end namespace te
168
169#endif // __TERRALIB_QT_WIDGETS_INTERNAL_CHARTDISPLAYWIDGET_H
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 wdiget used to display a chart.
void onSettingsToolButtonnClicked()
Called when the user clicks on the Settings tool button.
void onExportToolButtonnClicked()
Called when the user clicks on the export tool button.
te::qt::widgets::ChartDisplay * getDisplay()
Returns a pointer to the display being used.
void setChart(QwtPlotSeriesItem *newChart)
void selected(te::da::ObjectIdSet *, const bool &)
Emmit when objects were selected.
QwtPlotSeriesItem * getChart()
Returns a pointer to the chart being displayed.
int m_type
The type of the chart that will be plotted by this widget.
void setDisplay(te::qt::widgets::ChartDisplay *newDisplay)
void setSelectionColor(QColor selColor)
color used to hgihlight selected objects on this display.
std::unique_ptr< Ui::ChartDisplayWidgetForm > m_ui
The widget form.
void highlightOIds(const te::da::ObjectIdSet *oids, te::da::DataSetType *dataType)
Highlights the objects identified by oids.
ChartDisplayWidget(QwtPlotSeriesItem *chart, int type, te::qt::widgets::ChartDisplay *display, QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
void selectionChanged(te::da::ObjectIdSet *oids, const bool &add)
Called when objects were selected.
ChartDisplay * m_display
The display that will be used to plot the chart.
QwtPlotSeriesItem * m_chart
The chart that will be plotted by this widget.
A class to represent a chart display.
Definition: ChartDisplay.h:66
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
Enumerations of XML module.