PolygonSymbolizerWidget.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/PolygonSymbolizerWidget.h
22 
23  \brief A widget used to build a polygon symbolizer element.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_POLYGONSYMBOLIZERWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_POLYGONSYMBOLIZERWIDGET_H
28 
29 // TerraLib
30 #include "../Config.h"
31 
32 // Qt
33 #include <QWidget>
34 
35 // STL
36 #include <memory>
37 
38 // Forward declaraion
39 class QStackedWidget;
40 namespace Ui { class PolygonSymbolizerWidgetForm; }
41 
42 namespace te
43 {
44 // Forward declarations
45  namespace se
46  {
47  class PolygonSymbolizer;
48  class Symbolizer;
49  }
50 
51  namespace qt
52  {
53  namespace widgets
54  {
55 // Forward declarations
56  class BasicStrokeWidget;
57 
58  /*!
59  \class PolygonSymbolizerWidget
60 
61  \brief A widget used to build a polygon symbolizer element.
62  */
64  {
65  Q_OBJECT
66 
67  public:
68 
69  /** @name Initializer Methods
70  * Methods related to instantiation and destruction.
71  */
72  //@{
73 
74  /*! \brief Constructs a polygon symbolizer widget which is a child of parent, with widget flags set to f. */
75  PolygonSymbolizerWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
76 
77  /*! \brief Destructor. */
79 
80  //@}
81 
82  public:
83 
84  /*!
85  \brief Sets a polygon symbolizer element to this widget.
86 
87  \param symb A valid polygon symbolizer element.
88 
89  \note The widget will NOT take the ownership of the given symbolizer.
90  \note The widget form will be update based on given symbolizer parameters.
91  */
92  void setSymbolizer(const te::se::PolygonSymbolizer* symb);
93 
94  /*!
95  \brief Gets the configured polygon symbolizer element.
96 
97  \return The configured polygon symbolizer element.
98 
99  \note The caller will take the ownership of the returned symbolizer.
100  */
101  te::se::Symbolizer* getSymbolizer() const;
102 
103  protected:
104 
105  /*! \brief Updates the widget form based on internal polygon symbolizer element. */
106  void updateUi();
107 
108  protected slots:
109 
110  void onPolygonSymbolizerTypeComboBoxCurrentIndexChanged(int index);
111 
112  void onStrokeChanged();
113 
114  void onStrokeGroupBoxToggled(bool on);
115 
116  void onFillChanged();
117 
118  void onFillGroupBoxToggled(bool on);
119 
120  signals:
121 
122  /*! This signal is emitted when the internal polygon symbolizer element is changed. */
123  void symbolizerChanged();
124 
125  private:
126 
127  std::auto_ptr<Ui::PolygonSymbolizerWidgetForm> m_ui; //!< Widget form.
128  QStackedWidget* m_fillWidgets; //!< Set of Fill Widgets that can be used to configure the polygon symbolizer element. TODO: need review!
129  te::qt::widgets::BasicStrokeWidget* m_strokeWidget; //!< Basic Stroke Widget used to configure the polygon symbolizer stroke element.
130  te::se::PolygonSymbolizer* m_symb; //!< Polygon symbolizer element that will be configured by this widget.
131  };
132 
133  } // end namespace widgets
134  } // end namespace qt
135 } // end namespace te
136 
137 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_POLYGONSYMBOLIZERWIDGET_H
std::auto_ptr< Ui::PolygonSymbolizerWidgetForm > m_ui
Widget form.
A PolygonSymbolizer is used to draw a polygon (or other area-type geometries), including filling its ...
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
A widget used to build a basic stroke element.
te::qt::widgets::BasicStrokeWidget * m_strokeWidget
Basic Stroke Widget used to configure the polygon symbolizer stroke element.
URI C++ Library.
A widget used to build a polygon symbolizer element.
QStackedWidget * m_fillWidgets
Set of Fill Widgets that can be used to configure the polygon symbolizer element. TODO: need review! ...
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
te::se::PolygonSymbolizer * m_symb
Polygon symbolizer element that will be configured by this widget.