27 #include "../../../geometry/GeometryProperty.h" 28 #include "../../../geometry/MultiLineString.h" 29 #include "../../../geometry/MultiPoint.h" 30 #include "../../../geometry/MultiPolygon.h" 31 #include "../../../geometry/Utils.h" 32 #include "../../../dataaccess/dataset/ObjectIdSet.h" 33 #include "../../../dataaccess/utils/Utils.h" 34 #include "../../../qt/widgets/canvas/MapDisplay.h" 35 #include "../../../qt/widgets/Utils.h" 36 #include "../../Feature.h" 37 #include "../../RepositoryManager.h" 38 #include "../../Utils.h" 39 #include "../Renderer.h" 44 #include <QMessageBox> 45 #include <QMouseEvent> 61 if (e->button() != Qt::LeftButton)
75 QMessageBox::critical(
m_display, tr(
"Error"), QString(tr(
"The geometry cannot be selected from the layer.")));
84 QPointF pixelOffset(4.0, 4.0);
86 QRectF rect(pos - pixelOffset, pos + pixelOffset);
89 QPointF ll(rect.left(), rect.bottom());
90 QPointF ur(rect.right(), rect.top());
120 if (p->
contains(&point) || p->
crosses(geometryFromEnvelope.get()) || geometryFromEnvelope->contains(p))
141 if (l->
contains(&point) || l->
crosses(geometryFromEnvelope.get()) || geometryFromEnvelope->contains(l))
162 if (pt->
contains(&point) || pt->
crosses(geometryFromEnvelope.get()) || geometryFromEnvelope->contains(pt))
std::size_t getNumGeometries() const
It returns the number of geometries in this GeometryCollection.
virtual const std::string & getId() const
It returns the layer id.
MultiPolygon is a MultiSurface whose elements are Polygons.
GeomType getGeomTypeId() const _NOEXCEPT_OP(true)
It returns the geometry subclass type identifier.
te::gm::Geometry * getGeometry() const
An utility struct for representing 2D coordinates.
void removeGeometryN(std::size_t i)
It removes the n-th geometry in this geometry collection.
Coord2D getCenter() const
It returns the rectangle's center coordinate.
MultiPoint is a GeometryCollection whose elements are restricted to points.
LineString is a curve with linear interpolation between points.
void setOperationTypeId(const te::edit::OperationType ¤tOperationType)
static RepositoryManager & 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)
virtual bool contains(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if this geometry object spatially contains rhs geometry.
Geometry * getGeometryN(std::size_t i) const
It returns the n-th geometry in this GeometryCollection.
MultiLineString is a MultiCurve whose elements are LineStrings.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
virtual int getSRID() const
It returns the Spatial Reference System ID associated to the Layer.
void setGeometry(te::gm::Geometry *geom)
virtual bool crosses(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if the geometry object spatially crosses rhs geometry.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
bool isValid() const
It tells if the rectangle is valid or not.
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.