27 #include "../../../maptools/MarkRendererManager.h" 28 #include "../../../se/Mark.h" 29 #include "../../../se/Stroke.h" 30 #include "../../../se/Utils.h" 31 #include "../canvas/Canvas.h" 32 #include "../canvas/MapDisplay.h" 36 #include <QMouseEvent> 38 #define PATTERN_SIZE 12 54 if(e->button() != Qt::LeftButton)
57 #if QT_VERSION >= 0x050000 58 QPointF
p = e->localPos();
60 QPointF p = e->posF();
69 for (std::map<unsigned int, QPointF>::iterator it =
m_points->begin(); it !=
m_points->end(); ++it)
71 te::gm::Envelope env_pt((*it).second.x(), (*it).second.y(), (*it).second.x(), (*it).second.y());
90 #if QT_VERSION >= 0x050000 91 QPointF
p = e->localPos();
93 QPointF p = e->posF();
117 #if QT_VERSION >= 0x050000 118 QPointF
p = e->localPos();
120 QPointF p = e->posF();
140 QPointF pixelOffset(4.0, 4.0);
142 QRectF rect(pos - pixelOffset, pos + pixelOffset);
145 QPointF ll(rect.left(), rect.bottom());
146 QPointF ur(rect.right(), rect.top());
174 draft->fill(Qt::transparent);
178 CanvasInstance->setTextContourEnabled(
true);
179 CanvasInstance->setTextContourWidth(2);
182 for (std::map<unsigned int, QPointF> :: iterator it =
m_points->begin(); it !=
m_points->end(); ++it)
184 unsigned int i = (*it).first;
185 QPointF pt = (*it).second;
198 CanvasInstance->draw(&Point);
200 QMatrix matrix = CanvasInstance->getMatrix();
201 QPointF pointCanvas = matrix.map(pt);
202 pointCanvas.
setY(pointCanvas.y() + 15);
203 QPointF pointGeo = matrix.inverted().map(pointCanvas);
204 Point.setX(pointGeo.x());
205 Point.setY(pointGeo.y());
206 CanvasInstance->drawText(&Point, QString::number(i).toUtf8().data());
A Mark specifies a geometric shape and applies coloring to it.
double m_urx
Upper right corner x-coordinate.
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
double m_llx
Lower left corner x-coordinate.
static MarkRendererManager & getInstance()
It returns a reference to the singleton instance.
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
bool contains(const Envelope &rhs) const
It returns true if this envelope "spatially contains" the rhs envelope.
virtual const te::gm::Envelope & getExtent() const
It returns the world extent showned by the MapDisplay.
A Fill specifies the pattern for filling an area geometry.
TESEEXPORT Mark * CreateMark(const std::string &wellKnownName, Stroke *stroke, Fill *fill)
Creates a mark.
double m_lly
Lower left corner y-coordinate.
TESEEXPORT Stroke * CreateStroke(const std::string &color, const std::string &width)
Creates a stroke.
double m_ury
Upper right corner y-coordinate.
A Stroke specifies the appearance of a linear geometry.
This class implements a concrete tool to geographic coordinate move a point on mouse operation...
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
void setY(const double &y)
It sets the Point y-coordinate value.
bool isValid() const
It tells if the rectangle is valid or not.
TESEEXPORT Fill * CreateFill(const std::string &color, const std::string &opacity)
Creates a fill.