This class implements a vertex search snap. More...
#include <SnapVertex.h>
Public Member Functions | |
| void | add (te::gm::Geometry *geom) |
| void | add (te::da::DataSet *dataset) |
| void | build (te::da::DataSet *dataset) |
| void | clear () |
| std::string | getDescription () const |
| std::size_t | getMaxGeometries () const |
| std::string | getName () const |
| std::size_t | getNGeometries () const |
| std::string | getSource () const |
| int | getSRID () const |
| double | getTolerance () const |
| virtual bool | search (const te::gm::Coord2D &coord, te::gm::Coord2D &result) |
| void | setTolerance (const double &t) |
| void | setWorld (const double &llx, const double &lly, const double &urx, const double &ury, const std::size_t &width, const std::size_t &height) |
| SnapVertex (const std::string &source, int srid=TE_UNKNOWN_SRS) | |
| ~SnapVertex () | |
Static Public Member Functions | |
| static Snap * | Builder (const std::string &source, int srid) |
Protected Member Functions | |
| te::gm::Envelope | getSearchEnvelope (const te::gm::Coord2D &coord) const |
| bool | search (const te::gm::Envelope &e, te::gm::Coord2D &result) |
Protected Attributes | |
| std::size_t | m_maxGeometries |
| The maximum number of geometries that can be added to the snap. If 0, there will be not limit. More... | |
| std::size_t | m_nGeometries |
| The current number of geometries added to the snap. More... | |
| std::string | m_source |
| The source of the geometries. More... | |
| int | m_srid |
| The SRS of the geometries. More... | |
| double | m_tolerance |
| The tolerance that will be used by the snap. For while, the unit is screen pixels. More... | |
| te::map::WorldDeviceTransformer * | m_transformer |
| For transforming from device coordinate to world coordinate and vice-versa. More... | |
Private Attributes | |
| std::vector< te::gm::Coord2D > | m_coords |
| The snap coordinates. More... | |
| te::sam::rtree::Index< std::size_t, 8 > | m_rtree |
| Internal index used to retrieve geometries spatially. More... | |
This class implements a vertex search snap.
Definition at line 45 of file SnapVertex.h.
| te::edit::SnapVertex::SnapVertex | ( | const std::string & | source, |
| int | srid = TE_UNKNOWN_SRS |
||
| ) |
|
default |
Referenced by SnapVertex().
|
virtual |
Implements te::edit::Snap.
Definition at line 40 of file SnapVertex.cpp.
References te::edit::GetCoordinates(), te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::insert(), m_coords, te::edit::Snap::m_maxGeometries, te::edit::Snap::m_nGeometries, and m_rtree.
|
inherited |
Definition at line 102 of file Snap.cpp.
References te::dt::GEOMETRY_TYPE, te::da::GetFirstPropertyPos(), te::da::DataSet::getGeometry(), and te::da::DataSet::moveNext().
Referenced by te::edit::Snap::build().
|
inherited |
Definition at line 93 of file Snap.cpp.
References te::edit::Snap::add(), and te::edit::Snap::clear().
Referenced by te::edit::SnapManager::buildSnap().
|
static |
Definition at line 79 of file SnapVertex.cpp.
References SnapVertex().
Referenced by te::edit::Module::Module().
|
virtual |
Implements te::edit::Snap.
Definition at line 62 of file SnapVertex.cpp.
References te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::clear(), m_coords, te::edit::Snap::m_nGeometries, and m_rtree.
|
virtual |
Implements te::edit::Snap.
Definition at line 74 of file SnapVertex.cpp.
|
inherited |
Definition at line 70 of file Snap.cpp.
References te::edit::Snap::m_maxGeometries.
|
virtual |
Implements te::edit::Snap.
Definition at line 69 of file SnapVertex.cpp.
|
inherited |
Definition at line 65 of file Snap.cpp.
References te::edit::Snap::m_nGeometries.
|
protectedinherited |
Definition at line 125 of file Snap.cpp.
References te::map::WorldDeviceTransformer::device2World(), dx, te::gm::Envelope::isValid(), te::gm::Envelope::m_llx, te::gm::Envelope::m_lly, te::edit::Snap::m_tolerance, te::edit::Snap::m_transformer, te::gm::Envelope::m_urx, te::gm::Envelope::m_ury, TE_TR, te::map::WorldDeviceTransformer::world2Device(), te::gm::Coord2D::x, and te::gm::Coord2D::y.
Referenced by te::edit::Snap::search().
|
inherited |
Definition at line 55 of file Snap.cpp.
References te::edit::Snap::m_source.
|
inherited |
Definition at line 60 of file Snap.cpp.
References te::edit::Snap::m_srid.
|
inherited |
Definition at line 75 of file Snap.cpp.
References te::edit::Snap::m_tolerance.
Referenced by te::edit::SnapOptionsDialog::buildOptions().
|
protectedvirtual |
Implements te::edit::Snap.
Definition at line 84 of file SnapVertex.cpp.
References te::gm::Envelope::getCenter(), te::edit::GetDistance(), te::gm::Envelope::isValid(), m_coords, m_rtree, te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::search(), te::gm::Coord2D::x, and te::gm::Coord2D::y.
|
virtualinherited |
Definition at line 118 of file Snap.cpp.
References te::edit::Snap::getSearchEnvelope().
|
inherited |
Definition at line 80 of file Snap.cpp.
References te::edit::Snap::m_tolerance.
|
inherited |
Definition at line 85 of file Snap.cpp.
References te::edit::Snap::m_transformer.
|
private |
The snap coordinates.
Definition at line 69 of file SnapVertex.h.
|
protectedinherited |
The maximum number of geometries that can be added to the snap. If 0, there will be not limit.
Definition at line 112 of file Snap.h.
Referenced by add(), and te::edit::Snap::getMaxGeometries().
|
protectedinherited |
The current number of geometries added to the snap.
Definition at line 111 of file Snap.h.
Referenced by add(), clear(), and te::edit::Snap::getNGeometries().
|
private |
Internal index used to retrieve geometries spatially.
Definition at line 70 of file SnapVertex.h.
|
protectedinherited |
The source of the geometries.
Definition at line 109 of file Snap.h.
Referenced by te::edit::Snap::getSource().
|
protectedinherited |
The SRS of the geometries.
Definition at line 110 of file Snap.h.
Referenced by te::edit::Snap::getSRID().
|
protectedinherited |
The tolerance that will be used by the snap. For while, the unit is screen pixels.
Definition at line 113 of file Snap.h.
Referenced by te::edit::Snap::getSearchEnvelope(), te::edit::Snap::getTolerance(), and te::edit::Snap::setTolerance().
|
protectedinherited |
For transforming from device coordinate to world coordinate and vice-versa.
Definition at line 114 of file Snap.h.
Referenced by te::edit::Snap::getSearchEnvelope(), te::edit::Snap::setWorld(), and te::edit::Snap::~Snap().