Loading...
Searching...
No Matches
BasicFillWidget.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/BasicFillWidget.h
22
23 \brief A widget used to build a basic fill element.
24*/
25
26#ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_BASICFILLWIDGET_H
27#define __TERRALIB_QT_WIDGETS_SE_INTERNAL_BASICFILLWIDGET_H
28
29// TerraLib
30#include "../Config.h"
31#include "AbstractFillWidget.h"
32
33// STL
34#include <memory>
35
36// Forward declaraion
37namespace Ui { class BasicFillWidgetForm; }
38
39namespace te
40{
41// Forward declarations
42 namespace se
43 {
44 class Fill;
45 }
46
47 namespace qt
48 {
49 namespace widgets
50 {
51// Forward declarations
52 class ColorPickerToolButton;
53
54 /*!
55 \class BasicFillWidget
56
57 \brief A widget used to build a basic fill element.
58
59 \sa AbstractFillWidget, GraphicFillWidget
60 */
62 {
63 Q_OBJECT
64
65 public:
66
67 /** @name Initializer Methods
68 * Methods related to instantiation and destruction.
69 */
70 //@{
71
72 /*! \brief Constructs a basic fill widget which is a child of parent, with widget flags set to f. */
73 BasicFillWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
74
75 /*! \brief Destructor. */
77
78 //@}
79
80 public:
81
82 /** @name Re-implementation of Pure Virtual Method
83 * AbstractFillWidget methods.
84 */
85 //@{
86
87 bool setFill(const te::se::Fill* fill);
88
90
91 QString getFillType() const;
92
93 //@}
94
95 protected:
96
97 /*! \brief Internal method to initialize the widget (e.g.: color, combos, icons, etc.) */
98 void initialize();
99
100 /*! \brief Updates the widget form based on internal fill element. */
101 void updateUi();
102
103 /*! \brief Updates the widget form element used to visualize the fill color. */
105
106 protected slots:
107
108 void onColorChanged(const QColor& color);
109
111
112 signals:
113
114 /*! This signal is emitted when the internal fill element is changed. */
116
117 private:
118
119 std::unique_ptr<Ui::BasicFillWidgetForm> m_ui; //!< Widget form.
120 ColorPickerToolButton* m_colorPicker; //!< Widget used to pick a color.
121 QColor m_color; //!< Auxiliary color attribute.
122 te::se::Fill* m_fill; //!< Fill element that will be configured by this widget.
123 };
124
125 } // end namespace widgets
126 } // end namespace qt
127} // end namespace te
128
129#endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_BASICFILLWIDGET_H
Abstract class that represents a widget that can be used to build a fill element.
Abstract class that represents a widget that can be used to build a fill element.
A widget used to build a basic fill element.
void initialize()
Internal method to initialize the widget (e.g.: color, combos, icons, etc.)
void onFillOpacitySliderValueChanged(int value)
std::unique_ptr< Ui::BasicFillWidgetForm > m_ui
Widget form.
void updateUiFillColor()
Updates the widget form element used to visualize the fill color.
BasicFillWidget(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a basic fill widget which is a child of parent, with widget flags set to f.
QString getFillType() const
Pure virtual method that should return a "user friendly" string that informs the fill type that can b...
bool setFill(const te::se::Fill *fill)
Sets a fill element to this widget.
ColorPickerToolButton * m_colorPicker
Widget used to pick a color.
void updateUi()
Updates the widget form based on internal fill element.
te::se::Fill * m_fill
Fill element that will be configured by this widget.
te::se::Fill * getFill() const
Gets the configured fill element.
QColor m_color
Auxiliary color attribute.
void onColorChanged(const QColor &color)
Custom tool button used to pick a color.
A Fill specifies the pattern for filling an area geometry.
Definition: Fill.h:60
TerraLib.
#define slots
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63