te::edit::SnapManager Class Reference

This is a singleton for managing geometries snap. More...

#include <SnapManager.h>

Inheritance diagram for te::edit::SnapManager:
te::common::Singleton< SnapManager >

Public Types

typedef std::map< std::string, SnapStrategyFnctTypeSnapStrategies
 
typedef boost::function< Snap *(const std::string &source, int srid)> SnapStrategyFnctType
 

Public Member Functions

void buildSnap (const std::string &source, int srid, te::da::DataSet *dataset)
 
void clear (const std::string &source)
 
void clearAll ()
 
void clearStrategies ()
 
void createSnap (const std::string &source, int srid)
 
SnapgetSnap (const std::string &source) const
 
const std::map< std::string, Snap * > & getSnaps () const
 
bool hasSnap (const std::string &source) const
 
void reg (const std::string &name, const SnapStrategyFnctType &strategy)
 
void removeSnap (const std::string &source)
 
bool search (const te::gm::Coord2D &coord, int srid, te::gm::Coord2D &result)
 
void setWorld (const double &llx, const double &lly, const double &urx, const double &ury, const std::size_t &width, const std::size_t &height)
 

Static Public Member Functions

static SnapManagergetInstance ()
 It returns a reference to the singleton instance. More...
 

Protected Member Functions

 SnapManager ()
 It initializes the singleton instance of the snap manager. More...
 
 ~SnapManager ()
 Singleton destructor. More...
 

Private Attributes

std::map< std::string, Snap * > m_snaps
 
SnapStrategies m_snapStrategies
 

Friends

class te::common::Singleton< SnapManager >
 

Detailed Description

This is a singleton for managing geometries snap.

Definition at line 65 of file SnapManager.h.

Member Typedef Documentation

Definition at line 72 of file SnapManager.h.

typedef boost::function<Snap* (const std::string& source, int srid)> te::edit::SnapManager::SnapStrategyFnctType

Definition at line 71 of file SnapManager.h.

Constructor & Destructor Documentation

te::edit::SnapManager::SnapManager ( )
protecteddefault

It initializes the singleton instance of the snap manager.

Referenced by clearStrategies().

te::edit::SnapManager::~SnapManager ( )
protecteddefault

Singleton destructor.

Referenced by clearStrategies().

Member Function Documentation

void te::edit::SnapManager::buildSnap ( const std::string &  source,
int  srid,
te::da::DataSet dataset 
)

Definition at line 60 of file SnapManager.cpp.

References te::edit::Snap::build(), getSnap(), m_snaps, and m_snapStrategies.

void te::edit::SnapManager::clear ( const std::string &  source)

Definition at line 109 of file SnapManager.cpp.

References te::edit::Snap::clear(), and getSnap().

void te::edit::SnapManager::clearAll ( )

Definition at line 117 of file SnapManager.cpp.

References te::common::FreeContents(), and m_snaps.

void te::edit::SnapManager::clearStrategies ( )

Definition at line 154 of file SnapManager.cpp.

References m_snapStrategies, SnapManager(), and ~SnapManager().

void te::edit::SnapManager::createSnap ( const std::string &  source,
int  srid 
)

Definition at line 45 of file SnapManager.cpp.

References hasSnap(), m_snaps, and m_snapStrategies.

static SnapManager & te::common::Singleton< SnapManager >::getInstance ( )
staticinherited
te::edit::Snap * te::edit::SnapManager::getSnap ( const std::string &  source) const

Definition at line 99 of file SnapManager.cpp.

References m_snaps.

Referenced by buildSnap(), and clear().

const std::map< std::string, te::edit::Snap * > & te::edit::SnapManager::getSnaps ( ) const

Definition at line 94 of file SnapManager.cpp.

References m_snaps.

bool te::edit::SnapManager::hasSnap ( const std::string &  source) const

Definition at line 40 of file SnapManager.cpp.

References m_snaps.

Referenced by createSnap().

void te::edit::SnapManager::reg ( const std::string &  name,
const SnapStrategyFnctType strategy 
)

Definition at line 144 of file SnapManager.cpp.

References m_snapStrategies, and TE_TR.

void te::edit::SnapManager::removeSnap ( const std::string &  source)

Definition at line 83 of file SnapManager.cpp.

References m_snaps.

bool te::edit::SnapManager::search ( const te::gm::Coord2D coord,
int  srid,
te::gm::Coord2D result 
)

Definition at line 123 of file SnapManager.cpp.

References m_snaps.

void te::edit::SnapManager::setWorld ( const double &  llx,
const double &  lly,
const double &  urx,
const double &  ury,
const std::size_t &  width,
const std::size_t &  height 
)

Definition at line 135 of file SnapManager.cpp.

References m_snaps.

Friends And Related Function Documentation

friend class te::common::Singleton< SnapManager >
friend

Definition at line 67 of file SnapManager.h.

Member Data Documentation

std::map<std::string, Snap*> te::edit::SnapManager::m_snaps
private
SnapStrategies te::edit::SnapManager::m_snapStrategies
private

Definition at line 110 of file SnapManager.h.

Referenced by buildSnap(), clearStrategies(), createSnap(), and reg().


The documentation for this class was generated from the following files: