HistogramDataWidget.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/HistogramDataWidget.h
22 
23  \brief A widget used to adjust a histogram's input data.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_HISTOGRAMDATAWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_HISTOGRAMDATAWIDGET_H
28 
29 //TerraLib
30 #include "../Config.h"
31 
32 // Qt
33 #include <QWidget>
34 
35 //STL
36 #include <memory>
37 
38 namespace Ui { class HistogramDataWidgetForm; }
39 
40 namespace te
41 {
42  //forward declarations
43  namespace da { class DataSet; class DataSetType; }
44 
45  namespace qt
46  {
47  namespace widgets
48  {
49 
50  //forward declarations
51  class Histogram;
52  class ChartDisplay;
53 
54  /*!
55  \class HistogramDataWidget
56 
57  \brief A widget used to adjust a histogram's input data.
58  */
59  class TEQTWIDGETSEXPORT HistogramDataWidget : public QWidget
60  {
61 
62  Q_OBJECT
63 
64  public:
65 
66  /*!
67  \brief Constructor
68 
69  \param dataSet The dataset that will be used to generate a histogram.
70  \param dataType The dataset that will be used to generate a histogram.
71  \param parent this widget's parent
72  \param f Window flags used to configure this widget
73  */
74  HistogramDataWidget(te::da::DataSet* dataSet, te::da::DataSetType* dataType, QWidget* parent = 0, Qt::WindowFlags f = 0);
75 
76  /*!
77  \brief Destructor
78  */
80 
81  /*!
82  \brief Returns a pointer to the widget's form
83 
84  \return A HistogramDataWidgetForm type pointer to the widget's form.
85  \note The caller will not take ownership of the returned pointer.
86  */
87  Ui::HistogramDataWidgetForm* getForm();
88 
89  /*!
90  \brief Returns a pointer to the widget's form
91 
92  \return A HistogramDataWidgetForm type pointer to the widget's form.
93  \note The caller will take ownership of the returned pointer.
94  */
95  te::qt::widgets::Histogram* getHistogram();
96 
97  /*!
98  \brief Sets the property to be used in order to generate the histogram
99 
100  \note This function is intented to prevent the user from selecting a property through this widget in special cases,
101  if that is not the intended behaviour, do not call this function.
102  */
103  void setHistogramProperty(int propId);
104 
105  /*!
106  \brief Returns the name of the chosen summary function. Default is None
107 
108  \return The name of the chosen summary function.
109  */
110  std::string getSummaryFunction();
111 
112  protected slots:
113 
114  void onPropertyComboBoxIndexChanged(QString text);
115 
116  private:
117 
118  std::auto_ptr<Ui::HistogramDataWidgetForm> m_ui; //!< The widget's form.
119  std::auto_ptr<te::da::DataSet> m_dataSet; //!< The dataset that will be used to generate the histogram graph.
120  std::auto_ptr<te::da::DataSetType> m_dataType; //!< The type of the dataset that will be used to generate the histogram graphic.
121  };
122  } // end namespace widgets
123  } // end namespace qt
124 } // end namespace te
125 
126 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_HISTOGRAMDATAWIDGET_H
A widget used to adjust a histogram's input data.
A class that models the description of a dataset.
Definition: DataSetType.h:72
std::auto_ptr< Ui::HistogramDataWidgetForm > m_ui
The widget's form.
A class to represent a Histogram.
Definition: Histogram.h:56
URI C++ Library.
std::auto_ptr< te::da::DataSet > m_dataSet
The dataset that will be used to generate the histogram graph.
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:112
#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< te::da::DataSetType > m_dataType
The type of the dataset that will be used to generate the histogram graphic.