27 #include "../../../common/STLUtils.h" 28 #include "../../../dataaccess/dataset/ObjectId.h" 29 #include "../../../dataaccess/dataset/ObjectIdSet.h" 30 #include "../../../dataaccess/utils/Utils.h" 31 #include "../../../geometry/GeometryProperty.h" 32 #include "../../../qt/widgets/canvas/MapDisplay.h" 33 #include "../../../qt/widgets/Utils.h" 34 #include "../../Feature.h" 35 #include "../../RepositoryManager.h" 36 #include "../../Utils.h" 37 #include "../Renderer.h" 42 #include <QMessageBox> 43 #include <QMouseEvent> 71 if (e->button() != Qt::LeftButton)
74 bool selected =
false;
83 std::vector<std::string> oidPropertyNames;
88 ds->moveBeforeFirst();
89 while (ds->moveNext())
91 std::unique_ptr<te::gm::Geometry> g(ds->getGeometry(gpos));
138 m_origin = currentPosition;
145 if (e->button() == Qt::RightButton)
153 if (
m_delta == QPointF(0., 0.))
192 catch(std::exception& e)
194 QMessageBox::critical(
m_display, tr(
"Error"), QString(tr(
"The geometry cannot be selected from the layer. Details:") +
" %1.").arg(e.what()));
200 QPointF pixelOffset(4.0, 4.0);
202 QRectF rect(pos - pixelOffset, pos + pixelOffset);
205 QPointF ll(rect.left(), rect.bottom());
206 QPointF ur(rect.right(), rect.top());
223 draft->fill(Qt::transparent);
239 if (
m_delta == QPointF(0., 0.))
virtual const std::string & getId() const
It returns the layer id.
Undo/Redo for add one components.
TEDATAACCESSEXPORT ObjectId * GenerateOID(DataSet *dataset, const std::vector< std::string > &names)
void addWatch(Feature *feature)
static te::dt::Date ds(2010, 01, 01)
void addUndoStack(QUndoCommand *command)
Method that insert command Undo/Redo of type AddCommand in the Undo/Redo stack.
TEDATAACCESSEXPORT std::size_t GetFirstSpatialPropertyPos(const te::da::DataSet *dataset)
It returns the first dataset spatial property or NULL if none is found.
void setOperationTypeId(const te::edit::OperationType ¤tOperationType)
static T & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
virtual int getSRID() const
It return the Spatial Reference System used by the Map Display.
std::size_t size() const
It returns the object id set size.
virtual std::unique_ptr< LayerSchema > getSchema() const =0
It returns the layer schema.
TEEDITEXPORT Feature * PickFeature(const te::map::AbstractLayerPtr &layer, const te::gm::Envelope &env, int srid)
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
static te::dt::TimeDuration dt(20, 30, 50, 11)
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)
TEEDITEXPORT void MoveGeometry(te::gm::Geometry *geom, const double &deltax, const double &deltay)
This is a singleton for rendering geometries and features.
virtual const te::da::ObjectIdSet * getSelected() const
It returns the selected group of this Layer.
virtual std::unique_ptr< te::da::DataSet > getData(te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) const =0
It gets the dataset identified by the layer name.
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)
TEDATAACCESSEXPORT void GetOIDPropertyNames(const DataSetType *type, std::vector< std::string > &pnames)
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
bool isValid() const
It tells if the rectangle is valid or not.