Loading...
Searching...
No Matches
TimeViewerEditLegendDialog.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
4 applications.
5
6 TerraLib is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation, either version 3 of the License,
9 or (at your option) any later version.
10
11 TerraLib is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with TerraLib. See COPYING. If not, write to
18 TerraLib Team at <terralib-team@terralib.org>.
19 */
20
21/*!
22 \file terralib/qt/plugins/timeviewer/TimeViewerEditLegendDialog.h
23
24 \brief A dialog used to edit legend.
25*/
26
27#ifndef __TERRALIB_QT_PLUGINS_TIMEVIEWER_TIMEVIEWEREEDITLEGEND_H__
28#define __TERRALIB_QT_PLUGINS_TIMEVIEWER_TIMEVIEWEREEDITLEGEND_H__
29
30// TerraLib
31#ifndef Q_MOC_RUN
32#endif
33
34#include "../../../dataaccess/datasource/DataSourceInfo.h"
35#include "../../../maptools/AbstractLayer.h"
36#include "Config.h"
37
38// Qt
39#include <QDialog>
40#include <QTableWidgetItem>
41
42// STL
43#include <memory>
44
45// Forward declaraion
46namespace Ui
47{
48 class TimeViewerEditLegendDialog;
49}
50
51namespace te
52{
53 namespace color
54 {
55 class ColorBar;
56 }
57
58 namespace se
59 {
60 class Rule;
61 }
62
63 namespace qt
64 {
65 namespace widgets
66 {
67 // Forward declarations
68 class ColorCatalogWidget;
69 }
70
71 namespace plugins
72 {
73 namespace tv
74 {
75 /*!
76 \class TimeViewerEditLegendDialog
77
78 \brief A dialog used to edit legend.
79
80 */
81 class TimeViewerEditLegendDialog : public QDialog
82 {
83 Q_OBJECT
84
85 public:
86 /** @name Initializer Methods
87 * Methods related to instantiation and destruction.
88 */
89 //@{
90
91 /*! \brief Constructs a basic fill dialog which is a child of parent,
92 * with widget flags set to f. */
93 TimeViewerEditLegendDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
94
95 /*! \brief Destructor. */
97
98 //@}
99
101
102 const std::vector<se::Rule*>& getRules() const;
103
104 void saveLegend(const std::string& path);
105
106 private:
107
108 void getDataAsString(std::vector<std::string>& vec, const std::string& attrName, int& nullValues);
109
110 void buildSymbolizer(std::string meanTitle = "");
111
113
115
116 void updateUi(bool loadColorBar = false);
117
118 protected:
119
121
122 protected slots:
123
125
127
129
131
133
135
137
139
140 signals:
141
143
145
146 private:
147
148 std::unique_ptr<Ui::TimeViewerEditLegendDialog> m_ui; //!< Dialog form.
149
150 te::map::AbstractLayerPtr m_layer; //!< TerraLib layer auto ptr
151
152 std::vector<te::se::Rule*> m_legend; //!< Rule items
153
154 te::color::ColorBar* m_cb; //!< Terralib color bar objetc
155
156 te::qt::widgets::ColorCatalogWidget* m_colorBar; //!< Widget used to pick a color.
157
159 };
160 } // end namespace tv
161 } // end namespace plugins
162 } // end namespace qt
163} // end namespace te
164
165#endif //__TERRALIB_QT_PLUGINS_TIMEVIEWER_TIMEVIEWEREEDITLEGEND_H__
It models the concept of color bar.
Definition: ColorBar.h:50
te::map::AbstractLayerPtr m_layer
TerraLib layer auto ptr.
void setLayers(te::map::AbstractLayerPtr layer)
te::qt::widgets::ColorCatalogWidget * m_colorBar
Widget used to pick a color.
te::color::ColorBar * m_cb
Terralib color bar objetc.
std::unique_ptr< Ui::TimeViewerEditLegendDialog > m_ui
Dialog form.
void buildSymbolizer(std::string meanTitle="")
const std::vector< se::Rule * > & getRules() const
void getDataAsString(std::vector< std::string > &vec, const std::string &attrName, int &nullValues)
void updateUi(bool loadColorBar=false)
TimeViewerEditLegendDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a basic fill dialog which is a child of parent, with widget flags set to f.
void saveLegend(const std::string &path)
std::vector< te::se::Rule * > m_legend
Rule items.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
TerraLib.
#define slots
Proxy configuration file for TerraView (see terraview_config.h).