RasterSymbolizerWidget.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/se/RasterSymbolizerWidget.h
22 
23  \brief A widget used to configure a Raster Symbolizer SE element.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_RASTERSYMBOLIZERWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_RASTERSYMBOLIZERWIDGET_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../maptools/AbstractLayer.h"
32 #include "../../../maptools/RasterTransform.h"
33 #include "../../../rp/Contrast.h"
34 #include "../../../se.h"
35 #endif
36 #include "../Config.h"
37 
38 // Qt
39 #include <QWidget>
40 #include <QComboBox>
41 
42 // STL
43 #include <memory>
44 #include <string>
45 #include <vector>
46 #include <map>
47 
48 // Forward declaraion
49 namespace Ui { class RasterSymbolizerWidgetForm; }
50 
51 namespace te
52 {
53  // Forward declarations
54  namespace map
55  {
56  class RasterContrast;
57  }
58 
59  namespace se
60  {
61  class ContrastEnhancement;
62  class RasterSymbolizer;
63  class Symbolizer;
64  }
65 
66  namespace rst
67  {
68  class BandProperty;
69  }
70 
71 // Forward declarations
72  namespace qt
73  {
74  namespace widgets
75  {
76  // Forward declarations
77  class MapDisplay;
78  class HorizontalSliderWidget;
79  class RasterHistogramWidget;
80 
81  /*!
82  \class RasterSymbolizerWidget
83 
84  \brief A widget used to configure a Raster Symbolizer SE element.
85  */
87  {
88  Q_OBJECT
89 
90  public:
91 
92  /** @name Initializer Methods
93  * Methods related to instantiation and destruction.
94  */
95  //@{
96 
97  /*! \brief Constructs a RasterSymbolizerWidget dialog which is a child of parent, with widget flags set to f. */
98  RasterSymbolizerWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
99 
100  /*! \brief Destructor. */
102 
103  //@}
104 
105  void setRasterSymbolizer(te::se::RasterSymbolizer* rs);
106 
107  te::se::RasterSymbolizer* getRasterSymbolizer() { return m_symbolizer; }
108 
109  void setRasterContrast(te::map::RasterContrast* contrast);
110 
111  te::map::RasterContrast* getRasterContrast();
112 
113  void setLayer(te::map::AbstractLayer* layer);
114 
115  void setBandProperty(std::vector<te::rst::BandProperty*> bp);
116 
117  void setMapDisplay(te::qt::widgets::MapDisplay* display);
118 
119  protected:
120 
121  /*! \brief Internal method to initialize the widget (e.g.: color, combos, icons, etc.) */
122  void initialize();
123 
124  /*! \brief Updates the widget form based on internal mark element. */
125  void updateUi();
126 
127  void setComboBoxText(QComboBox* cb, std::string value);
128 
129  protected slots:
130 
131  void onOpacityChanged(int value);
132 
133  void onMonoChannelSelectionClicked();
134  void onRedChannelSelectionClicked();
135  void onGreenChannelSelectionClicked();
136  void onBlueChannelSelectionClicked();
137  void onCompositionChannelSelectionClicked();
138 
139  void onMonoChannelNameChanged(QString s);
140  void onRedChannelNameChanged(QString s);
141  void onGreenChannelNameChanged(QString s);
142  void onBlueChannelNameChanged(QString s);
143 
144  void onTypeConstratChanged(QString s);
145 
146  void onMonoGammaChanged(int v);
147  void onRedGammaChanged(int v);
148  void onGreenGammaChanged(int v);
149  void onBlueGammaChanged(int v);
150 
151  void onIncreaseGain();
152  void onDecreaseGain();
153  void onDefaultGain();
154  void onIncreaseOffset();
155  void onDecreaseOffset();
156  void onDefaultOffset();
157  void onSymbolizerChanged();
158 
159  void onDummyPushButtonClicked();
160 
161  void setContrastVisibility();
162 
163  //contrast slots
164 
165  void onHistogramToolButtonClicked();
166 
167  void onMinValueSelected(int value, int band);
168 
169  void onMaxValueSelected(int value, int band);
170 
171  void onMinValueSelected(double value, int band);
172 
173  void onMaxValueSelected(double value, int band);
174 
175  void onResetToolButtonClicked();
176 
177  void onApplyToolButtonClicked();
178 
179  void onCalcRasterSummaryClicked();
180 
181  void onResetRasterSummaryTableClicked();
182 
183  void onMinimumValueChanged();
184 
185  void onMaximumValueChanged();
186 
187  signals:
188 
189  void symbolizerChanged();
190 
191  void contrastChanged(bool remove);
192 
193  void mapRefresh();
194 
195  private:
196 
197  std::unique_ptr<Ui::RasterSymbolizerWidgetForm> m_ui; //!< Widget form.
198  te::qt::widgets::HorizontalSliderWidget* m_sliderWidget; //!< Slider widget used for opacity information.
200 
202 
203  te::se::RasterSymbolizer* m_symbolizer; //!< SE Raster Symbolizer element.
204  te::map::RasterContrast* m_contrast; //!< Raster Contrast element.
205 
207 
208  te::se::ContrastEnhancement* m_contrastRed; //!< SE Contrast element for red band.
209  te::se::ContrastEnhancement* m_contrastGreen; //!< SE Contrast element for green band.
210  te::se::ContrastEnhancement* m_contrastBlue; //!< SE Contrast element for blue band.
211  te::se::ContrastEnhancement* m_contrastMono; //!< SE Contrast element for mono band.
212 
213  te::se::SelectedChannel* m_scRed; //!< SE Selected Channel element for red band.
214  te::se::SelectedChannel* m_scGreen; //!< SE Selected Channel element for red band.
215  te::se::SelectedChannel* m_scBlue; //!< SE Selected Channel element for red band.
216  te::se::SelectedChannel* m_scMono; //!< SE Selected Channel element for red band.
217 
218  te::se::ChannelSelection* m_cs; //!< SE Channel Selection element.
219 
220  std::map<te::se::ContrastEnhancement::ContrastEnhancementType, QString> m_ceNames; //!< Contrast Types Names
221  std::map<te::rp::Contrast::InputParameters::ContrastType, te::map::RasterTransform::ContrastType> m_contrastMap; //!< Contrast Types Names
222 
223  double m_gainValue; //!< Value used to define the gain value.
224  double m_offsetValue; //!< Value used to define the offset value.
225  double m_gainOriginalValue; //!< Value used to define the gain value.
226  double m_offsetOriginalValue; //!< Value used to define the offset value.
227 
229  };
230 
231  } // end namespace widgets
232  } // end namespace qt
233 } // end namespace te
234 
235 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_RASTERSYMBOLIZERWIDGET_H
std::map< te::se::ContrastEnhancement::ContrastEnhancementType, QString > m_ceNames
Contrast Types Names.
#define slots
A selected channel to be display.
te::se::ContrastEnhancement * m_contrastBlue
SE Contrast element for blue band.
This is the base class for layers.
Definition: AbstractLayer.h:77
std::unique_ptr< Ui::RasterSymbolizerWidgetForm > m_ui
Widget form.
te::se::SelectedChannel * m_scBlue
SE Selected Channel element for red band.
A widget used to configure a Raster Symbolizer SE element.
te::se::RasterSymbolizer * getRasterSymbolizer()
A widget to control the display of a set of layers.
Definition: MapDisplay.h:71
te::se::SelectedChannel * m_scMono
SE Selected Channel element for red band.
te::se::SelectedChannel * m_scRed
SE Selected Channel element for red band.
double m_offsetValue
Value used to define the offset value.
double m_offsetOriginalValue
Value used to define the offset value.
te::se::ContrastEnhancement * m_contrastMono
SE Contrast element for mono band.
This class is used to define a component for viewing overlaid layers.
te::se::SelectedChannel * m_scGreen
SE Selected Channel element for red band.
te::map::RasterContrast * m_contrast
Raster Contrast element.
TerraLib.
te::se::ChannelSelection * m_cs
SE Channel Selection element.
ContrastEnhancement defines the &#39;stretching&#39; of contrast for a channel of a false-color image or for ...
double m_gainOriginalValue
Value used to define the gain value.
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
te::qt::widgets::HorizontalSliderWidget * m_sliderWidget
Slider widget used for opacity information.
te::se::ContrastEnhancement * m_contrastGreen
SE Contrast element for green band.
This class contains the parameters needed to apply dynamic contrast over a raster.
te::se::ContrastEnhancement * m_contrastRed
SE Contrast element for red band.
te::qt::widgets::RasterHistogramWidget * m_histogramWidget
Histogram widget.
std::map< te::rp::Contrast::InputParameters::ContrastType, te::map::RasterTransform::ContrastType > m_contrastMap
Contrast Types Names.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
double m_gainValue
Value used to define the gain value.
te::se::RasterSymbolizer * m_symbolizer
SE Raster Symbolizer element.
ChannelSelection specifies the false-color channel selection for a multi-spectral raster source (such...