27 #include "../../../dataaccess/utils/Utils.h" 28 #include "../../../geometry/GeometryProperty.h" 29 #include "../../../geometry/Utils.h" 30 #include "../../../qt/widgets/canvas/MapDisplay.h" 31 #include "../../Feature.h" 32 #include "../../RepositoryManager.h" 33 #include "../../Utils.h" 34 #include "../Renderer.h" 39 #include <QMessageBox> 40 #include <QMouseEvent> 60 if (e->button() != Qt::LeftButton)
83 if (e->button() != Qt::LeftButton)
88 catch (std::exception& e)
90 QMessageBox::critical(
m_display, tr(
"Error"), QString(tr(
"Could not subtract.") +
" %1.").arg(e.what()));
99 if (e->button() != Qt::RightButton)
104 catch (std::exception& e)
106 QMessageBox::critical(
m_display, tr(
"Error"), QString(tr(
"Could not subtract.") +
" %1.").arg(e.what()));
119 QMessageBox::critical(
m_display, tr(
"Error"), QString(tr(
"Error subtracting area to the polygon")));
150 draft->fill(Qt::transparent);
190 for (std::size_t i = 0; i <
m_coords.size(); ++i)
216 QPointF pixelOffset(4.0, 4.0);
218 QRectF rect(pos - pixelOffset, pos + pixelOffset);
221 QPointF ll(rect.left(), rect.bottom());
222 QPointF ur(rect.right(), rect.top());
249 catch (std::exception& e)
252 QMessageBox::critical(
m_display, tr(
"Error"), QString(tr(
"The geometry cannot be selected from the layer. Details:") +
" %1.").arg(e.what()));
virtual const std::string & getId() const
It returns the layer id.
virtual Geometry * difference(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns a geometric object that represents the point set difference with another geometry...
Undo/Redo for add one components.
void setSRID(int srid)
It sets the Spatial Reference System ID of the geometry and all its parts if it is a GeometryCollecti...
te::da::ObjectId * getId() const
void addWatch(Feature *feature)
te::gm::Geometry * getGeometry() const
virtual bool intersects(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if the geometry object spatially intersects rhs geometry.
A LinearRing is a LineString that is both closed and simple.
void addUndoStack(QUndoCommand *command)
Method that insert command Undo/Redo of type AddCommand in the Undo/Redo stack.
int getSRID() const _NOEXCEPT_OP(true)
It returns the Spatial Reference System ID associated to this geometric object.
static T & getInstance()
It returns a reference to the singleton instance.
void setPoint(std::size_t i, const double &x, const double &y)
It sets the value of the specified point.
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)
virtual AbstractData * clone() const =0
It returns a clone of this object.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
This is a singleton for rendering geometries and features.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
void begin(QPaintDevice *device, const te::gm::Envelope &e, int srid)
void drawRepository(const std::string &source, const te::gm::Envelope &e, int srid)
void setGeometry(te::gm::Geometry *geom)
virtual void transform(int srid) _NOEXCEPT_OP(false)=0
It converts the coordinate values of the geometry to the new spatial reference system.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
TEGEOMEXPORT te::gm::Geometry * Validate(te::gm::Geometry *geom)
Get/create a valid version of the geometry given. If the geometry is a polygon or multi polygon...
bool isValid() const
It tells if the rectangle is valid or not.
void setRingN(std::size_t i, Curve *r)
It sets the informed position ring to the new one.
virtual bool covers(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if this geometry object spatially covers the rhs geometry.