te::map::MarkRendererManager Class Reference

This is a singleton for managing all mark renderers instances available in the system. More...

#include <MarkRendererManager.h>

Inheritance diagram for te::map::MarkRendererManager:
te::common::ClassLevelLockable< MarkRendererManager,::boost::recursive_mutex,::boost::lock_guard< ::boost::recursive_mutex >,::boost::lock_guard< ::boost::recursive_mutex > > te::common::Singleton< MarkRendererManager >

Public Types

typedef ClassLevelLockingPolicy< ::boost::lock_guard< ::boost::recursive_mutex > > LockRead
 
typedef ClassLevelLockingPolicy< ::boost::lock_guard< ::boost::recursive_mutex > > LockWrite
 
typedef volatile MarkRendererManager VolatileType
 

Public Member Functions

void add (const std::string &key, AbstractMarkRenderer *renderer)
 It adds a new mark renderer to the manager. More...
 
void clear ()
 It clears the marks renderers of the manager. More...
 
void getAllSupportedMarks (std::vector< std::string > &marks) const
 It informs the set of all supported marks available in the system. More...
 
te::color::RGBAColor ** render (const te::se::Mark *mark, std::size_t size)
 It generates the image pattern from the given Symbology Enconding Mark element. More...
 

Static Public Member Functions

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

Protected Member Functions

 MarkRendererManager ()
 It initializes the singleton instance of the mark renderer manager. More...
 
 ~MarkRendererManager ()
 Singleton destructor. More...
 

Private Attributes

std::map< std::string, AbstractMarkRenderer * > m_renderers
 The mark renderers in the manager. More...
 

Friends

class te::common::Singleton< MarkRendererManager >
 

Detailed Description

This is a singleton for managing all mark renderers instances available in the system.

If you want to render a mark, use commands like: te::color::RBGA** image = te::map::MarkRendererManager::getInstance().render(mark, size);

See also
AbstractMarkRenderer

Definition at line 63 of file MarkRendererManager.h.

Member Typedef Documentation

typedef ClassLevelLockingPolicy<::boost::lock_guard< ::boost::recursive_mutex > > te::common::ClassLevelLockable< MarkRendererManager , ::boost::recursive_mutex , ::boost::lock_guard< ::boost::recursive_mutex > , ::boost::lock_guard< ::boost::recursive_mutex > >::LockRead
inherited

Definition at line 302 of file ThreadingPolicies.h.

typedef ClassLevelLockingPolicy<::boost::lock_guard< ::boost::recursive_mutex > > te::common::ClassLevelLockable< MarkRendererManager , ::boost::recursive_mutex , ::boost::lock_guard< ::boost::recursive_mutex > , ::boost::lock_guard< ::boost::recursive_mutex > >::LockWrite
inherited

Definition at line 303 of file ThreadingPolicies.h.

typedef volatile MarkRendererManager te::common::ClassLevelLockable< MarkRendererManager , ::boost::recursive_mutex , ::boost::lock_guard< ::boost::recursive_mutex > , ::boost::lock_guard< ::boost::recursive_mutex > >::VolatileType
inherited

Definition at line 301 of file ThreadingPolicies.h.

Constructor & Destructor Documentation

te::map::MarkRendererManager::MarkRendererManager ( )
protected

It initializes the singleton instance of the mark renderer manager.

te::map::MarkRendererManager::~MarkRendererManager ( )
protected

Singleton destructor.

Member Function Documentation

void te::map::MarkRendererManager::add ( const std::string &  key,
AbstractMarkRenderer renderer 
)

It adds a new mark renderer to the manager.

Parameters
keyThe key of the new renderer.
rendererThe new mark renderer that will be added on the manager.
Note
The manager will take the owership of the given mark renderer.
Exceptions
ExceptionIt will throws an exception if there is already a mark renderer registered with the given key.
void te::map::MarkRendererManager::clear ( )

It clears the marks renderers of the manager.

void te::map::MarkRendererManager::getAllSupportedMarks ( std::vector< std::string > &  marks) const

It informs the set of all supported marks available in the system.

Parameters
marksA pre-created vector of string that will be filled with the supported marks names.
Note
All registered mark renderers will be consulted.
static MarkRendererManager & te::common::Singleton< MarkRendererManager >::getInstance ( )
staticinherited

It returns a reference to the singleton instance.

Returns
A reference to the singleton instance.
te::color::RGBAColor** te::map::MarkRendererManager::render ( const te::se::Mark mark,
std::size_t  size 
)

It generates the image pattern from the given Symbology Enconding Mark element.

Parameters
markThe Symbology Enconding Mark element that will be used as base to build the image pattern.
sizeThe size of image pattern that will be generated.
Returns
The RGBA image that represents the mark.
Note
This method will look the name of the mark and try extract the associated rendererKey. The pattern used is "rendererKey://markName". Case empty will be used the default mark renderer.
The caller will take the ownership of the returned pointer.
Exceptions
ExceptionIt will throws an exception if the image pattern can not be generated.

Friends And Related Function Documentation

Definition at line 69 of file MarkRendererManager.h.

Member Data Documentation

std::map<std::string, AbstractMarkRenderer*> te::map::MarkRendererManager::m_renderers
private

The mark renderers in the manager.

Definition at line 128 of file MarkRendererManager.h.


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