35 #include "../../../geometry/Polygon.h"
66 drawScale(canvas, utils, m_box);
82 notifyAll(contextNotify);
88 std::string strUnit=
"(Km)";
101 double mmToCm = m_scaleGapX/10;
103 double spacing = m_mapScale/100;
133 value += (spacing * mmToCm)/unit;
135 std::stringstream ss_value;
138 std::string s_value = ss_value.str();
141 changeColor = firtRect;
142 firtRect = secondRect;
143 secondRect = changeColor;
148 double centerX = m_box.getCenter().x;
149 double centerY = m_box.getCenter().y;
160 pro_widthRectGap.
setName(
"scale_width_rect_gap");
161 pro_widthRectGap.
setId(
"");
163 m_properties->addProperty(pro_widthRectGap);
166 pro_heightRectGap.
setName(
"scale_height_rect_gap");
167 pro_heightRectGap.
setId(
"");
169 m_properties->addProperty(pro_heightRectGap);
172 pro_mapName.
setName(m_sharedProps->getMapName());
173 pro_mapName.
setId(
"");
178 m_properties->addProperty(pro_mapName);
198 if(!pro_widthRectGap.
isNull())
203 Property pro_heightRectGap = vectorProps->
contains(
"scale_height_rect_gap");
205 if(!pro_heightRectGap.
isNull())
225 notifyAll(contextNotify);
virtual double getScaleGapX()
virtual double getScale()
virtual void setScaleGapY(double y)
void setPixmap(te::color::RGBAColor **pixmap)
void addOption(Variant variant)
virtual void draw(ContextItem context)
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)
const double & getUpperRightX() const
It returns a constant refernce to the x coordinate of the upper right corner.
virtual void updateProperties(te::layout::Properties *properties)
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()
const double & getLowerLeftY() const
It returns a constant refernce to the y coordinate of the lower left corner.
virtual void configCanvas(te::gm::Envelope box, bool resize=true)
const double & getUpperRightY() const
It returns a constant refernce to the x coordinate of the upper right corner.
virtual void setScaleGapX(double x)
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.
virtual void setTextColor(const te::color::RGBAColor &color)=0
It sets the text drawing color.
virtual void setPolygonContourWidth(int w)=0
It sets the polygon contour width.
A canvas is an abstraction of a drawing area.
virtual Properties * getProperties() const
virtual te::color::RGBAColor ** getImageW(te::gm::Envelope boxmm)
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
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.
virtual double getScaleGapY()
virtual Properties * getProperties() const
void setName(std::string name)
static Context * getInstance()
This function is called to create an instance of the class.
virtual void visitDependent()
void setId(std::string id)
virtual void drawScale(te::map::Canvas *canvas, Utils *utils, te::gm::Envelope box)
virtual bool contains(Property property)
te::map::Canvas * getCanvas()