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 #include "../../../se.h"
31 #include "../Config.h"
32 
33 // Qt
34 #include <QWidget>
35 #include <QComboBox>
36 
37 // STL
38 #include <memory>
39 #include <string>
40 #include <vector>
41 #include <map>
42 
43 // Forward declaraion
44 namespace Ui { class RasterSymbolizerWidgetForm; }
45 
46 namespace te
47 {
48  // Forward declarations
49  namespace se
50  {
51  class ContrastEnhancement;
52  class RasterSymbolizer;
53  class Symbolizer;
54  }
55 
56  namespace rst
57  {
58  class BandProperty;
59  }
60 
61 // Forward declarations
62  namespace qt
63  {
64  namespace widgets
65  {
66  // Forward declarations
67  class HorizontalSliderWidget;
68 
69  /*!
70  \class RasterSymbolizerWidget
71 
72  \brief A widget used to configure a Raster Symbolizer SE element.
73  */
75  {
76  Q_OBJECT
77 
78  public:
79 
80  /** @name Initializer Methods
81  * Methods related to instantiation and destruction.
82  */
83  //@{
84 
85  /*! \brief Constructs a RasterSymbolizerWidget dialog which is a child of parent, with widget flags set to f. */
86  RasterSymbolizerWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
87 
88  /*! \brief Destructor. */
90 
91  //@}
92 
93  void setRasterSymbolizer(te::se::RasterSymbolizer* rs);
94 
95  te::se::RasterSymbolizer* getRasterSymbolizer() { return m_symbolizer; }
96 
97  void setBandProperty(std::vector<te::rst::BandProperty*> bp);
98 
99  protected:
100 
101  /*! \brief Internal method to initialize the widget (e.g.: color, combos, icons, etc.) */
102  void initialize();
103 
104  /*! \brief Updates the widget form based on internal mark element. */
105  void updateUi();
106 
107  void setComboBoxText(QComboBox* cb, std::string value);
108 
109  protected slots:
110 
111  void onOpacityChanged(int value);
112 
113  void onMonoChannelSelectionClicked();
114  void onRedChannelSelectionClicked();
115  void onGreenChannelSelectionClicked();
116  void onBlueChannelSelectionClicked();
117  void onCompositionChannelSelectionClicked();
118 
119  void onMonoChannelNameChanged(QString s);
120  void onRedChannelNameChanged(QString s);
121  void onGreenChannelNameChanged(QString s);
122  void onBlueChannelNameChanged(QString s);
123 
124  void onTypeConstratChanged(QString s);
125 
126  void onMonoGammaChanged(int v);
127  void onRedGammaChanged(int v);
128  void onGreenGammaChanged(int v);
129  void onBlueGammaChanged(int v);
130 
131  void onIncreaseGain();
132  void onDecreaseGain();
133  void onDefaultGain();
134  void onIncreaseOffset();
135  void onDecreaseOffset();
136  void onDefaultOffset();
137  void onSymbolizerChanged();
138 
139  void onDummyPushButtonClicked();
140 
141  void setContrastVisibility();
142 
143  signals:
144 
145  void symbolizerChanged();
146 
147  private:
148 
149  std::auto_ptr<Ui::RasterSymbolizerWidgetForm> m_ui; //!< Widget form.
150  te::qt::widgets::HorizontalSliderWidget* m_sliderWidget; //!< Slider widget used for opacity information.
151 
152  te::se::RasterSymbolizer* m_symbolizer; //!< SE Raster Symbolizer element.
153 
154  te::se::ContrastEnhancement* m_contrastRed; //!< SE Contrast element for red band.
155  te::se::ContrastEnhancement* m_contrastGreen; //!< SE Contrast element for green band.
156  te::se::ContrastEnhancement* m_contrastBlue; //!< SE Contrast element for blue band.
157  te::se::ContrastEnhancement* m_contrastMono; //!< SE Contrast element for mono band.
158 
159  te::se::SelectedChannel* m_scRed; //!< SE Selected Channel element for red band.
160  te::se::SelectedChannel* m_scGreen; //!< SE Selected Channel element for red band.
161  te::se::SelectedChannel* m_scBlue; //!< SE Selected Channel element for red band.
162  te::se::SelectedChannel* m_scMono; //!< SE Selected Channel element for red band.
163 
164  te::se::ChannelSelection* m_cs; //!< SE Channel Selection element.
165 
166  std::map<te::se::ContrastEnhancement::ContrastEnhancementType, QString> m_ceNames; //!< Contrast Types Names
167 
168  double m_gainValue; //!< Value used to define the gain value.
169  double m_offsetValue; //!< Value used to define the offset value.
170  double m_gainOriginalValue; //!< Value used to define the gain value.
171  double m_offsetOriginalValue; //!< Value used to define the offset value.
172  };
173 
174  } // end namespace widgets
175  } // end namespace qt
176 } // end namespace te
177 
178 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_RASTERSYMBOLIZERWIDGET_H
std::map< te::se::ContrastEnhancement::ContrastEnhancementType, QString > m_ceNames
Contrast Types Names.
A selected channel to be display.
te::se::ContrastEnhancement * m_contrastBlue
SE Contrast element for blue band.
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()
std::auto_ptr< Ui::RasterSymbolizerWidgetForm > m_ui
Widget form.
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.
te::se::SelectedChannel * m_scGreen
SE Selected Channel element for red band.
URI C++ Library.
te::se::ChannelSelection * m_cs
SE Channel Selection element.
ContrastEnhancement defines the 'stretching' 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.
te::se::ContrastEnhancement * m_contrastRed
SE Contrast element for red band.
#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...