29 #include "../../../se/Fill.h"
30 #include "../../../color.h"
31 #include "../../../maptools/Utils.h"
33 #include "../../../../../third-party/qt/propertybrowser/qtpropertybrowser.h"
40 m_fill(new te::se::Fill)
58 addProperty(basicFillProperty, tr(
"Basic Fill"), QColor(255, 255, 175));
68 if(p == m_opacityProperty)
70 double opacity = value / 100.0;
72 m_color.setAlpha(opacity * 255);
76 m_fill->setOpacity(QString::number(opacity,
'g', 2).toStdString());
83 if(p == m_colorProperty)
86 m_color.setRgb(value.red(), value.green(), value.blue(), m_color.alpha());
91 m_fill->setColor(m_color.name().toStdString());
107 m_fill = fill->
clone();
116 return m_fill->
clone();
124 m_color = QColor(rgba.
getRgba());
TEMAPEXPORT void GetColor(const te::se::Stroke *stroke, te::color::RGBAColor &color)
Gets the RGBA color from Stroke element.
A Fill specifies the pattern for filling an area geometry.
QtIntPropertyManager * m_intSliderManager
te::se::Fill * getFill() const
void getRgba(int *r, int *g, int *b, int *a=0) const
It gets the color value.
QtColorPropertyManager * m_colorManager
const Graphic * getGraphicFill() const
Gets the GraphicFill element associate to this Fill.
Fill * clone() const
It creates a new copy of this object.
bool setFill(const te::se::Fill *fill)
A widget used to define the basic fill se object.
QtProperty * m_opacityProperty
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
#define TE_SE_DEFAULT_FILL_BASIC_COLOR
It specifies the default color used by basic fill (solid colors).
QtProperty * m_colorProperty
~BasicFillPropertyItem()
Destructor.
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
void updateUiFillColor()
Updates the widget form element used to visualize the fill color.
A widget used to define the main property items that can be used to describe a se object...
BasicFillPropertyItem(QtTreePropertyBrowser *pb, QColor c=QColor())
Constructor.
void addProperty(QtProperty *property, const QString &id, QColor c)
static AbstractPropertyManager & getInstance()
It returns a reference to the singleton instance.
virtual void valueChanged(QtProperty *p, int value)
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
int getAlpha() const
It returns the alpha component color value (a value from 0 to 255).
void updateUi()
Updates the widget form based on internal fill element.