27 #include "../../../common/STLUtils.h" 28 #include "../../../geometry.h" 29 #include "../../../dataaccess/dataset/ObjectId.h" 30 #include "../../../dataaccess/utils/Utils.h" 31 #include "../../../qt/widgets/canvas/MapDisplay.h" 32 #include "../../../qt/widgets/Utils.h" 33 #include "../../RepositoryManager.h" 34 #include "../../Utils.h" 35 #include "../Renderer.h" 40 #include <QMessageBox> 41 #include <QMouseEvent> 50 bool showVertexes,
QObject* parent)
52 m_continuousMode(false),
54 m_showVertexes(showVertexes),
69 if (e->button() != Qt::LeftButton)
100 pos += QPointF(0.0001, 0.0001);
110 if (e->buttons() & Qt::LeftButton)
120 tol = (((scaleValue*digitValue) / 1000) / 1000);
121 if (tol <= 0.0001347)
146 if (e->button() != Qt::LeftButton)
151 catch (std::exception& e)
153 QMessageBox::critical(
m_display, tr(
"Error"), QString(tr(
"Could not create.") +
" %1.").arg(e.what()));
162 if (e->button() != Qt::RightButton)
167 catch (std::exception& e)
169 QMessageBox::critical(
m_display, tr(
"Error"), QString(tr(
"Could not create.") +
" %1.").arg(e.what()));
182 draft->fill(Qt::transparent);
244 for(std::size_t i = 0; i <
m_coords.size(); ++i)
258 for(std::size_t i = 0; i <
m_coords.size(); ++i)
286 connect(dynamic_cast<AddCommand*>(command), SIGNAL(commandFeedback()), SLOT(
onCommandFeedback()));
virtual const std::string & getId() const
It returns the layer id.
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
An utility struct for representing 2D coordinates.
TEEDITEXPORT void GetCoordinates(te::gm::Geometry *geom, std::vector< te::gm::Coord2D > &coords)
This is a singleton for managing edit repositories.
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.
LineString is a curve with linear interpolation between points.
void setOperationTypeId(const te::edit::OperationType ¤tOperationType)
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 double GetDistance(const te::gm::Coord2D &c1, const te::gm::Coord2D &c2)
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)
Feature * getFeature(const std::string &source, const te::gm::Envelope &e, int srid) const
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
void removeFeature(const std::string &source, te::da::ObjectId *id)
This is a singleton for rendering geometries and features.
bool hasIdentify(const std::string &source, te::da::ObjectId *id)
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
TEEDITEXPORT void TrySnap(te::gm::Coord2D &coord, int srid)
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)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
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.