35 #include "../../../maptools/CanvasConfigurer.h"
36 #include "../../../se/Symbolizer.h"
37 #include "../../../se/Style.h"
38 #include "../../../se/Rule.h"
39 #include "../../../geometry/Polygon.h"
40 #include "../../../geometry/Geometry.h"
41 #include "../../../geometry/Envelope.h"
46 m_borderDisplacement(2),
47 m_displacementBetweenSymbols(2),
48 m_displacementBetweenTitleAndSymbols(5),
49 m_displacementBetweenSymbolsAndText(3)
78 drawLegend(canvas, utils);
85 notifyAll(contextNotify);
93 if(!m_layer->getStyle())
97 std::size_t nRules = m_layer->getStyle()->getRules().size();
100 std::string layerName = m_layer->getTitle();
109 canvas->
drawText(m_box.getCenter().x - wtxt, m_box.getUpperRightY() - htxt, layerName, 0);
114 for(std::size_t i = 0; i < nRules; ++i)
121 const std::vector<te::se::Symbolizer*>& symbolizers = rule->
getSymbolizers();
123 if(symbolizers.empty())
128 std::size_t nSymbolizers = symbolizers.size();
130 for(std::size_t j = 0; j < nSymbolizers; ++j)
139 te::gm::Envelope box(m_box.getLowerLeftX(), m_box.getUpperRightY() - 20, m_box.getLowerLeftX() + 10, m_box.getUpperRightY() - 10);
144 std::string* name =
const_cast<std::string*
>(rule->
getName());
145 std::string n = symb->
getName();
147 canvas->
drawText(m_box.getLowerLeftX() + 15, m_box.getUpperRightY() - 20, name->c_str(), 0);
159 pro_mapName.
setName(m_sharedProps->getMapName());
160 pro_mapName.
setId(
"");
166 m_properties->addProperty(pro_mapName);
199 notifyAll(contextNotify);
205 m_borderDisplacement = value;
210 return m_borderDisplacement;
215 m_displacementBetweenSymbols = value;
220 return m_displacementBetweenSymbols;
225 m_displacementBetweenTitleAndSymbols = value;
230 return m_displacementBetweenTitleAndSymbols;
235 m_displacementBetweenSymbolsAndText = value;
240 return m_displacementBetweenSymbolsAndText;
virtual double getDisplacementBetweenTitleAndSymbols()
void setPixmap(te::color::RGBAColor **pixmap)
void addOption(Variant variant)
virtual void textBoundingBox(double &w, double &h, std::string txt)
A Symbolizer describes how a feature is to appear on a map.
virtual void setDisplacementBetweenTitleAndSymbols(double value)
virtual void setPolygonFillColor(const te::color::RGBAColor &color)=0
It sets the color used to fill the draw of polygon geometries.
virtual void drawRectW(te::gm::Envelope box)
virtual void drawText(int x, int y, const std::string &txt, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)=0
It draws a text.
Variant getOptionByCurrentChoice()
virtual void configCanvas(te::gm::Envelope box, bool resize=true)
virtual void updateProperties(te::layout::Properties *properties)
void setValue(typename ValueType value, LayoutPropertyDataType type)
void setValue(typename ValueType value, LayoutPropertyDataType type)
An Envelope defines a 2D rectangular region.
const std::string & getName() const
virtual double getDisplacementBetweenSymbols()
virtual te::map::AbstractLayerPtr getLayer()
virtual void setTextColor(const te::color::RGBAColor &color)=0
It sets the text drawing color.
virtual Properties * getProperties() const
virtual void setPolygonContourWidth(int w)=0
It sets the polygon contour width.
virtual void setDisplacementBetweenSymbolAndText(double value)
const std::vector< Symbolizer * > & getSymbolizers() const
virtual void draw(ContextItem context)
virtual void setDisplacementBetweenSymbols(double value)
A canvas is an abstraction of a drawing area.
virtual Properties * getProperties() const
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
virtual void drawLegend(te::map::Canvas *canvas, Utils *utils)
virtual double getBorderDisplacement()
virtual void visitDependent()
virtual te::color::RGBAColor ** getImageW(te::gm::Envelope boxmm)
virtual void setPolygonContourColor(const te::color::RGBAColor &color)=0
It sets the pen color used to draw the boundary of polygon geometries.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
void setName(std::string name)
static Context * getInstance()
This function is called to create an instance of the class.
void setId(std::string id)
virtual bool contains(Property property)
virtual double getDisplacementBetweenSymbolAndText()
te::map::Canvas * getCanvas()
virtual void setBorderDisplacement(double value)
virtual void updateProperties(te::layout::Properties *properties)
virtual void setTextPointSize(double size)=0
It sets the text point Size.
const std::string * getName() const