27 #include "../../../se/PolygonSymbolizer.h"
32 #include "ui_PolygonSymbolizerWidgetForm.h"
35 #include <QtGui/QStackedWidget>
44 m_ui(new Ui::PolygonSymbolizerWidgetForm),
45 m_symb(new te::se::PolygonSymbolizer)
49 m_ui->m_mainLayout->setAlignment(Qt::AlignTop);
55 QGridLayout* fillLayout =
new QGridLayout(
m_ui->m_fillGroupBox);
57 fillLayout->setAlignment(Qt::AlignTop);
60 std::vector<std::string> keys;
62 std::vector<std::string>::iterator it;
63 for(it = keys.begin(); it != keys.end(); ++it)
75 QGridLayout* strokeLayout =
new QGridLayout(
m_ui->m_strokeGroupBox);
77 strokeLayout->setAlignment(Qt::AlignTop);
109 return m_symb->
clone();
117 m_strokeWidget->setStroke(stroke);
118 m_ui->m_strokeGroupBox->setChecked(
true);
121 m_ui->m_strokeGroupBox->setChecked(
false);
126 m_ui->m_fillGroupBox->setChecked(
false);
132 for(i = 0; i < m_fillWidgets->count(); ++i)
139 if(i == m_fillWidgets->count())
143 m_ui->m_polygonSymbolizerTypeComboBox->setCurrentIndex(i);
144 m_fillWidgets->setCurrentIndex(i);
149 m_fillWidgets->setCurrentIndex(index);
154 emit symbolizerChanged();
159 m_symb->setStroke(m_strokeWidget->getStroke());
160 emit symbolizerChanged();
166 m_symb->setStroke(0);
168 m_symb->setStroke(m_strokeWidget->getStroke());
170 emit symbolizerChanged();
178 emit symbolizerChanged();
191 emit symbolizerChanged();
void setStroke(Stroke *stroke)
A Stroke specifies the appearance of a linear geometry.
A widget used to build a basic stroke element.
A Fill specifies the pattern for filling an area geometry.
virtual QString getFillType() const =0
Pure virtual method that should return a "user friendly" string that informs the fill type that can b...
A widget used to build a polygon symbolizer element.
void setSymbolizer(const te::se::PolygonSymbolizer *symb)
Sets a polygon symbolizer element to this widget.
virtual te::se::Fill * getFill() const =0
Gets the configured fill element.
te::se::Stroke * getStroke() const
Gets the configured stroke element.
A Symbolizer describes how a feature is to appear on a map.
A PolygonSymbolizer is used to draw a polygon (or other area-type geometries), including filling its ...
The abstract factory of widgets used to configure Symbology Enconding Fill element.
A Stroke specifies the appearance of a linear geometry.
void updateUi()
Updates the widget form based on internal polygon symbolizer element.
static AbstractFillWidget * make(const std::string &factoryKey)
It creates an object with the appropriated factory.
QStackedWidget * m_fillWidgets
Set of Fill Widgets that can be used to configure the polygon symbolizer element. TODO: need review! ...
~PolygonSymbolizerWidget()
Destructor.
te::qt::widgets::BasicStrokeWidget * m_strokeWidget
Basic Stroke Widget used to configure the polygon symbolizer stroke element.
A widget used to build a basic stroke element.
virtual bool setFill(const te::se::Fill *fill)=0
Sets a fill element to this widget.
Symbolizer * clone() const
It creates a new copy of this object.
virtual Symbolizer * clone() const =0
It creates a new copy of this object.
std::auto_ptr< Ui::PolygonSymbolizerWidgetForm > m_ui
Widget form.
void onPolygonSymbolizerTypeComboBoxCurrentIndexChanged(int index)
void onFillGroupBoxToggled(bool on)
void setFill(Fill *f)
A Fill specifies the pattern for filling an area geometry.
te::se::PolygonSymbolizer * m_symb
Polygon symbolizer element that will be configured by this widget.
void onStrokeGroupBoxToggled(bool on)
PolygonSymbolizerWidget(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a polygon symbolizer widget which is a child of parent, with widget flags set to f...
static void RegisteredWidgets(std::vector< std::string > &keys)
It informs the key of each registered fill widget factory.
te::se::Symbolizer * getSymbolizer() const
Gets the configured polygon symbolizer element.
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. ...