MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLDynamicRendererFactory Class Reference

Detailed Description

Utility to handle creation and management of Dynamic Renderers. Allows use of plugins to extend MapLink Dynamic Rendering Functionality. All methods are static.

The registered Dynamic Renderers are destroyed when the Drawing Surface cleanup method is called.

Note: If you are not using the version of Visual Studio that MapLink was built with then you can not use this class.

Static Public Member Functions

static TSLDynamicRenderercreate (const char *name)
 
static bool loadPlugin (const char *plugin)
 
static bool loadPlugins (const char *directory, const char *wildcard="*")
 
static int numRenderers ()
 
static bool registerDynamicRenderer (TSLDynamicRenderer *exemplar)
 
static const TSLDynamicRendererrenderer (int nth)
 

Member Function Documentation

◆ create()

static TSLDynamicRenderer * TSLDynamicRendererFactory::create ( const char * name)
static

Creates an instance of the named Dynamic Renderer and returns it

Parameters
nameName of Dynamic Renderer type to create
Returns
new Dynamic Renderer, 0 on error.

◆ loadPlugin()

static bool TSLDynamicRendererFactory::loadPlugin ( const char * plugin)
static

Loads the specified plugin, and initialises it.

On windows, the specified DLL is loaded and the 'extern "C" void initialiseDynamicRenderer()' method called if it exists. This should register any Dynamic Renderers with the TSLDynamicRendererFactory. An individual plugin may register any number of Dynamic Renderers.

The plugin name should not include the extension. When run in debug mode, a 'd' will be appended to the name prior to load.

Parameters
pluginPlugin to load - either full path to library, or name of file which is found in the DLL path.
Returns
true if successfully loaded and the initialiseDynamicRenderer method was called, false otherwise.

◆ loadPlugins()

static bool TSLDynamicRendererFactory::loadPlugins ( const char * directory,
const char * wildcard = "*" )
static

Loads all the plugins from the specified directory, and initialises them.

On windows, all DLL's in the specified directory that match the specified wildcard are loaded and the 'extern "C" void initialiseDynamicRenderer()' method called if it exists. This should register any Dynamic Renderers with the TSLDynamicRendererFactory. An individual plugin may register any number of Dynamic Renderers.

This method makes individual calls to loadPlugin, for matching files.

Parameters
directoryFull path to directory containing plugins to load.
wildcardWildcard to search for filenames in the directory
Returns
true if successfully loaded and the initialiseDynamicRenderer method was called for any plugin in the directory, false otherwise.

◆ numRenderers()

static int TSLDynamicRendererFactory::numRenderers ( )
static

Returns the number of Dynamic Renderers currently registered with the factory.

◆ registerDynamicRenderer()

static bool TSLDynamicRendererFactory::registerDynamicRenderer ( TSLDynamicRenderer * exemplar)
static

This method registers the specific Dynamic Renderer with the factory. The factory assumes ownership of the object.

The application can subsequently create an instance of the named renderer using the 'create' method.

If an existing registered renderer has the same name as the exemplar, then it is replaced by the new one, success is returned and a warning placed on the MapLink error stack.

Parameters
exemplarExample of Dynamic Renderer to register. This will be cloned when 'create' is called with this renderers name.
Returns
true if successfully registered, false otherwise.

◆ renderer()

static const TSLDynamicRenderer * TSLDynamicRendererFactory::renderer ( int nth)
static

Query for currently registered renderer. The returned renderer is owned by the factory for cloning and must not be destroyed.

Parameters
nthIndex into set of renderers - 0 to 'numRenderers-1'
Returns
the nth registered renderer, 0 if out of bounds