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  //!< We never change the received pointer. We copy it
107 
108  //!< The caller will be the owner of the returner pointer
110 
112 
114 
116 
117  void setBandProperty(std::vector<te::rst::BandProperty*> bp);
118 
120 
121  protected:
122 
123  /*! \brief Internal method to initialize the widget (e.g.: color, combos, icons, etc.) */
124  void initialize();
125 
126  /*! \brief Updates the widget form based on internal mark element. */
127  void updateUi();
128 
129  void setComboBoxText(QComboBox* cb, std::string value);
130 
131  protected slots:
132 
133  void onOpacityChanged(int value);
134 
140 
141  void onMonoChannelNameChanged(QString s);
142  void onRedChannelNameChanged(QString s);
143  void onGreenChannelNameChanged(QString s);
144  void onBlueChannelNameChanged(QString s);
145 
146  void onTypeConstratChanged(QString s);
147 
148  void onMonoGammaChanged(int v);
149  void onRedGammaChanged(int v);
150  void onGreenGammaChanged(int v);
151  void onBlueGammaChanged(int v);
152 
160 
162 
164 
165  //contrast slots
166 
168 
169  void onMinValueSelected(int value, int band);
170 
171  void onMaxValueSelected(int value, int band);
172 
173  void onMinValueSelected(double value, int band);
174 
175  void onMaxValueSelected(double value, int band);
176 
178 
180 
182 
184 
186 
188 
189  // domain slots
190 
191  void onDomainComboBoxChanged(int index);
192 
193  signals:
194 
196 
197  void contrastChanged(bool remove);
198 
199  void mapRefresh();
200 
201  private:
202 
203  std::unique_ptr<Ui::RasterSymbolizerWidgetForm> m_ui; //!< Widget form.
204  te::qt::widgets::HorizontalSliderWidget* m_sliderWidget; //!< Slider widget used for opacity information.
206 
208 
209  te::se::RasterSymbolizer* m_symbolizer; //!< SE Raster Symbolizer element.
210  te::map::RasterContrast* m_contrast; //!< Raster Contrast element.
211 
213 
214  te::se::ContrastEnhancement* m_contrastRed; //!< SE Contrast element for red band.
215  te::se::ContrastEnhancement* m_contrastGreen; //!< SE Contrast element for green band.
216  te::se::ContrastEnhancement* m_contrastBlue; //!< SE Contrast element for blue band.
217  te::se::ContrastEnhancement* m_contrastMono; //!< SE Contrast element for mono band.
218 
219  te::se::SelectedChannel* m_scRed; //!< SE Selected Channel element for red band.
220  te::se::SelectedChannel* m_scGreen; //!< SE Selected Channel element for red band.
221  te::se::SelectedChannel* m_scBlue; //!< SE Selected Channel element for red band.
222  te::se::SelectedChannel* m_scMono; //!< SE Selected Channel element for red band.
223 
224  te::se::ChannelSelection* m_cs; //!< SE Channel Selection element.
225 
226  std::map<te::se::ContrastEnhancement::ContrastEnhancementType, QString> m_ceNames; //!< Contrast Types Names
227  std::map<te::rp::Contrast::InputParameters::ContrastType, te::map::RasterTransform::ContrastType> m_contrastMap; //!< Contrast Types Names
228 
229  double m_gainValue; //!< Value used to define the gain value.
230  double m_offsetValue; //!< Value used to define the offset value.
231  double m_gainOriginalValue; //!< Value used to define the gain value.
232  double m_offsetOriginalValue; //!< Value used to define the offset value.
233 
234  std::vector<double> m_minValue;
235  std::vector<double> m_maxValue;
236 
238  };
239 
240  } // end namespace widgets
241  } // end namespace qt
242 } // end namespace te
243 
244 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_RASTERSYMBOLIZERWIDGET_H
This is the base class for layers.
Definition: AbstractLayer.h:78
This class contains the parameters needed to apply dynamic contrast over a raster.
A widget to control the display of a set of layers.
Definition: MapDisplay.h:72
This class is used to define a component for viewing overlaid layers.
A widget used to configure a Raster Symbolizer SE element.
te::se::SelectedChannel * m_scGreen
SE Selected Channel element for red band.
te::se::ChannelSelection * m_cs
SE Channel Selection element.
te::se::ContrastEnhancement * m_contrastRed
SE Contrast element for red band.
double m_gainOriginalValue
Value used to define the gain value.
te::se::RasterSymbolizer * m_symbolizer
SE Raster Symbolizer element.
void setLayer(te::map::AbstractLayer *layer)
std::map< te::se::ContrastEnhancement::ContrastEnhancementType, QString > m_ceNames
Contrast Types Names.
void updateUi()
Updates the widget form based on internal mark element.
std::map< te::rp::Contrast::InputParameters::ContrastType, te::map::RasterTransform::ContrastType > m_contrastMap
Contrast Types Names.
te::qt::widgets::RasterHistogramWidget * m_histogramWidget
Histogram widget.
void setRasterContrast(te::map::RasterContrast *contrast)
te::se::ContrastEnhancement * m_contrastGreen
SE Contrast element for green band.
void setBandProperty(std::vector< te::rst::BandProperty * > bp)
void setRasterSymbolizer(const te::se::RasterSymbolizer *rs)
< We never change the received pointer. We copy it
double m_offsetOriginalValue
Value used to define the offset value.
void onMinValueSelected(int value, int band)
double m_offsetValue
Value used to define the offset value.
RasterSymbolizerWidget(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a RasterSymbolizerWidget dialog which is a child of parent, with widget flags set to f.
te::qt::widgets::HorizontalSliderWidget * m_sliderWidget
Slider widget used for opacity information.
te::map::RasterContrast * m_contrast
Raster Contrast element.
te::se::ContrastEnhancement * m_contrastMono
SE Contrast element for mono band.
te::se::ContrastEnhancement * m_contrastBlue
SE Contrast element for blue band.
te::se::RasterSymbolizer * getRasterSymbolizer()
void onMinValueSelected(double value, int band)
void initialize()
Internal method to initialize the widget (e.g.: color, combos, icons, etc.)
te::se::SelectedChannel * m_scRed
SE Selected Channel element for red band.
void onMaxValueSelected(int value, int band)
te::map::RasterContrast * getRasterContrast()
std::unique_ptr< Ui::RasterSymbolizerWidgetForm > m_ui
Widget form.
double m_gainValue
Value used to define the gain value.
void setMapDisplay(te::qt::widgets::MapDisplay *display)
void onMaxValueSelected(double value, int band)
void setComboBoxText(QComboBox *cb, std::string value)
te::se::SelectedChannel * m_scBlue
SE Selected Channel element for red band.
te::se::SelectedChannel * m_scMono
SE Selected Channel element for red band.
ChannelSelection specifies the false-color channel selection for a multi-spectral raster source (such...
ContrastEnhancement defines the 'stretching' of contrast for a channel of a false-color image or for ...
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos,...
A selected channel to be display.
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