RasterHistogramWidget.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/rp/RasterHistogramWidget.h
22 
23  \brief This file has the RasterHistogramWidget class.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_CANVAS_INTERNAL_RASTERHISTOGRAMWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_CANVAS_INTERNAL_RASTERHISTOGRAMWIDGET_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../maptools/AbstractLayer.h"
32 #endif
33 #include "../Config.h"
34 
35 // STL
36 #include <memory>
37 
38 // Qt
39 #include <QWidget>
40 
41 //QWT
42 #include <qwt_plot_marker.h>
43 
44 namespace Ui { class RasterHistogramWidgetForm; }
45 
46 namespace te
47 {
48  namespace rst { class Raster; }
49 
50  namespace qt
51  {
52  namespace widgets
53  {
54  class ChartStyle;
55  class ChartDisplay;
56  class Histogram;
57  class HistogramChart;
58  /*!
59  \class RasterHistogramWidget
60 
61  \brief This class is used to define a component for viewing overlaid layers.
62  */
64  {
65  Q_OBJECT
66 
67  public:
68 
69  RasterHistogramWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
70 
72 
73  Ui::RasterHistogramWidgetForm* getForm() const;
74 
75  void setChartInputColor(int red, int green, int blue);
76 
77  void setEnableTools(bool enable);
78 
79  void setInputRaster(te::rst::Raster* raster);
80 
81  void setOutputRaster(te::rst::Raster* raster);
82 
83  void drawHistogram(int band);
84 
85  void setMinimumValueEnabled(bool enable);
86 
87  void updateMinimumValueLine(int value, bool replot = false);
88 
89  void updateMinimumValueLabel(QString value);
90 
91  void setMaximumValueEnabled(bool enable);
92 
93  void updateMaximumValueLine(int value, bool replot = false);
94 
95  void updateMaximumValueLabel(QString value);
96 
97  void clear();
98 
99  protected slots:
100 
101  void onApplyToolButtonClicked();
102 
103  void onLeftPointSelected(const QPointF& point);
104 
105  void onRigthPointSelected(const QPointF& point);
106 
107  signals:
108 
109  void minValueSelected(int value, int band);
110 
111  void maxValueSelected(int value, int band);
112 
113 
114  private:
115 
116  std::auto_ptr<Ui::RasterHistogramWidgetForm> m_ui;
117 
119  std::auto_ptr<te::rst::Raster> m_outputRaster;
120 
123 
126 
129 
130  QwtPlotMarker* m_minValueLine;
131  QwtPlotMarker* m_maxValueLine;
132  };
133 
134  } // end namespace widgets
135  } // end namespace qt
136 } // end namespace te
137 
138 #endif // __TERRALIB_QT_WIDGETS_CANVAS_INTERNAL_RASTERHISTOGRAMWIDGET_H
139 
te::qt::widgets::HistogramChart * m_histogramChartOutput
std::auto_ptr< te::rst::Raster > m_outputRaster
te::qt::widgets::ChartDisplay * m_chartDisplay
A class to represent a Histogram.
Definition: Histogram.h:56
te::qt::widgets::Histogram * m_histogramInput
This class is used to define a component for viewing overlaid layers.
std::auto_ptr< Ui::RasterHistogramWidgetForm > m_ui
An abstract class for raster data strucutures.
Definition: Raster.h:71
te::qt::widgets::Histogram * m_histogramOutput
URI C++ Library.
A class to represent a chart display.
Definition: ChartDisplay.h:65
te::qt::widgets::ChartStyle * m_chartStyle
te::qt::widgets::HistogramChart * m_histogramChartInput
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63