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 setEnableNavigationTools(bool enable);
80 
82 
83  /*!
84  \brief Set the output raster.
85  \param raster Raster pointer
86  \note This instance will acquire the raster ownership.
87  */
89 
90  void drawHistogram(int band);
91 
92  void setMinimumValueEnabled(bool enable);
93 
94  void updateMinimumValueLine(int value, bool replot = false);
95 
96  void updateMinimumValueLine(double value, bool replot = false);
97 
98  void updateMinimumValueLabel(QString value);
99 
100  void setMaximumValueEnabled(bool enable);
101 
102  void updateMaximumValueLine(int value, bool replot = false);
103 
104  void updateMaximumValueLine(double value, bool replot = false);
105 
106  void updateMaximumValueLabel(QString value);
107 
109 
110  void clear();
111 
112  protected:
113 
114  void createHistogram(te::qt::widgets::Histogram* histogram, te::rst::Raster* raster, int bandId, int slices);
115 
116  protected slots:
117 
119 
120  void onLeftPointSelected(const QPointF& point);
121 
122  void onRigthPointSelected(const QPointF& point);
123 
124  signals:
125 
126  void minValueSelected(int value, int band);
127 
128  void maxValueSelected(int value, int band);
129 
130  void minValueSelected(double value, int band);
131 
132  void maxValueSelected(double value, int band);
133 
134  private:
135 
136  std::unique_ptr<Ui::RasterHistogramWidgetForm> m_ui;
137 
139  std::unique_ptr<te::rst::Raster> m_outputRaster;
140 
142 
143  public:
144 
147 
150 
153 
154  QwtPlotMarker* m_minValueLine;
155  QwtPlotMarker* m_maxValueLine;
156  };
157 
158  } // end namespace widgets
159  } // end namespace qt
160 } // end namespace te
161 
162 #endif // __TERRALIB_QT_WIDGETS_CANVAS_INTERNAL_RASTERHISTOGRAMWIDGET_H
163 
te::qt::widgets::RasterHistogramWidget::m_histogramInput
te::qt::widgets::Histogram * m_histogramInput
Definition: RasterHistogramWidget.h:148
te::gm::Envelope
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
te::qt::widgets::Histogram
A class to represent a Histogram.
Definition: Histogram.h:57
te::qt::widgets::RasterHistogramWidget::drawHistogram
void drawHistogram(int band)
te::qt::widgets::RasterHistogramWidget::m_inputEnv
te::gm::Envelope m_inputEnv
Definition: RasterHistogramWidget.h:141
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::qt::widgets::RasterHistogramWidget::clearMinMaxLines
void clearMinMaxLines()
te::qt::widgets::RasterHistogramWidget::m_chartStyle
te::qt::widgets::ChartStyle * m_chartStyle
Definition: RasterHistogramWidget.h:145
te::qt::widgets::RasterHistogramWidget::updateMinimumValueLine
void updateMinimumValueLine(int value, bool replot=false)
te::qt::widgets::RasterHistogramWidget::createHistogram
void createHistogram(te::qt::widgets::Histogram *histogram, te::rst::Raster *raster, int bandId, int slices)
te::rst::Raster
An abstract class for raster data strucutures.
Definition: Raster.h:72
te::qt::widgets::RasterHistogramWidget::setChartInputColor
void setChartInputColor(int red, int green, int blue)
te::qt::widgets::RasterHistogramWidget::setMaximumValueEnabled
void setMaximumValueEnabled(bool enable)
te::qt::widgets::RasterHistogramWidget::m_chartDisplay
te::qt::widgets::ChartDisplay * m_chartDisplay
Definition: RasterHistogramWidget.h:146
te::qt::widgets::RasterHistogramWidget::updateMinimumValueLine
void updateMinimumValueLine(double value, bool replot=false)
TEQTWIDGETSEXPORT
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
te::qt::widgets::RasterHistogramWidget::minValueSelected
void minValueSelected(double value, int band)
te::qt::widgets::RasterHistogramWidget::maxValueSelected
void maxValueSelected(double value, int band)
te::qt::widgets::RasterHistogramWidget::m_inputRaster
te::rst::Raster * m_inputRaster
Definition: RasterHistogramWidget.h:138
te::qt::widgets::RasterHistogramWidget::m_outputRaster
std::unique_ptr< te::rst::Raster > m_outputRaster
Definition: RasterHistogramWidget.h:139
te::qt::widgets::HistogramChart
Definition: HistogramChart.h:54
te::qt::widgets::RasterHistogramWidget::m_histogramChartOutput
te::qt::widgets::HistogramChart * m_histogramChartOutput
Definition: RasterHistogramWidget.h:152
Ui
Definition: ConfigInputAddressDialog.h:44
te::qt::widgets::RasterHistogramWidget::onLeftPointSelected
void onLeftPointSelected(const QPointF &point)
te::qt::widgets::RasterHistogramWidget::clear
void clear()
te::qt::widgets::RasterHistogramWidget::m_minValueLine
QwtPlotMarker * m_minValueLine
Definition: RasterHistogramWidget.h:154
te::qt::widgets::RasterHistogramWidget::m_histogramOutput
te::qt::widgets::Histogram * m_histogramOutput
Definition: RasterHistogramWidget.h:151
te::qt::widgets::RasterHistogramWidget::m_ui
std::unique_ptr< Ui::RasterHistogramWidgetForm > m_ui
Definition: RasterHistogramWidget.h:136
te::qt::widgets::RasterHistogramWidget::updateMaximumValueLine
void updateMaximumValueLine(double value, bool replot=false)
te::qt::widgets::RasterHistogramWidget::maxValueSelected
void maxValueSelected(int value, int band)
te::qt::widgets::RasterHistogramWidget::setMinimumValueEnabled
void setMinimumValueEnabled(bool enable)
slots
#define slots
Definition: VirtualMachine.h:48
te::qt::widgets::RasterHistogramWidget::setOutputRaster
void setOutputRaster(te::rst::Raster *raster)
Set the output raster.
te::qt::widgets::RasterHistogramWidget::setInputRaster
void setInputRaster(te::rst::Raster *raster, te::gm::Envelope env=te::gm::Envelope())
te::qt::widgets::ChartStyle
Definition: ChartStyle.h:55
te::qt::widgets::RasterHistogramWidget::~RasterHistogramWidget
~RasterHistogramWidget()
te::qt::widgets::RasterHistogramWidget::setEnableNavigationTools
void setEnableNavigationTools(bool enable)
te::qt::widgets::RasterHistogramWidget::updateMinimumValueLabel
void updateMinimumValueLabel(QString value)
te::qt::widgets::RasterHistogramWidget::setEnableTools
void setEnableTools(bool enable)
te::qt::widgets::RasterHistogramWidget::onApplyToolButtonClicked
void onApplyToolButtonClicked()
te::qt::widgets::RasterHistogramWidget::minValueSelected
void minValueSelected(int value, int band)
te::qt::widgets::RasterHistogramWidget::onRigthPointSelected
void onRigthPointSelected(const QPointF &point)
te::qt::widgets::RasterHistogramWidget::RasterHistogramWidget
RasterHistogramWidget(QWidget *parent=0, Qt::WindowFlags f=0)
te::qt::widgets::RasterHistogramWidget::updateMaximumValueLabel
void updateMaximumValueLabel(QString value)
te::qt::widgets::RasterHistogramWidget::updateMaximumValueLine
void updateMaximumValueLine(int value, bool replot=false)
te::qt::widgets::ChartDisplay
A class to represent a chart display.
Definition: ChartDisplay.h:66
te::qt::widgets::RasterHistogramWidget::m_histogramChartInput
te::qt::widgets::HistogramChart * m_histogramChartInput
Definition: RasterHistogramWidget.h:149
te::qt::widgets::RasterHistogramWidget::getForm
Ui::RasterHistogramWidgetForm * getForm() const
te::qt::widgets::RasterHistogramWidget
This class is used to define a component for viewing overlaid layers.
Definition: RasterHistogramWidget.h:64
te::qt::widgets::RasterHistogramWidget::m_maxValueLine
QwtPlotMarker * m_maxValueLine
Definition: RasterHistogramWidget.h:155