27 #include "../../../qt/widgets/canvas/MapDisplay.h" 28 #include "../../Feature.h" 29 #include "../../RepositoryManager.h" 30 #include "../Renderer.h" 35 #include <QMessageBox> 39 m_rotateStarted(false),
51 if (e->button() != Qt::LeftButton)
99 if (e->button() != Qt::LeftButton)
135 catch(std::exception& e)
137 QMessageBox::critical(
m_display, tr(
"Error"), QString(tr(
"The geometry cannot be selected from the layer. Details:") +
" %1.").arg(e.what()));
143 QPointF pixelOffset(4.0, 4.0);
145 QRectF rect(pos - pixelOffset, pos + pixelOffset);
148 QPointF ll(rect.left(), rect.bottom());
149 QPointF ur(rect.right(), rect.top());
166 draft->fill(Qt::transparent);
192 renderer.
drawText((QString::number(
m_angle) + tr(
" deg")).toUtf8().data(), point.get());
virtual const std::string & getId() const
It returns the layer id.
te::da::ObjectId * getId() const
TEEDITEXPORT void Rotate(te::gm::Geometry *geom, double angle)
te::gm::Geometry * getGeometry() const
An utility struct for representing 2D coordinates.
te::gm::Coord2D getCentroid() const _NOEXCEPT_OP(false)
It will get the centroid of the input geometries.
static T & getInstance()
It returns a reference to the singleton instance.
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
virtual int getSRID() const
It return the Spatial Reference System used by the Map Display.
TEEDITEXPORT Feature * PickFeature(const te::map::AbstractLayerPtr &layer, const te::gm::Envelope &env, int srid)
TEEDITQTEXPORT QPointF GetPosition(QMouseEvent *e)
virtual const te::gm::Envelope & getExtent() const
It returns the world extent showned by the MapDisplay.
void draw(te::gm::Geometry *geom, bool showVertexes=false)
void drawText(const std::string &text, te::gm::Point *p)
This is a singleton for rendering geometries and features.
void drawVertexes(te::gm::Geometry *geom)
void begin(QPaintDevice *device, const te::gm::Envelope &e, int srid)
void drawRepository(const std::string &source, const te::gm::Envelope &e, int srid)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
bool isValid() const
It tells if the rectangle is valid or not.