All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ColorMapWidget.h
Go to the documentation of this file.
1 /* Copyright (C) 2011-2012 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/ColorMapWidget.h
22 
23  \brief A widget used to build
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_COLORMAPWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_COLORMAPWIDGET_H
28 
29 // TerraLib
30 #include "../Config.h"
31 
32 // Qt
33 #include <QtGui/QWidget>
34 
35 // STL
36 #include <memory>
37 #include <string>
38 #include <vector>
39 
40 // Forward declaraion
41 namespace Ui { class ColorMapWidgetForm; }
42 
43 namespace te
44 {
45 // Forward declarations
46  namespace color
47  {
48  class ColorBar;
49  }
50 
51  namespace se
52  {
53  class ColorMap;
54  }
55 
56  namespace rst
57  {
58  class Raster;
59  }
60 
61  namespace qt
62  {
63  namespace widgets
64  {
65  namespace colorbar
66  {
67  class ColorBar;
68  }
69  /*!
70  \class ColorMapWidget
71 
72  \brief A dialog used to build a ColorMap element.
73  */
74  class TEQTWIDGETSEXPORT ColorMapWidget : public QWidget
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 ShadedReliefWidget dialog which is a child of parent, with widget flags set to f. */
86  ColorMapWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
87 
88  /*! \brief Destructor. */
89  ~ColorMapWidget();
90 
91  //@}
92 
93  public:
94 
95  void setRaster(te::rst::Raster* r);
96 
97  void setColorMap(te::se::ColorMap* cm);
98 
99  te::se::ColorMap* getColorMap();
100 
101  std::string getCurrentBand();
102 
103  protected:
104 
105  /*! \brief Internal method to initialize the widget (e.g.: color, combos, icons, etc.) */
106  void initialize();
107 
108  /*! \brief Updates the widget form based on internal fill element. */
109  void updateUi();
110 
111  void buildCategorizationMap();
112 
113  void buildInterpolationMap();
114 
115  void buildRecodingMap();
116 
117  protected slots:
118 
119  void onApplyPushButtonClicked();
120 
121  void onBandSelected(QString value);
122 
123 
124  signals:
125 
126  void applyPushButtonClicked();
127 
128  private:
129 
130  std::auto_ptr<Ui::ColorMapWidgetForm> m_ui; //!< Dialog form.
131  te::qt::widgets::colorbar::ColorBar* m_cbWidget; //!< QWT widget for color bar.
132  te::se::ColorMap* m_cm; //!< SE Color Map element.
133  te::color::ColorBar* m_cb; //!< Terralib color bar objetc
134 
135  te::rst::Raster* m_raster; //!< TerraLib raster object
136 
137  };
138 
139  } // end namespace widgets
140  } // end namespace qt
141 } // end namespace te
142 
143 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_COLORMAPWIDGET_H
It models the concept of color bar.
Definition: ColorBar.h:49
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:101
It QWidget implementation of color bar.
Definition: ColorBar.h:67
te::qt::widgets::colorbar::ColorBar * m_cbWidget
QWT widget for color bar.
A ColorMap defines either the colors of a pallette-type raster source or the mapping of numeric pixel...
Definition: ColorMap.h:60
std::auto_ptr< Ui::ColorMapWidgetForm > m_ui
Dialog form.
A dialog used to build a ColorMap element.
te::color::ColorBar * m_cb
Terralib color bar objetc.
te::rst::Raster * m_raster
TerraLib raster object.
An abstract class for raster data strucutures.
Definition: Raster.h:70
te::se::ColorMap * m_cm
SE Color Map element.