27 #include "../../../raster/Utils.h" 28 #include "../../../se/Config.h" 29 #include "../../../se/Stroke.h" 30 #include "../../../se/SvgParameter.h" 31 #include "../../../se/Utils.h" 32 #include "../../../maptools/Utils.h" 33 #include "../../../maptools/Enums.h" 34 #include "../propertybrowser/AbstractPropertyManager.h" 42 #include <QtPropertyBrowser/QtTreePropertyBrowser> 43 #include <QtPropertyBrowser/QtVariantPropertyManager> 50 m_stroke(new
te::se::Stroke)
95 addProperty(basicStrokeProperty, tr(
"Basic Stroke"), QColor(175, 255, 175));
126 QColor c = QColor(rgba.
getRgba());
150 for(
size_t t = 0; t <
m_dashes.size(); ++t)
170 std::map<int, std::string>::iterator it =
m_joinMap.begin();
174 if(it->second == joinStr)
193 std::map<int, std::string>::iterator it =
m_capMap.begin();
197 if(it->second == capStr)
222 double opacity = value / 255.;
240 std::string pattern =
m_dashes[value];
304 m_color.setRgb(value.red(), value.green(), value.blue(), value.alpha());
306 double alpha = value.alpha() / 255.;
322 QMap<int, QIcon> map;
328 QLine
line(0, size.height() * 0.5, size.width(), size.height() * 0.5);
334 int dSize =
static_cast<int>(
m_dashes.size());
336 for(
int t = 0; t < dSize; ++t)
338 QPixmap pixmap(size);
339 pixmap.fill(Qt::transparent);
341 QPainter painter(&pixmap);
344 std::vector<double> dasharray;
347 QVector<qreal> qdasharray = QVector<qreal>::fromStdVector(dasharray);
349 pen.setDashPattern(qdasharray);
351 painter.drawLine(line);
363 QMap<int, QIcon> map;
365 map[0] = QIcon::fromTheme(
"stroke-join-miter").pixmap(16,16);
366 map[1] = QIcon::fromTheme(
"stroke-join-round").pixmap(16,16);
367 map[2] = QIcon::fromTheme(
"stroke-join-bevel").pixmap(16,16);
374 QMap<int, QIcon> map;
376 map[0] = QIcon::fromTheme(
"stroke-cap-butt").pixmap(16,16);
377 map[1] = QIcon::fromTheme(
"stroke-cap-round").pixmap(16,16);
378 map[2] = QIcon::fromTheme(
"stroke-cap-square").pixmap(16,16);
393 for(
size_t t = 0; t <
m_dashes.size(); ++t)
Stroke * clone() const
It creates a new copy of this object.
void getRgba(int *r, int *g, int *b, int *a=0) const
It gets the color value.
const SvgParameter * getLineCap() const
TESEEXPORT void GetColor(const te::se::Stroke *stroke, te::color::RGBAColor &color)
It gets the RGBA color from the Stroke element.
void setWidth(const std::string &width)
const SvgParameter * getLineJoin() const
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
TESEEXPORT double GetDouble(const te::se::ParameterValue *param)
It gets the parameter value as a double.
void setDashArray(const std::string &dasharray)
void setColor(const std::string &color)
#define TE_SE_BEVEL_JOIN
It specifies the value "bevel" for stroke-linejoin parameter.
void setOpacity(const std::string &opacity)
const SvgParameter * getOpacity() const
TEMAPEXPORT void GetDashStyle(const std::string &dasharray, std::vector< double > &style)
Converts a dasharray pattern coded by a string to a vector of double.
static AbstractPropertyManager & getInstance()
It returns a reference to the singleton instance.
A widget used to define the basic fill se object.
#define TE_SE_BUTT_CAP
It specifies the value "butt" for stroke-linecap parameter.
TERASTEREXPORT int Round(double val)
Round a double value to a integer value.
void setLineCap(const std::string &cap)
#define TE_SE_SQUARE_CAP
It specifies the value "square" for stroke-linecap parameter.
#define TE_SE_ROUND_JOIN
It specifies the value "round" for stroke-linejoin parameter.
#define TE_SE_ROUND_CAP
It specifies the value "round" for stroke-linecap parameter.
void setLineJoin(const std::string &join)
const SvgParameter * getDashArray() const
A Stroke specifies the appearance of a linear geometry.
#define TE_SE_MITRE_JOIN
It specifies the value "mitre" for stroke-linejoin parameter.
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).
#define TE_SE_DEFAULT_STROKE_BASIC_COLOR
It specifies the default color used by stroke basic (solid colors).
A SvgParameter refers to an SVG/CSS graphical-formatting parameter.
TESEEXPORT std::string GetString(const te::se::ParameterValue *param)
It gets the parameter value as a string.
const SvgParameter * getWidth() const