35 #include "../../../maptools/Canvas.h"
36 #include "../../../geometry/Envelope.h"
37 #include "../../../geometry/Point.h"
38 #include "../../../color/RGBAColor.h"
64 drawRuler(canvas, utils);
71 notifyAll(contextNotify);
85 drawRectW(m_box, colorp4, canvas, utils);
88 drawRectW(m_backEndBox, colorp85, canvas, utils);
90 envPaper =
te::gm::Envelope(m_paperBox.getLowerLeftX(), m_backEndBox.getLowerLeftY(),
91 m_paperBox.getUpperRightX(), m_backEndBox.getUpperRightY());
94 drawRectW(envPaper, colorp5, canvas, utils);
99 drawHorizontalRuler(canvas, utils);
101 envMargin =
te::gm::Envelope(m_backEndBox.getLowerLeftX(), m_backEndBox.getUpperRightY() - m_lineMargin,
102 m_backEndBox.getWidth(), m_backEndBox.getUpperRightY() - m_lineMargin);
104 drawLineW(envMargin, utils);
112 double llx = m_backEndBox.getLowerLeftX();
113 double urx = m_backEndBox.getUpperRightX();
117 for(
int i = (
int)llx ; i < (int) urx ; ++i)
119 if((i % (
int)m_blockSize) == 0)
121 box =
te::gm::Envelope(i, m_backEndBox.getUpperRightY(), i, m_backEndBox.getUpperRightY() - m_longLine);
122 drawLineW(box, utils);
124 std::stringstream ss;
127 canvas->
drawText((
double)i, m_backEndBox.getUpperRightY() - (m_longLine + 1.), ss.str(), 0);
129 else if((i % (
int)m_middleBlockSize) == 0)
131 box =
te::gm::Envelope(i, m_backEndBox.getUpperRightY(), i, m_backEndBox.getUpperRightY() - m_mediumLine);
132 drawLineW(box, utils);
134 else if((i % (
int)m_smallBlockSize) == 0)
136 box =
te::gm::Envelope(i, m_backEndBox.getUpperRightY(), i, m_backEndBox.getUpperRightY() - m_smallLine);
137 drawLineW(box, utils);
148 m_backEndBox =
te::gm::Envelope(m_box.getLowerLeftX() + m_backEndSpacing, m_box.getLowerLeftY() + m_backEndMargin,
149 m_box.getUpperRightX(), m_box.getUpperRightY() - m_backEndMargin);
void setPixmap(te::color::RGBAColor **pixmap)
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.
virtual void configCanvas(te::gm::Envelope box, bool resize=true)
double getWidth() const
It returns the envelope width.
virtual void drawHorizontalRuler(te::map::Canvas *canvas, Utils *utils)
An Envelope defines a 2D rectangular region.
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
virtual void drawRuler(te::map::Canvas *canvas, Utils *utils)
virtual ~HorizontalRulerModel()
A canvas is an abstraction of a drawing area.
virtual void setBox(te::gm::Envelope box)
virtual te::color::RGBAColor ** getImageW(te::gm::Envelope boxmm)
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
virtual void setLineColor(const te::color::RGBAColor &color)=0
It sets the pen color used to draw line geometries.
static Context * getInstance()
This function is called to create an instance of the class.
double getHeight() const
It returns the envelope height.
te::map::Canvas * getCanvas()
virtual void draw(ContextItem context)