This class represents a repository of geometries and features. More...
#include <Repository.h>
Public Member Functions | |
| void | add (te::gm::Geometry *geom) |
| void | add (te::da::ObjectId *id, te::gm::Geometry *geom) |
| void | add (Feature *f) |
| void | clear () |
| const std::vector< Feature * > & | getAllFeatures () const |
| Feature * | getFeature (const te::gm::Envelope &e, int srid) const |
| Feature * | getFeature (te::da::ObjectId *id) const |
| std::vector< Feature * > | getFeatures (const te::gm::Envelope &e, int srid) const |
| std::size_t | getPosition (te::da::ObjectId *id) |
| const std::string & | getSource () const |
| bool | hasIdentifier (te::da::ObjectId *id) |
| void | remove (te::da::ObjectId *id) |
| Repository (const std::string &source) | |
| void | set (te::da::ObjectId *id, te::gm::Geometry *geom) |
| void | set (Feature *f) |
| ~Repository () | |
Private Member Functions | |
| void | buildIndex () |
| void | buildIndex (const std::size_t &pos, te::gm::Geometry *geom) |
| void | clearIndex () |
| void | set (const std::size_t &pos, Feature *f) |
Private Attributes | |
| std::vector< Feature * > | m_features |
| The repository features. More... | |
| te::sam::rtree::Index< std::size_t, 8 > | m_rtree |
| Internal index used to retrieve geometries spatially. More... | |
| std::string | m_source |
| The source of the features. More... | |
This class represents a repository of geometries and features.
Definition at line 63 of file Repository.h.
| te::edit::Repository::Repository | ( | const std::string & | source | ) |
Definition at line 44 of file Repository.cpp.
| te::edit::Repository::~Repository | ( | ) |
Definition at line 49 of file Repository.cpp.
References clear().
| void te::edit::Repository::add | ( | te::gm::Geometry * | geom | ) |
Definition at line 54 of file Repository.cpp.
References te::edit::GenerateId(), and hasIdentifier().
Referenced by te::edit::RepositoryManager::addFeature(), and te::edit::RepositoryManager::addGeometry().
| void te::edit::Repository::add | ( | te::da::ObjectId * | id, |
| te::gm::Geometry * | geom | ||
| ) |
| void te::edit::Repository::add | ( | Feature * | f | ) |
Definition at line 77 of file Repository.cpp.
References buildIndex(), te::edit::Feature::getGeometry(), te::edit::Feature::getId(), getPosition(), and m_features.
|
private |
Definition at line 259 of file Repository.cpp.
References clearIndex(), and m_features.
|
private |
Definition at line 267 of file Repository.cpp.
References te::gm::Geometry::getMBR(), te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::insert(), and m_rtree.
| void te::edit::Repository::clear | ( | ) |
Definition at line 246 of file Repository.cpp.
References clearIndex(), te::common::FreeContents(), and m_features.
Referenced by te::edit::RepositoryManager::clear(), te::qt::plugins::edit::ToolBar::onResetVisualizationToolActivated(), te::qt::plugins::edit::ToolBar::onSaveActivated(), te::mnt::ProfileDialog::release(), and ~Repository().
|
private |
Definition at line 254 of file Repository.cpp.
References te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::clear(), and m_rtree.
Referenced by buildIndex(), and clear().
| const std::vector< te::edit::Feature * > & te::edit::Repository::getAllFeatures | ( | ) | const |
Definition at line 177 of file Repository.cpp.
References m_features.
Referenced by te::qt::plugins::edit::ToolBar::onSaveActivated().
| te::edit::Feature * te::edit::Repository::getFeature | ( | const te::gm::Envelope & | e, |
| int | srid | ||
| ) | const |
Definition at line 215 of file Repository.cpp.
References te::gm::Geometry::contains(), te::gm::Geometry::crosses(), te::gm::Envelope::getCenter(), getFeatures(), te::gm::GetGeomFromEnvelope(), te::gm::Geometry::getSRID(), te::gm::Geometry::transform(), te::gm::Coord2D::x, and te::gm::Coord2D::y.
Referenced by te::edit::RepositoryManager::getFeature().
| te::edit::Feature * te::edit::Repository::getFeature | ( | te::da::ObjectId * | id | ) | const |
Definition at line 204 of file Repository.cpp.
References m_features.
| std::vector< te::edit::Feature * > te::edit::Repository::getFeatures | ( | const te::gm::Envelope & | e, |
| int | srid | ||
| ) | const |
Definition at line 182 of file Repository.cpp.
References te::gm::Envelope::isValid(), m_features, m_rtree, and te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::search().
Referenced by te::edit::Renderer::drawRepository(), getFeature(), and te::edit::RepositoryManager::getFeatures().
| std::size_t te::edit::Repository::getPosition | ( | te::da::ObjectId * | id | ) |
Definition at line 156 of file Repository.cpp.
References m_features.
Referenced by add(), hasIdentifier(), remove(), and set().
| const std::string & te::edit::Repository::getSource | ( | ) | const |
Definition at line 172 of file Repository.cpp.
References m_source.
| bool te::edit::Repository::hasIdentifier | ( | te::da::ObjectId * | id | ) |
Definition at line 167 of file Repository.cpp.
References getPosition().
Referenced by add(), te::edit::RepositoryManager::hasIdentify(), and te::edit::SplitPolygonTool::resetVisualizationTool().
| void te::edit::Repository::remove | ( | te::da::ObjectId * | id | ) |
Definition at line 136 of file Repository.cpp.
References buildIndex(), getPosition(), m_features, and TE_TR.
Referenced by te::edit::RepositoryManager::removeFeature(), and te::edit::SplitPolygonTool::resetVisualizationTool().
| void te::edit::Repository::set | ( | te::da::ObjectId * | id, |
| te::gm::Geometry * | geom | ||
| ) |
Definition at line 97 of file Repository.cpp.
| void te::edit::Repository::set | ( | Feature * | f | ) |
Definition at line 107 of file Repository.cpp.
References te::edit::Feature::getId(), getPosition(), and TE_TR.
|
private |
Definition at line 120 of file Repository.cpp.
References buildIndex(), and m_features.
|
private |
The repository features.
Definition at line 112 of file Repository.h.
Referenced by add(), buildIndex(), clear(), getAllFeatures(), getFeature(), getFeatures(), getPosition(), remove(), and set().
|
private |
Internal index used to retrieve geometries spatially.
Definition at line 113 of file Repository.h.
Referenced by buildIndex(), clearIndex(), and getFeatures().
|
private |