StyleControllerWidget.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/StyleControllerWidget.h
22 
23  \brief A widget used to controll the style se element.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_STYLECONTROLLERWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_STYLECONTROLLERWIDGET_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../maptools/AbstractLayer.h"
32 #endif
33 #include "../Config.h"
34 
35 // Qt
36 #include <QWidget>
37 
38 // STL
39 #include <memory>
40 #include <string>
41 #include <vector>
42 
43 // Forward declaraion
44 namespace Ui { class StyleControllerWidgetForm; }
45 
46 namespace te
47 {
48 // Forward declarations
49  namespace se
50  {
51  class Style;
52  class Symbolizer;
53  class Rule;
54  }
55 
56  namespace qt
57  {
58  namespace widgets
59  {
60 // Forward declarations
61  class StyleExplorer;
62 
63  /*!
64  \class StyleControllerWidget
65 
66  \brief A widget used to controll the style se element.
67  */
69  {
70  Q_OBJECT
71 
72  public:
73 
74  /** @name Initializer Methods
75  * Methods related to instantiation and destruction.
76  */
77  //@{
78 
79  /*! \brief Constructs a StyleControllerWidget which is a child of parent, with widget flags set to f. */
80  StyleControllerWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
81 
82  /*! \brief Destructor. */
84 
85  //@}
86 
87  public:
88 
89  /*!
90  \brief Sets a style element to this widget.
91 
92  \param style A valid style element.
93 
94  \note The widget will NOT take the ownership of the given style.
95  \note The widget will be update based on given style parameters.
96  */
97  void setStyle(te::se::Style* style);
98 
99  void setLayer(te::map::AbstractLayer* layer, std::string selColor);
100 
101  StyleExplorer* getStyleExplorer() const;
102 
103  void writeStyle(const te::se::Style* style, std::string path);
104 
105  void readStyle(std::string path);
106 
107  void clear();
108 
109  private:
110 
111  bool checkSymbolizer(std::string file);
112 
113  protected slots:
114 
115  void onAddTextSymbolizerClicked();
116 
117  void onAddSymbolizerClicked();
118 
119  void onRemoveSymbolizerClicked();
120 
121  void onUpSymbolizerClicked();
122 
123  void onDownSymbolizerClicked();
124 
125  void onLibraryManagerClicked();
126 
127  void onExportClicked();
128 
129  void onImportClicked();
130 
131  void onMapRefreshClicked();
132 
133  void changeLegendIconSize(int size);
134 
135  void onVisualStyleChecked(bool state);
136 
137  void onSelectionStyleChecked(bool state);
138 
139  signals:
140 
141  void mapRefresh();
142 
143  private:
144 
145  std::unique_ptr<Ui::StyleControllerWidgetForm> m_ui; //!< Widget form.
146  te::se::Style* m_currentStyle; //!< current style.
147 
148  te::map::AbstractLayer* m_currentLayer; //!< Current Layer pointer (used for raster symbolizer information)
149  };
150 
151  } // end namespace widgets
152  } // end namespace qt
153 } // end namespace te
154 
155 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_STYLECONTROLLERWIDGET_H
#define slots
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Definition: Style.h:65
This is the base class for layers.
Definition: AbstractLayer.h:77
std::unique_ptr< Ui::StyleControllerWidgetForm > m_ui
Widget form.
A widget used to explore a style.
Definition: StyleExplorer.h:60
te::map::AbstractLayer * m_currentLayer
Current Layer pointer (used for raster symbolizer information)
A widget used to controll the style se element.
URI C++ Library.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
te::se::Style * m_currentStyle
current style.