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 setChartOutputColor(int red, int green, int blue);
78 
79  void setEnableTools(bool enable);
80 
81  void setEnableNavigationTools(bool enable);
82 
84 
85  /*!
86  \brief Set the output raster.
87  \param raster Raster pointer
88  \note This instance will acquire the raster ownership.
89  */
91 
92  void drawHistogram(int band);
93 
94  void setMinimumValueEnabled(bool enable);
95 
96  void updateMinimumValueLine(int value, bool replot = false);
97 
98  void updateMinimumValueLine(double value, bool replot = false);
99 
100  void updateMinimumValueLabel(QString value);
101 
102  void setMaximumValueEnabled(bool enable);
103 
104  void updateMaximumValueLine(int value, bool replot = false);
105 
106  void updateMaximumValueLine(double value, bool replot = false);
107 
108  void updateMaximumValueLabel(QString value);
109 
111 
112  void clear();
113 
114  void setHistogramInputTitle( const std::string& newTitle );
115 
116  void setHistogramOutputTitle( const std::string& newTitle );
117 
118  protected:
119 
120  void createHistogram(te::qt::widgets::Histogram* histogram, te::rst::Raster* raster, int bandId, int slices);
121 
122  protected slots:
123 
125 
126  void onLeftPointSelected(const QPointF& point);
127 
128  void onRigthPointSelected(const QPointF& point);
129 
130  signals:
131 
132  void minValueSelected(int value, int band);
133 
134  void maxValueSelected(int value, int band);
135 
136  void minValueSelected(double value, int band);
137 
138  void maxValueSelected(double value, int band);
139 
140  private:
141 
142  std::unique_ptr<Ui::RasterHistogramWidgetForm> m_ui;
143 
145  std::unique_ptr<te::rst::Raster> m_outputRaster;
146 
148 
149  public:
150 
153 
156 
159 
160  QwtPlotMarker* m_minValueLine;
161  QwtPlotMarker* m_maxValueLine;
162  };
163 
164  } // end namespace widgets
165  } // end namespace qt
166 } // end namespace te
167 
168 #endif // __TERRALIB_QT_WIDGETS_CANVAS_INTERNAL_RASTERHISTOGRAMWIDGET_H
169 
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
A class to represent a chart display.
Definition: ChartDisplay.h:66
A class to represent a Histogram.
Definition: Histogram.h:57
This class is used to define a component for viewing overlaid layers.
void maxValueSelected(double value, int band)
void updateMaximumValueLabel(QString value)
void updateMaximumValueLine(double value, bool replot=false)
RasterHistogramWidget(QWidget *parent=0, Qt::WindowFlags f=0)
void updateMinimumValueLabel(QString value)
void setInputRaster(te::rst::Raster *raster, te::gm::Envelope env=te::gm::Envelope())
void createHistogram(te::qt::widgets::Histogram *histogram, te::rst::Raster *raster, int bandId, int slices)
void maxValueSelected(int value, int band)
void setHistogramOutputTitle(const std::string &newTitle)
Ui::RasterHistogramWidgetForm * getForm() const
te::qt::widgets::HistogramChart * m_histogramChartOutput
te::qt::widgets::HistogramChart * m_histogramChartInput
std::unique_ptr< Ui::RasterHistogramWidgetForm > m_ui
std::unique_ptr< te::rst::Raster > m_outputRaster
void updateMinimumValueLine(double value, bool replot=false)
te::qt::widgets::Histogram * m_histogramInput
void setOutputRaster(te::rst::Raster *raster)
Set the output raster.
void updateMinimumValueLine(int value, bool replot=false)
void setHistogramInputTitle(const std::string &newTitle)
void setChartOutputColor(int red, int green, int blue)
void minValueSelected(int value, int band)
void setChartInputColor(int red, int green, int blue)
void onLeftPointSelected(const QPointF &point)
void updateMaximumValueLine(int value, bool replot=false)
void minValueSelected(double value, int band)
void onRigthPointSelected(const QPointF &point)
te::qt::widgets::ChartDisplay * m_chartDisplay
te::qt::widgets::Histogram * m_histogramOutput
te::qt::widgets::ChartStyle * m_chartStyle
An abstract class for raster data strucutures.
Definition: Raster.h:72
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