All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ColorMapWidget.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/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 "../../../maptools/AbstractLayer.h"
31 #include "../Config.h"
32 
33 // Qt
34 #include <QTableWidgetItem>
35 #include <QWidget>
36 
37 // STL
38 #include <memory>
39 #include <string>
40 #include <vector>
41 
42 // Forward declaraion
43 namespace Ui { class ColorMapWidgetForm; }
44 
45 namespace te
46 {
47 // Forward declarations
48  namespace color
49  {
50  class ColorBar;
51  }
52 
53  namespace se
54  {
55  class ColorMap;
56  }
57 
58  namespace rst
59  {
60  class Raster;
61  }
62 
63  namespace qt
64  {
65  namespace widgets
66  {
67  // Forward declarations
68  class ColorCatalogWidget;
69 
70  /*!
71  \class ColorMapWidget
72 
73  \brief A dialog used to build a ColorMap element.
74  */
75  class TEQTWIDGETSEXPORT ColorMapWidget : public QWidget
76  {
77  Q_OBJECT
78 
79  public:
80 
81  /** @name Initializer Methods
82  * Methods related to instantiation and destruction.
83  */
84  //@{
85 
86  /*! \brief Constructs a ShadedReliefWidget dialog which is a child of parent, with widget flags set to f. */
87  ColorMapWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
88 
89  /*! \brief Destructor. */
90  ~ColorMapWidget();
91 
92  //@}
93 
94  public:
95 
96  void setRaster(te::rst::Raster* r);
97 
98  void setColorMap(te::se::ColorMap* cm);
99 
100  void setLayers(te::map::AbstractLayerPtr selectedLayer, std::vector<te::map::AbstractLayerPtr> allLayers);
101 
102  te::se::ColorMap* getColorMap();
103 
104  std::string getCurrentBand();
105 
106  protected:
107 
108  /*! \brief Internal method to initialize the widget (e.g.: color, combos, icons, etc.) */
109  void initialize();
110 
111  /*! \brief Updates the widget form based on internal fill element. */
112  void updateUi(bool loadColorBar = false);
113 
114  void buildCategorizationMap();
115 
116  void buildInterpolationMap();
117 
118  void buildRecodingMap();
119 
120  protected slots:
121 
122  void onApplyPushButtonClicked();
123 
124  void onBandSelected(QString value);
125 
126  void onTableWidgetItemDoubleClicked(QTableWidgetItem* item);
127 
128  void onImportPushButtonClicked();
129 
130  signals:
131 
132  void applyPushButtonClicked();
133 
134  private:
135 
136  std::auto_ptr<Ui::ColorMapWidgetForm> m_ui; //!< Dialog form.
137  te::qt::widgets::ColorCatalogWidget* m_colorBar; //!< Widget used to pick a color.
138  te::se::ColorMap* m_cm; //!< SE Color Map element.
139  te::color::ColorBar* m_cb; //!< Terralib color bar objetc
140 
141  te::rst::Raster* m_raster; //!< TerraLib raster object
142 
143  };
144 
145  } // end namespace widgets
146  } // end namespace qt
147 } // end namespace te
148 
149 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_COLORMAPWIDGET_H
A dialog used to build a ColorMap element.
An abstract class for raster data strucutures.
Definition: Raster.h:71
te::se::ColorMap * m_cm
SE Color Map element.
te::qt::widgets::ColorCatalogWidget * m_colorBar
Widget used to pick a color.
te::color::ColorBar * m_cb
Terralib color bar objetc.
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:66
std::auto_ptr< Ui::ColorMapWidgetForm > m_ui
Dialog form.
te::rst::Raster * m_raster
TerraLib raster object.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
A ColorMap defines either the colors of a pallette-type raster source or the mapping of numeric pixel...
Definition: ColorMap.h:60