27 #include "../common/StringUtils.h"
28 #include "../common/STLUtils.h"
29 #include "../fe/Literal.h"
30 #include "../se/ExternalGraphic.h"
31 #include "../se/Fill.h"
32 #include "../se/Font.h"
33 #include "../se/Graphic.h"
34 #include "../se/GraphicStroke.h"
35 #include "../se/Halo.h"
36 #include "../se/LineSymbolizer.h"
37 #include "../se/PointSymbolizer.h"
38 #include "../se/PolygonSymbolizer.h"
39 #include "../se/Stroke.h"
40 #include "../se/SvgParameter.h"
41 #include "../se/Symbolizer.h"
42 #include "../se/TextSymbolizer.h"
43 #include "../xlink/SimpleLink.h"
104 configDefaultPolygon();
109 config(stroke,
false);
140 configDefaultPoint();
156 m_canvas->setTextColor(color);
192 m_canvas->setTextContourEnabled(
true);
198 m_canvas->setTextContourColor(haloColor);
205 m_canvas->setTextContourWidth(width);
228 fromLineSymbolizer ? m_canvas->setLineColor(color) : m_canvas->setPolygonContourColor(color);
240 std::map<std::string, te::map::LineCapStyle>::iterator it = sm_lineCapMap.find(
te::map::GetString(linecap));
241 if(it != sm_lineCapMap.end())
242 fromLineSymbolizer ? m_canvas->setLineCapStyle(it->second) : m_canvas->setPolygonContourCapStyle(it->second);
249 std::map<std::string, te::map::LineJoinStyle>::iterator it = sm_lineJoinMap.find(
te::map::GetString(linejoin));
250 if(it != sm_lineJoinMap.end())
251 fromLineSymbolizer ? m_canvas->setLineJoinStyle(it->second) : m_canvas->setPolygonContourJoinStyle(it->second);
259 std::vector<double> pattern;
261 fromLineSymbolizer ? m_canvas->setLineDashStyle(pattern) : m_canvas->setPolygonContourDashStyle(pattern);
281 m_canvas->setPolygonFillColor(color);
304 std::size_t width = height;
332 const std::vector<te::se::Mark*> marks = graphic->
getMarks();
342 m_canvas->setPolygonFillPattern(rgba, width, height);
343 m_canvas->setPolygonPatternRotation(angle);
344 m_canvas->setPolygonPatternOpacity(alpha);
349 m_canvas->setPolygonContourPattern(rgba, width, height);
350 m_canvas->setPolygonContourPatternRotation(angle);
351 m_canvas->setPolygonContourPatternOpacity(alpha);
356 m_canvas->setLinePattern(rgba, width, height);
357 m_canvas->setLinePatternRotation(angle);
358 m_canvas->setLinePatternOpacity(alpha);
363 m_canvas->setPointPattern(rgba, width, height);
364 m_canvas->setPointPatternRotation(angle);
365 m_canvas->setPointPatternOpacity(alpha);
A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line seg...
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
const SvgParameter * getLineJoin() const
#define TE_SE_DEFAULT_HALO_RADIUS
It specifies the default halo radius (in pixels).
#define TE_SE_DEFAULT_GRAPHIC_SIZE
It specifies the default graphic size.
TEMAPEXPORT void GetColor(const te::se::Stroke *stroke, te::color::RGBAColor &color)
Gets the RGBA color from Stroke element.
const Fill * getFill() const
A Fill specifies the pattern for filling an area geometry.
TEMAPEXPORT int GetInt(const te::se::ParameterValue *param)
Gets the parameter value as integer.
#define TE_SE_ROUND_CAP
It specifies the value "round" for stroke-linecap parameter.
#define TE_SE_ROUND_JOIN
It specifies the value "round" for stroke-linejoin parameter.
const SvgParameter * getWidth() const
The FeatureTypeStyle defines the styling that is to be applied to a dataset that can be viewed as a f...
void configDefaultPoint()
Configs the canvas with default values for point styles.
void visit(const te::se::Style &visited)
void configDefaultPolygon()
Configs the canvas with default values for polygon styles.
te::color::RGBAColor ** render(const te::se::Mark *mark, std::size_t size)
It generates the image pattern from the given Symbology Enconding Mark element.
const SvgParameter * getLineCap() const
te::color::RGBAColor ** render(const te::se::ExternalGraphic *eg, std::size_t height, std::size_t &width)
It generates the image pattern from the given Symbology Enconding External Graphic element...
Utility functions for MapTools module.
A canvas is an abstraction of a drawing area.
#define TE_SE_BUTT_CAP
It specifies the value "butt" for stroke-linecap parameter.
#define TE_SE_DEFAULT_TEXT_COLOR
It specifies the default color used to show texts.
void configDefaultText()
Configs the canvas with default values for text styles.
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 ...
void config(const te::se::Symbolizer *symbolizer)
It configs the canvas based on given symbolizer.
A Stroke specifies the appearance of a linear geometry.
const Graphic * getGraphicFill() const
Gets the GraphicFill element associate to this Fill.
TEMAPEXPORT double GetDouble(const te::se::ParameterValue *param)
Gets the parameter value as double.
The CoverageStyle defines the styling that is to be applied to a subset of Coverage data...
#define TE_SE_DEFAULT_STROKE_BASIC_WIDTH
It specifies the default width used by stroke basic (solid colors).
static std::map< std::string, te::map::LineCapStyle > sm_lineCapMap
A map that associates stroke-linecap value to the correct LineCapStyle.
const SvgParameter * getSize() const
const SvgParameter * getDashArray() const
#define TE_TRANSPARENT
For an RGBA color this is the value of the alpha-channel for totally transparent. ...
const SvgParameter * getWeight() const
static std::map< std::string, te::map::LineJoinStyle > sm_lineJoinMap
A map that associates stroke-linejoin value to the correct LineJoinStyle.
TEMAPEXPORT void GetDashStyle(const std::string &dasharray, std::vector< double > &style)
Converts a dasharray pattern coded by a string to a vector of double.
ConfigStyle
Internal enum that indicates which style that should be configured.
const Stroke * getStroke() const
const ParameterValue * getRadius() const
const Font * getFont() const
const Stroke * getStroke() const
Gets the Stroke associates with the PolygonSymbolizer.
A PointSymbolizer specifies the rendering of a graphic Symbolizer at a point.
#define TE_SE_SQUARE_CAP
It specifies the value "square" for stroke-linecap parameter.
const Halo * getHalo() const
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
A Font specifies the text font to use in a text symbolizer.
const Graphic * getGraphic() const
A TextSymbolizer is used to render text labels according to various graphical parameters.
TEMAPEXPORT std::string GetString(const te::se::ParameterValue *param)
Gets the parameter value as string.
A Symbology Enconding visitor that configures a given canvas based on symbolizers elements...
const Fill * getFill() const
#define TE_SE_DEFAULT_FONT_SIZE
It specifies the default font size.
#define TE_SE_DEFAULT_STROKE_BASIC_COLOR
It specifies the default color used by stroke basic (solid colors).
#define TE_SE_BEVEL_JOIN
It specifies the value "bevel" for stroke-linejoin parameter.
#define TE_SE_MITRE_JOIN
It specifies the value "mitre" for stroke-linejoin parameter.
#define TE_SE_DEFAULT_FILL_BASIC_COLOR
It specifies the default color used by basic fill (solid colors).
A Halo is a type of Fill that is applied to the backgrounds of font glyphs.
#define TE_SE_DEFAULT_HALO_COLOR
It specifies the default color used to show text halo.
This is a singleton for managing all mark renderers instances available in the system.
const ParameterValue * getOpacity() const
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
~CanvasConfigurer()
Destructor.
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
void Free(std::vector< T * > *v)
This function can be applied to a pointer to a vector of pointers.
const SvgParameter * getStyle() const
CanvasConfigurer(Canvas *canvas)
Constructor.
const ParameterValue * getSize() const
const Fill * getFill() const
Gets the Fill associates with the PolygonSymbolizer.
virtual ReturnType accept(VisitorType &guest) const =0
It call the visit method from the guest object.
const Graphic * getGraphicFill() const
Gets the GraphicFill element associate to this Stroke.
const ParameterValue * getRotation() const
const std::vector< ExternalGraphic * > getExternalGraphics() const
static ExternalGraphicRendererManager & getInstance()
It returns a reference to the singleton instance.
const SvgParameter * getFamily() const
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
A SvgParameter refers to an SVG/CSS graphical-formatting parameter.
The "ParameterValueType" uses WFS-Filter expressions to give values for SE graphic parameters...
void configDefaultLine()
Configs the canvas with default values for line styles.
const std::vector< Mark * > getMarks() const
This is a singleton for managing all external graphic renderers instances available in the system...