SlicingColorMapWidget.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/SlicingColorMapWidget.h
22 
23 \brief A widget used to adjust the color map with the minimal required parameters.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_SLICINGCOLORMAPWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_SLICINGCOLORMAPWIDGET_H
28 
29 // TerraLib
30 #include "../../../se/Enums.h"
31 #include "../Config.h"
32 
33 // Qt
34 #include <QWidget>
35 #include <QTableWidgetItem>
36 
37 // STL
38 #include <memory>
39 #include <string>
40 #include <vector>
41 
42 // Forward declaraion
43 namespace Ui { class SlicingColorMapForm; }
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  */
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 SlicingColorMapWidget which is a child of parent, with widget flags set to f. */
87  SlicingColorMapWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
88 
89  /*! \brief Destructor. */
91 
92  //@}
93 
94  public:
95 
96  void setRaster(te::rst::Raster* r);
97 
98  void setColorMap(te::se::ColorMap* cm);
99 
100  te::se::ColorMap* getColorMap();
101 
102  Ui::SlicingColorMapForm* getForm();
103 
104  protected:
105 
106  /*! \brief Updates the widget form based on internal fill element. */
107  void updateUi(bool loadColorBar = false);
108 
109  protected slots:
110 
111  void onApplyPushButtonClicked();
112 
113  void onBandSelected(int band);
114 
115  void onTableWidgetItemDoubleClicked(QTableWidgetItem* item);
116 
117  signals:
118 
119  void applyPushButtonClicked();
120 
121  private:
122 
123  //No copy allowed
125  SlicingColorMapWidget& operator=(const SlicingColorMapWidget& rhs);
126 
127  std::unique_ptr<Ui::SlicingColorMapForm> m_ui; //!< Dialog form.
128  te::qt::widgets::ColorCatalogWidget* m_colorBar; //!< Widget used to pick a color.
129  te::se::ColorMap* m_cm; //!< SE Color Map element.
130  te::color::ColorBar* m_cb; //!< Terralib color bar object
131  te::rst::Raster* m_raster; //!< TerraLib raster object
132  };
133 
134  } // end namespace widgets
135  } // end namespace qt
136 } // end namespace te
137 
138 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_COLORMAPWIDGET_H
te::se::ColorMap * m_cm
SE Color Map element.
std::unique_ptr< Ui::SlicingColorMapForm > m_ui
Dialog form.
te::qt::widgets::ColorCatalogWidget * m_colorBar
Widget used to pick a color.
An abstract class for raster data strucutures.
Definition: Raster.h:71
URI C++ Library.
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:63
te::rst::Raster * m_raster
TerraLib raster object.
A ColorMap defines either the colors of a pallette-type raster source or the mapping of numeric pixel...
Definition: ColorMap.h:61
te::color::ColorBar * m_cb
Terralib color bar object.