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 |
std::vector< Feature * > | getFeatures (const te::gm::Envelope &e, int srid) const |
std::vector< Feature * > | getNewFeatures () 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, int srid=TE_UNKNOWN_SRS) | |
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... | |
int | m_srid |
The SRS of the features. More... | |
This class represents a repository of geometries and features.
Definition at line 62 of file Repository.h.
te::edit::Repository::Repository | ( | const std::string & | source, |
int | srid = TE_UNKNOWN_SRS |
||
) |
Definition at line 45 of file Repository.cpp.
te::edit::Repository::~Repository | ( | ) |
Definition at line 51 of file Repository.cpp.
void te::edit::Repository::add | ( | te::gm::Geometry * | geom | ) |
Definition at line 56 of file Repository.cpp.
References te::edit::GenerateId().
Referenced by te::edit::RepositoryManager::addFeature(), and te::edit::RepositoryManager::addGeometry().
void te::edit::Repository::add | ( | te::da::ObjectId * | id, |
te::gm::Geometry * | geom | ||
) |
Definition at line 67 of file Repository.cpp.
void te::edit::Repository::add | ( | Feature * | f | ) |
Definition at line 77 of file Repository.cpp.
References te::edit::Feature::getGeometry(), and te::edit::Feature::getId().
|
private |
Definition at line 259 of file Repository.cpp.
|
private |
Definition at line 267 of file Repository.cpp.
References te::gm::Geometry::getMBR().
void te::edit::Repository::clear | ( | ) |
Definition at line 230 of file Repository.cpp.
References te::common::FreeContents().
Referenced by te::edit::RepositoryManager::clear(), and te::qt::plugins::edit::ToolBar::onSaveActivated().
|
private |
Definition at line 254 of file Repository.cpp.
const std::vector< te::edit::Feature * > & te::edit::Repository::getAllFeatures | ( | ) | const |
Definition at line 161 of file Repository.cpp.
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 205 of file Repository.cpp.
References te::gm::Geometry::contains(), te::gm::Geometry::crosses(), te::gm::Envelope::getCenter(), te::gm::GetGeomFromEnvelope(), te::gm::Coord2D::x, and te::gm::Coord2D::y.
Referenced by te::edit::RepositoryManager::getFeature().
std::vector< te::edit::Feature * > te::edit::Repository::getFeatures | ( | const te::gm::Envelope & | e, |
int | srid | ||
) | const |
Definition at line 183 of file Repository.cpp.
References te::gm::Envelope::isValid().
Referenced by te::edit::Renderer::drawRepository(), and te::edit::RepositoryManager::getFeatures().
std::vector< te::edit::Feature * > te::edit::Repository::getNewFeatures | ( | ) | const |
Definition at line 166 of file Repository.cpp.
References te::edit::Feature::getId(), te::da::ObjectId::getValueAsString(), and NEW_FEATURE_ID_SUFFIX.
std::size_t te::edit::Repository::getPosition | ( | te::da::ObjectId * | id | ) |
Definition at line 140 of file Repository.cpp.
const std::string & te::edit::Repository::getSource | ( | ) | const |
Definition at line 156 of file Repository.cpp.
bool te::edit::Repository::hasIdentifier | ( | te::da::ObjectId * | id | ) |
Definition at line 151 of file Repository.cpp.
Referenced by te::edit::RepositoryManager::hasIdentify().
void te::edit::Repository::remove | ( | te::da::ObjectId * | id | ) |
Definition at line 120 of file Repository.cpp.
References TE_TR.
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(), and TE_TR.
|
private |
Definition at line 238 of file Repository.cpp.
|
private |
The repository features.
Definition at line 112 of file Repository.h.
|
private |
Internal index used to retrieve geometries spatially.
Definition at line 113 of file Repository.h.
|
private |
The source of the features.
Definition at line 110 of file Repository.h.
|
private |
The SRS of the features.
Definition at line 111 of file Repository.h.