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