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 
39 class QwtPlotSeriesItem;
40 
41 namespace Ui { class ChartDisplayWidgetForm; }
42 
43 namespace 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  */
62  class TEQTWIDGETSEXPORT ChartDisplayWidget : public QWidget
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  */
107  te::qt::widgets::ChartDisplay* getDisplay();
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  */
115  void setDisplay(te::qt::widgets::ChartDisplay* newDisplay);
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  */
124  void highlightOIds(const te::da::ObjectIdSet* oids, te::da::DataSetType* dataType);
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 Settings tool button.
138  */
139  void onSettingsToolButtonnClicked();
140 
141  /*!
142  \brief Called when objects were selected.
143  */
144  void selectionChanged(te::da::ObjectIdSet* oids, const bool& add);
145 
146  signals:
147 
148  /*!
149  \brief Emmit when objects were selected.
150  */
151  void selected(te::da::ObjectIdSet*, const bool&);
152 
153  private:
154 
155  std::auto_ptr<Ui::ChartDisplayWidgetForm> m_ui; //!< The widget form.
156  QwtPlotSeriesItem* m_chart; //!< The chart that will be plotted by this widget.
157  int m_type; //!< The type of the chart that will be plotted by this widget.
158  ChartDisplay* m_display; //!< The display that will be used to plot the chart.
159  };
160  } // end namespace widgets
161  } // end namespace qt
162 } // end namespace te
163 
164 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_CHARTDISPLAYWIDGET_H
A class that models the description of a dataset.
Definition: DataSetType.h:72
QwtPlotSeriesItem * m_chart
The chart that will be plotted by this widget.
ChartDisplay * m_display
The display that will be used to plot the chart.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
Definition: ObjectIdSet.h:55
URI C++ Library.
A class to represent a chart display.
Definition: ChartDisplay.h:65
int m_type
The type of the chart that will be plotted by this widget.
A wdiget used to display a chart.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
std::auto_ptr< Ui::ChartDisplayWidgetForm > m_ui
The widget form.