MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLDrawingSurfaceBase Class Reference
Inheritance diagram for TSLDrawingSurfaceBase:

Detailed Description

Passive base component for displaying data to a user supplied window.

The TSLDrawingSurfaceBase component is the common functionality used for both 2D and 3D Drawing Surfaces. 3D Drawing Surfaces are supplied in a separate MapLink component. It is an abstract class and cannot be instantiated. Instead the platform specific derivative must be created.

As the TSLDrawingSurfaceBase is passive, there are no inherent event handling routines.

This component provides the following capabilities

  • Connection of the TSLDrawingSurface to a user window
  • Management of data layers
  • Manipulation of the rendering of features in the map layers
  • Control of the visibility of features in the map layers
  • Miscellaneous methods

Drawing methods and view management are provided by the derived classes.

A TSLDrawingSurfaceBase must be connected to a user-supplied window (or HDC/Pixmap) before it can display anything. It does not create a window of its own. This gives the user control over what is displayed in the window.

A TSLDrawingSurfaceBase derived object will display data from any data layers that are connected to it. The ordering and visibility of the data layers used in the TSLDrawingSurfaceBase are under the control of the user. The methods for connection and disconnection of the data layers to the TSLDrawingSurfaceBase are 'addDataLayer' and 'removeDataLayer'. The ordering of the data layers are controlled by the methods 'bringInFrontOf', 'sendToBackOf', 'bringToFront' and 'sendToBack'. The properties of the data layer within the TSLDrawingSurfaceBase, e.g. detectability, selectability, visibility and automatic tiling for map layers, can be modified using 'setDataLayerProps' and examined by 'getDataLayerProps'.

The background colour of the TSLDrawingSurfaceBase may be defined by the method 'setBackgroundColour'. To make the TSLDrawingSurface transparent, the method 'clearBackgroundColour' may be called. This allows the user application to draw under the TSLDrawingSurface without the image being erased when the TSLDrawingSurface is drawn.

The rendering of map features within the TSLDrawingSurface can be modified using the methods 'loadRendering', 'saveRendering', 'setFeatureRendering', 'getFeatureRendering' and 'clearFeatureRendering'. Rendering information held by the TSLDrawingSurfaceBase overrides any rendering information held within a Data Layer for a particular feature.

The visibility of individual map features within the TSLDrawingSurfaceBase can be modified using the methods 'loadDeclutter', 'saveDeclutter' , 'setDeclutterRange' , 'setDeclutterStatus' and examined using the method 'getDeclutterRange' and 'getDeclutterStatus'. Groups of related features can be decluttered using 'setDeclutterStatus'. A drawing surface internally has two sets of declutter settings, a global list that is applied to all data layers in the drawing surface, and a per-layer list that applies to a single data layer that inherits and extends the global list. When modifying declutter settings using the above methods the application can control whether the setting should be set on the global list (and thus apply to all layers in the drawing surface) or a specific data layer's list through the layer name argument of each method.

This class is an abstract class, specifying the generic behaviour of a TSLDrawingSurfaceBase.

Thread Safety

MapLink can be used in multiple threads if a degree of care is taken by the user.

The principle rule is that Drawing surfaces and TSLMapDataLayers must be not be shared between threads.

Additionally loading of the Coordinate Systems and adding or removing coordinate systems is not thread safe.

Additional guidance can be obtained from support.

OS Specific Types

The types used to return OS specific drawing are as follows:

TSLDeviceContext : Windows 'HDC'. TSLWindowHandle : Windows 'HWND'. TSLBitmapHandle : Windows 'HBITMAP', X11 a pointer to a structure declared in tslplatformtypes.h. TSLDrawableHandle : X11 'Drawable'. TSLVisualHandle : X11 'Visual *'. TSLColourmapHandle : X11 'Colormap'. TSLScreenHandle : X11 'Screen *'. TSLDisplayHandle : X11 'Display *'.

If you pass a specific OS type to a method or you are querying a method which returns an OS specific type as defined above you may need to cast the result or argument to the type expected.

Public Member Functions

bool addDataLayer (TSLDataLayer *data_layer_interface, const char *data_id)
 
bool addDynamicRenderer (TSLDynamicRenderer *renderer, TSLFeatureID featureID=-1, const char *layerName=0)
 
bool addFeatureRendering (const char *featureName, TSLFeatureID featureID)
 
void attach (TSLDeviceContext handle)
 
void attach (TSLWindowHandle handle)
 
void attach (TSLDrawableHandle handle)
 
bool bringInFrontof (const char *move_data_layer, const char *target_data_layer)
 
bool bringToFront (const char *move_data_layer)
 
bool clearAllDeclutterData (const char *layer_name=0)
 
void clearAllDynamicRenderers ()
 
bool clearBackgroundColour ()
 
bool clearDeclutterData (const char *feature_name, const char *layer_name=0)
 
bool clearDynamicRenderer (TSLFeatureID featureID=-1, const char *layerName=0)
 
bool clearFeatureRendering (const char *featureName, TSLFeatureID featureID)
 
bool clearFrame ()
 
bool copyDeclutterData (const char *src_feature_name, const char *dest_feature_name, const char *src_layer_name=0, const char *dest_layer_name=0)
 
void detach ()
 
void detachAllDynamicRenderers ()
 
bool detachDynamicRenderer (TSLFeatureID featureID=-1, const char *layerName=0)
 
const char * featureClass (TSLFeatureID feature_id)
 
bool forceLayer (const char *data_id, const char *detail_layer_name)
 
bool getBackgroundColour (TSLStyleID *value)
 
bool getColourValue (int colour, unsigned char &r, unsigned char &g, unsigned char &b)
 
TSLDataLayergetDataLayer (const char *data_id)
 
bool getDataLayerInfo (int N, TSLDataLayer **dataLayer, const char **layerName) const
 
bool getDataLayerProps (const char *data_id, TSLPropertyEnum property_id, TSLPropertyValue *old_value)
 
bool getDeclutterStatus (const char *feature_name, TSLDeclutterStatusResultEnum *value, const char *dataLayerName=0, const char *detailLayerName=0)
 
bool getDeclutterStatus (TSLFeatureID feature_id, TSLDeclutterStatusResultEnum *value, const char *dataLayerName, const char *detailLayerName=0)
 
TSLDynamicRenderergetDynamicRenderer (TSLFeatureID featureID=-1, const char *layerName=0)
 
bool getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeInt attribute, int *result) const
 
bool getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeDouble attribute, double *result) const
 
bool getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeBool attribute, bool *result) const
 
bool getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributes *result) const
 
int getNumDataLayers () const
 
bool getOption (TSLOptionEnum option)
 
void id (int id_)
 
int id () const
 
bool idleProcess ()
 
bool loadDeclutter (const char *filename)
 
bool loadRendering (const char *filename)
 
TSLPickResultSetpick (TSLDeviceUnits x, TSLDeviceUnits y, TSLDeviceUnits aperture, int depth, TSLPickSelector *selector=0)
 
TSLPickResultSetpick (const char *data_id, TSLDeviceUnits x, TSLDeviceUnits y, TSLDeviceUnits aperture, int depth=-1, TSLPickSelector *selector=0)
 
bool queryActiveLayer (const char *data_id, char *detail_layer_name, int detail_layer_name_size)
 
bool removeDataLayer (const char *data_id)
 
bool saveDeclutter (const char *filename, TSLMapLinkVersion ver=TSL_CURRENT_MAPLINK_VERSION)
 
bool saveRendering (const char *filename, TSLMapLinkVersion ver=TSL_CURRENT_MAPLINK_VERSION)
 
bool sendToBack (const char *move_data_layer)
 
bool sendToBackOf (const char *move_data_layer, const char *target_data_layer)
 
bool setBackgroundColour (int value)
 
bool setCoordinateProvidingLayer (const char *layer_name)
 
bool setDataLayerProps (const char *data_id, TSLPropertyEnum property_id, TSLPropertyValue new_value)
 
bool setDeclutterStatus (const char *feature_name, TSLDeclutterStatusEnum value, const char *dataLayerName=0, const char *detailLayerName=0)
 
bool setDeclutterStatus (TSLFeatureID feature_id, TSLDeclutterStatusEnum value, const char *dataLayerName=0, const char *detailLayerName=0)
 
bool setDeclutterStatusOnAllFeatures (TSLDeclutterStatusEnum value, const char *dataLayerName=0, const char *detailLayerName=0)
 
bool setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeInt attribute, int value)
 
bool setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeDouble attribute, double value)
 
bool setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeBool attribute, bool value)
 
bool setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributes *value)
 
bool setFrame (int style, int colour, int thickness)
 
virtual void setOption (TSLOptionEnum option, bool value)
 
double TMCperMU ()
 
TSLDrawingSurfaceTypeEnum type () const
 
void userWord (void *ptr) const
 
void * userWord () const
 
bool cloneDynamicRenderersFrom (const TSLDrawingSurfaceBase *otherSurface)
 
void addDuplicateLayers (bool value)
 
virtual ~TSLDrawingSurfaceBase ()
 

Static Public Member Functions

static bool addLoader (TSLFileLoader *loader)
 
static bool addPathList (TSLPathList *path_list)
 
static bool findFile (const char *filename, TSLSimpleString &foundPath)
 
static TSLFileLoadergetLoader ()
 

Protected Member Functions

 TSLDrawingSurfaceBase ()
 

Protected Attributes

void * m_classID
 

Constructor & Destructor Documentation

◆ ~TSLDrawingSurfaceBase()

virtual TSLDrawingSurfaceBase::~TSLDrawingSurfaceBase ( )
virtual

◆ TSLDrawingSurfaceBase()

TSLDrawingSurfaceBase::TSLDrawingSurfaceBase ( )
protected

Member Function Documentation

◆ addDataLayer()

bool TSLDrawingSurfaceBase::addDataLayer ( TSLDataLayer * data_layer_interface,
const char * data_id )

Add TSLDataLayer to Drawing Surface.

Visual display of data in TMS is through a Drawing Surface. This method allows the user to add a Data Layer to the Drawing Surface. When a draw request is made to the Drawing Surface any (visible) Data Layer that is attached to it will be displayed in the window.

Calling addDataLayer may change the coordinate providing layer. The default coordinate providing layer is the last layer added that reports itself to be coordinate providing. You can also set a fixed coordinate providing layer by calling setCoordinateProvidingLayer.

Note: Data Layers may be added to more than one Drawing Surface.

Parameters
data_layer_interfaceActual data layer to be added to the Drawing Surface. The object must be constructed beforehand.
data_idThis is the user defined name of the data layer to be added to the Drawing Surface.
Returns
true on success, false otherwise.

◆ addDuplicateLayers()

void TSLDrawingSurfaceBase::addDuplicateLayers ( bool value)

If enabled, allow multiple data layers with the same name to be added to the drawing surface.

Parameters
valuePass true to allow the duplicate feature.

◆ addDynamicRenderer()

bool TSLDrawingSurfaceBase::addDynamicRenderer ( TSLDynamicRenderer * renderer,
TSLFeatureID featureID = -1,
const char * layerName = 0 )

This method adds a Dynamic Renderer to the drawing surface, or clears an existing one for a specific feature/layer combination.

There are 4 different ways of deciding if a Dynamic Renderer should be used to render a particular entity - in this order.

  1. If featureID and layerName are specified, then entities in that data layer with that feature ID will trigger the Dynamic Renderer.
  2. If featureID is -1, but a layerName is specified, then all entities in that data layer will trigger the Dynamic Renderer.
  3. If featureID is specified, but layerName is NULL, then all entities of that feature ID will trigger the Dynamic Renderer.
  4. If featureID is -1, and layerName is NULL, then all entities on the Drawing Surface will trigger the Dynamic Renderer.

Any existing renderer for this featureID/layerName combination is destroyed.

Parameters
rendererRenderer to use. The Drawing Surface assumes ownership of it. If NULL, then this clears the feature/layer combination.
featureIDFeature ID of entities that trigger this renderer. -1 if featureID is not relevant in the decision. Default -1
layerNameName of data layer that this renderer applies to. 0 if layer is not relevant in the decision. Default 0
Returns
true if successfully added, false otherwise.

◆ addFeatureRendering()

bool TSLDrawingSurfaceBase::addFeatureRendering ( const char * featureName,
TSLFeatureID featureID )

Adds feature rendering.

This method allows the user to add a new feature to the rendering list. If a rendering style for the feature name already exists, it will be cleared, otherwise a new style will be created.

When MapLink is rendering a feature, it first looks at whether the entity has an attribute set. If so, then it tries to apply that attribute set and render the entity. If not, then it uses the feature id of the entity to index into the rendering information loaded into the TSLDrawingSurface. If there is no rendering information in the TSLDrawingSurface, then it defaults to the rendering information stored with the TSLDataLayer.

If an entity has no attribute set or feature id, then the parent is recursively queried for attribute set and feature code.

If neither an entity, nor any of its parents have attribute sets or feature id, then the entity will not be rendered.

Parameters
featureNameFeature class name to which the rendering style is applied.
featureIDNumeric ID of feature class
Returns
true on success , false otherwise.

◆ addLoader()

static bool TSLDrawingSurfaceBase::addLoader ( TSLFileLoader * loader)
static

The application can provide a file loader for drawing surfaces to use when loading data.

If addLoader has not been called when a loader is needed, the surface will create a FileLoaderBlocking.

If a loader is already instantiated, it will be replaced by the one provided.

Typically, addLoader would be called to add a TSLFileLoaderMT so that an application can load data in a background thread whilst continuing to respond to user input, or a TSLFileLoaderRemote so that an application can load data from an internet server.

If addLoader is called, the surfaces take a reference to the loader but do not take ownership of it. The loader could be added to data layers as well as the surface. The application must ensure that the loader remains in existence while the surface has a reference to it, and the application must delete the loader when it is no longer needed.

But if the surface creates a TSLFileLoaderBlocking because no loader was added, the surface will own the loader and will delete it when necessary. In fact, all surfaces share a single static loader which is created when first needed and destroyed when no longer needed.

The loader is always used in synchronous mode.

The loader is shared between drawing surfaces. The adding of a loader is not thread safe. Either add the loader before starting any threads that use Drawing Surfaces or block the use of all Drawing Surfaces while adding a loader. This is only necessary if you are using Drawing Surfaces in separate threads.

Parameters
loaderthe loader to add. Pass NULL to remove the loader from the Drawing Surfaces.
Returns
true if successful.

◆ addPathList()

static bool TSLDrawingSurfaceBase::addPathList ( TSLPathList * path_list)
static

Add a TSLPathList object to all surfaces. This will be used for finding files, for example in setupColours.

The pathlist is shared between drawing surfaces. The adding of a pathlist is not thread safe. Either add the pathlist before starting any threads that use Drawing Surfaces or block the use of all Drawing Surfaces while adding a pathlist. This is only necessary if you are using Drawing Surfaces in separate threads.

The pathlist object is only thread safe if it is not modified while in use.

Parameters
path_listthe pathlist to add. Pass NULL to remove the pathlist from the drawing surfaces.
Returns
true on a successful addition, false otherwise.
Note
The class takes a copy of the pointer passed, so the pathlist must stay in existence so long as any surface exists. The class does not take ownership of the pathlist.

◆ attach() [1/3]

void TSLDrawingSurfaceBase::attach ( TSLDeviceContext handle)

Attaches a new Device Context (HDC) to the drawing surface.

The TSLDrawingSurface will require update of window size after this call.

Note:

  1. setDeviceCapabilities will need to be called if the device capabilities need to be adjusted.
  2. This function is Microsoft specific.
Parameters
handleHDC to attach to the drawing surface.

◆ attach() [2/3]

void TSLDrawingSurfaceBase::attach ( TSLDrawableHandle handle)

Attaches a new Drawable to the drawing surface.

The TSLDrawingSurface will require update of window size after this call.

Note:

  1. setDeviceCapabilities will need to be called if the device capabilities need to be adjusted.
  2. This function is X11 specific.
  3. If the Display, Screen, Visual, Colormap are different the use the attach on the TSLMotifSurface (X11 Drawing Surface).
Parameters
handleDrawable to attach to the drawing surface.

◆ attach() [3/3]

void TSLDrawingSurfaceBase::attach ( TSLWindowHandle handle)

Attaches a new Window handle (HWND) to the drawing surface.

The TSLDrawingSurface will require update of window size after this call.

Note:

  1. setDeviceCapabilities will need to be called if the device capabilities need to be adjusted.
  2. This function is Microsoft specific.
Parameters
handleHWND to attach to the drawing surface.

◆ bringInFrontof()

bool TSLDrawingSurfaceBase::bringInFrontof ( const char * move_data_layer,
const char * target_data_layer )

Move Data Layer in front of another Data Layer.

This method allows the display order of the attached TSLDataLayer instances to be modified. The TSLDataLayer identified by 'move_data_layer' is moved so that it is drawn immediately after the TSLDataLayer identified by 'target_ data_layer'.

Parameters
move_data_layerName of a TSLDataLayer instance attached to this TSLDrawingSurface. This is the 'data_id' parameter that was passed when the TSLDataLayer was added to the TSLDrawingSurface.
target_data_layerName of a TSLDataLayer instance attached to this TSLDrawingSurface. This is the 'data_id' parameter that was passed when the TSLDataLayer was added to the TSLDrawingSurface.
Returns
true on success, false otherwise.

◆ bringToFront()

bool TSLDrawingSurfaceBase::bringToFront ( const char * move_data_layer)

Move Data Layer to top of Drawing Surface display list.

This method allows the display order of the attached TSLDataLayer instances to be modified. The specified TSLDataLayer instance will be drawn on top of all other TSLDataLayer instances attached to this TSLDrawingSurface.

Parameters
move_data_layerName of a TSLDataLayer. This is the 'data_id' parameter that was passed when the TSLDataLayer was added to the TSLDrawingSurface.
Returns
true on success, false otherwise.

◆ clearAllDeclutterData()

bool TSLDrawingSurfaceBase::clearAllDeclutterData ( const char * layer_name = 0)

Clears all feature decluttering.

Parameters
layer_nameName of the layer to clear the decluttering on. If this is NULL, feature decluttering is cleared from all layers in the drawing surface.
Returns
true on success, false otherwise.

◆ clearAllDynamicRenderers()

void TSLDrawingSurfaceBase::clearAllDynamicRenderers ( )

Clears (and destroys) all dynamic renderers that have been added to the drawing surface. This includes any dynamic renderers that are associated with a specific data layer in the surface.

If the same data layer is shared between multiple drawing surfaces in separate threads and has a dynamic render associated with it, care should be taken when calling this method to ensure that the common data layer is not being drawn or otherwise used by the other threads.

◆ clearBackgroundColour()

bool TSLDrawingSurfaceBase::clearBackgroundColour ( )

Clears the background colour of the TSLDrawingSurface.

If the background colour is cleared and a draw request is made which specifies the clear flag, then under Windows, the Drawing Surface will clear the area using a white brush; under X the Drawing Surface will clear the area of (i) a window using the 'background_pixel' / 'background_pixmap' attributes or (ii) a pixmap using WhitePixel of the display.

Returns true on success, false otherwise.

◆ clearDeclutterData()

bool TSLDrawingSurfaceBase::clearDeclutterData ( const char * feature_name,
const char * layer_name = 0 )

Clear feature decluttering.

This method removes the declutter data for the named feature. If there is no declutter data for a given feature the TSLDrawingSurface will not check for visibility when that feature is encountered, therefore this feature is always visible.

Parameters
feature_nameName of the feature for which to clear the declutter settings
layer_nameName of the layer to clear the decluttering on. If this is NULL, the declutter settings for the feature will be cleared from all layers in the drawing surface.
Returns
true on success, false otherwise.

◆ clearDynamicRenderer()

bool TSLDrawingSurfaceBase::clearDynamicRenderer ( TSLFeatureID featureID = -1,
const char * layerName = 0 )

This method clears (and destroys) a Dynamic Renderer from the drawing surface.

There are 4 different ways of deciding if a Dynamic Renderer should be used to render a particular entity - in this order.

  1. If featureID and layerName are specified, then entities in that data layer with that feature ID will trigger the Dynamic Renderer.
  2. If featureID is -1, but a layerName is specified, then all entities in that data layer will trigger the Dynamic Renderer.
  3. If featureID is specified, but layerName is NULL, then all entities of that feature ID will trigger the Dynamic Renderer.
  4. If featureID is -1, and layerName is NULL, then all entities on the Drawing Surface will trigger the Dynamic Renderer.

Any existing renderer for this featureID/layerName combination is destroyed.

Parameters
featureIDFeature ID of entities that trigger this renderer. -1 if featureID is not relevant in the decision. Default -1
layerNameName of data layer that this renderer applies to. 0 if layer is not relevant in the decision. Default 0
Returns
true if successfully cleared, false otherwise.

◆ clearFeatureRendering()

bool TSLDrawingSurfaceBase::clearFeatureRendering ( const char * featureName,
TSLFeatureID featureID )

Clear feature rendering.

This method removes the rendering style information that has been previously set for a given feature, by one of the 'setRendering' methods.

When MapLink is rendering a feature, it first looks at whether the entity has an attribute set. If so, then it tries to apply that attribute set and render the entity. If not, then it uses the feature id of the entity to index into the rendering information loaded into the drawing surface. If there is no rendering information in the drawing surface, then it defaults to the rendering information stored with the map.

If an entity has no attribute set or feature id, then the parent is recursively queried for attribute set and feature code.

If neither an entity, nor any of its parents have attribute sets or feature id, then the entity will not be rendered.

Parameters
featureNameFeature class name from which the rendering style information is removed. NULL means use featureID.
featureIDNumeric ID of feature class as stored in TSLEntity::featureID
Returns
true on success, false otherwise.

◆ clearFrame()

bool TSLDrawingSurfaceBase::clearFrame ( )

Inhibit frame from being drawn around TSLDrawingSurface.

Returns true on success, false otherwise.

◆ cloneDynamicRenderersFrom()

bool TSLDrawingSurfaceBase::cloneDynamicRenderersFrom ( const TSLDrawingSurfaceBase * otherSurface)

◆ copyDeclutterData()

bool TSLDrawingSurfaceBase::copyDeclutterData ( const char * src_feature_name,
const char * dest_feature_name,
const char * src_layer_name = 0,
const char * dest_layer_name = 0 )

Copy feature decluttering.

This method copies the declutter information for one named feature to another named feature.

If no declutter data for the source feature exists then the declutter information for the destination feature will be cleared as if clearDeclutterData was called for that feature.

Any existing declutter data for the destination feature will be overwritten.

Parameters
src_feature_nameName of the source feature.
dest_feature_nameName of the destination feature.
src_layer_nameName of the source layer from which to read the declutter data for the source feature. If this is NULL, the declutter data for the source feature is read from the global declutter settings.
dest_layer_nameName of the destination layer for which to set the declutter data for the destination feature. If this is NULL, the declutter data for the destination feature is set on all data layers in the drawing surface.
Returns
true on success, false otherwise.

◆ detach()

void TSLDrawingSurfaceBase::detach ( )

Detach HDC/Pixmap/window from TSLDrawingSurface.

The user is responsible for the management of the detached HDC/Pixmap/window.

NB. The TSLDrawingSurface is made invalid until a valid HDC/Pixmap/window is re-attached.

◆ detachAllDynamicRenderers()

void TSLDrawingSurfaceBase::detachAllDynamicRenderers ( )

This method removes all dynamic renderers that have been added to the drawing surface, but does not destroy them. This includes any dynamic renderers that are associated with a specific data layer in the surface. The application is responsible for ensuring any dynamic renderers that were added to the drawing surface are destroyed.

If the same data layer is shared between multiple drawing surfaces in separate threads and has a dynamic render associated with it, care should be taken when calling this method to ensure that the common data layer is not being drawn or otherwise used by the other threads.

◆ detachDynamicRenderer()

bool TSLDrawingSurfaceBase::detachDynamicRenderer ( TSLFeatureID featureID = -1,
const char * layerName = 0 )

This method removes a Dynamic Renderer from the drawing surface but does not destroy it. The application is responsible for ensuring that the dynamic renderer is deleted.

There are 4 different ways of deciding if a Dynamic Renderer should be used to render a particular entity - in this order.

  1. If featureID and layerName are specified, then the dynamic renderer associated with entities in that data layer with that feature ID will be detached.
  2. If featureID is -1, but a layerName is specified, then the Dynamic Renderer associated with that data layer will be detached.
  3. If featureID is specified, but layerName is NULL, then the Dynamic Renderer associated with all entities of that feature ID will be detached.
  4. If featureID is -1, and layerName is NULL, then the drawing surface's global Dynamic Renderer will be detached.
Parameters
featureIDFeature ID of entities that trigger this renderer. -1 if featureID is not relevant in the decision. Default -1
layerNameName of data layer that this renderer applies to. 0 if layer is not relevant in the decision. Default 0
Returns
true if a Dynamic Renderer was detached from the drawing surface, false otherwise.

◆ featureClass()

const char * TSLDrawingSurfaceBase::featureClass ( TSLFeatureID feature_id)

Convert numeric feature id to feature class name.

The last map data layer added to the drawing surface is searched to provide the mapping between id and class name.

Returns feature class name associated with the given feature id.

Parameters
feature_idFeature id being queried. The feature id may be queried from a TSLEntity.
Returns
the feature name as a string or NULL if the feature could not be found.

◆ findFile()

static bool TSLDrawingSurfaceBase::findFile ( const char * filename,
TSLSimpleString & foundPath )
static

Uses the drawing surface's external and internal pathlists (i.e. that added by calling addPathList, and that created by calling loadStandardConfig, respectively) to search for a file.

Parameters
filenameThe name of the file to search for.
foundPathThis will be populated with the location that the file is found at.
Returns
true if the full path is found, false otherwise.

◆ forceLayer()

bool TSLDrawingSurfaceBase::forceLayer ( const char * data_id,
const char * detail_layer_name )

Force map layer to display specific detail layer.

This method forces the TSLDrawingSurface to use a specific layer for display purposes, rather than the layer automatically chosen by the TSLDrawingSurface.

Parameters
data_idName of the TSLMapDataLayer when added to the TSLDrawingSurface.
detail_layer_nameDetail layer name, as specified in the MapLink Processing Tool.
Returns
true on success, false otherwise.

◆ getBackgroundColour()

bool TSLDrawingSurfaceBase::getBackgroundColour ( TSLStyleID * value)

Returns the colour index for background colour.

This method returns the colour index of the background colour that TSLDrawingSurface uses to clear the background area with before the MapLink map data is drawn.

Parameters
valueStorage for Index into the current colour palette used by the application. If the index is '-1' then there is not current background colour.
Returns
true on success, false otherwise.

◆ getColourValue()

bool TSLDrawingSurfaceBase::getColourValue ( int colour,
unsigned char & r,
unsigned char & g,
unsigned char & b )

Returns the RGB value that corresponds to the given colour index according to the current drawing surface's palette.

If the given colour is an RGB colour and not a colour index, this function is equivalent to using the TSLDecomposeRGB macro.

◆ getDataLayer()

TSLDataLayer * TSLDrawingSurfaceBase::getDataLayer ( const char * data_id)

Query TSLDataLayer from Drawing Surface.

This method allows the user to query a Data Layer from the Drawing Surface.

Note: Data Layers may be added to more than one Drawing Surface.

Parameters
data_idThis is the user defined name of the Data Layer to be queried from the Drawing Surface.
Returns
pointer the TSLDataLayer of the specified name, NULL on error.

◆ getDataLayerInfo()

bool TSLDrawingSurfaceBase::getDataLayerInfo ( int N,
TSLDataLayer ** dataLayer,
const char ** layerName ) const

Query information about a Data Layer.

This method allows the user to get the name & pointer to the Nth TSLDataLayer.

Parameters
Nthe index to the Data Layer.
dataLayera pointer to the Nth Data Layer.
layerNamethe name of the Nth Data Layer.
Returns
true on success, false otherwise.

◆ getDataLayerProps()

bool TSLDrawingSurfaceBase::getDataLayerProps ( const char * data_id,
TSLPropertyEnum property_id,
TSLPropertyValue * old_value )

Query properties and flags for Data Layer.

This method allows the user to get the current property value for the TSLDataLayer.

Default values for the properties are documented in TSLPropertyEnum.

Parameters
data_idUser defined name of a TSLDataLayer. This is the 'data_id' parameter that was passed when the TSLDataLayer was added to the TSLDrawingSurface.
property_idProperty to get.
old_valueStorage for value of this property.
Returns
true on success, false otherwise.

◆ getDeclutterStatus() [1/2]

bool TSLDrawingSurfaceBase::getDeclutterStatus ( const char * feature_name,
TSLDeclutterStatusResultEnum * value,
const char * dataLayerName = 0,
const char * detailLayerName = 0 )

Queries feature decluttering settings for a given feature.

This method gets the visibility status of a feature within the TSLDrawingSurface. The visibility for a feature is either always ON, always OFF, or automatically set by the TSLDrawingSurface based on the current resolution.

Passing a partial feature class name gets the visibility setting for the set of all subclasses. For example, getting "VMAP0.Contour Line (Land)" will return a value of ON if all contour lines are on, OFF if all contour lines are off, AUTOMATIC if all contour lines are automatically decluttered or PARTIAL if the contour lines have a mixture of statuses.

Applications should generally always pass a layer name to this method, as the declutter status of a given feature may be different for each layer that contains that feature.

Parameters
feature_nameName of the feature type to get the status from.
valueStorage for current status.
dataLayerNameThe data layer to get the decluttering for. If this is NULL the declutter status is read from the global declutter list, which may differ from the declutter status of the layers in the drawing surface.
detailLayerNameThe detail layer to get the decluttering for - default to 0 to get the decluttering for all detail layers
Returns
true on success, false otherwise.

◆ getDeclutterStatus() [2/2]

bool TSLDrawingSurfaceBase::getDeclutterStatus ( TSLFeatureID feature_id,
TSLDeclutterStatusResultEnum * value,
const char * dataLayerName,
const char * detailLayerName = 0 )

Queries feature decluttering settings for a given feature by its identifier.

This method gets the visibility status of a feature within the TSLDrawingSurface. The visibility for a feature is either always ON, always OFF, or automatically set by the TSLDrawingSurface based on the current resolution.

When getting the status of a singular feature on a data layer and the feature ID is known then this method is more efficient than the alternative getDeclutterStatus that takes the feature name rather than the feature ID.

Parameters
feature_idID of the feature type to get the status from.
valueStorage for current status.
dataLayerNameThe data layer to get the decluttering for. This cannot be NULL.
detailLayerNamethe detail layer to get the decluttering for - default to 0 to get the decluttering for all detail layers
Returns
true on success, false otherwise.

◆ getDynamicRenderer()

TSLDynamicRenderer * TSLDrawingSurfaceBase::getDynamicRenderer ( TSLFeatureID featureID = -1,
const char * layerName = 0 )

This method gets a Dynamic Renderer from the drawing surface

There are 4 different ways of deciding if a Dynamic Renderer should be used to render a particular entity - in this order.

  1. If featureID and layerName are specified, then entities in that data layer with that feature ID will trigger the Dynamic Renderer.
  2. If featureID is -1, but a layerName is specified, then all entities in that data layer will trigger the Dynamic Renderer.
  3. If featureID is specified, but layerName is NULL, then all entities of that feature ID will trigger the Dynamic Renderer.
  4. If featureID is -1, and layerName is NULL, then all entities on the Drawing Surface will trigger the Dynamic Renderer.
Parameters
featureIDFeature ID of entities that trigger this renderer. -1 if featureID is not relevant in the decision. Default -1
layerNameName of data layer that this renderer applies to. 0 if layer is not relevant in the decision. Default 0
Returns
renderer for the specified parameters, 0 if no such renderer is associated with this drawing surface. The drawing surface still maintains ownership of the renderer.

◆ getFeatureRendering() [1/4]

bool TSLDrawingSurfaceBase::getFeatureRendering ( const char * featureName,
TSLFeatureID featureID,
TSLRenderingAttributeBool attribute,
bool * result ) const

Gets rendering for a specified feature class.

For further information about what attributes are available, see the setRendering methods on TSLEntity.

If a name is specified, then all data layers attached to the drawing surface are searched to provide a mapping to ID. They are searched in rendering order from back to front.

Where possible, it is more efficient for an application to use the featureID directly.

Parameters
featureNameName of feature class. NULL means use featureID.
featureIDNumeric ID of feature class as stored in TSLEntity::featureID
attributeType of rendering attribute to get
resultStorage for returned rendering attribute value
Returns
true if rendering attribute successfully read and stored in result, false otherwise.

◆ getFeatureRendering() [2/4]

bool TSLDrawingSurfaceBase::getFeatureRendering ( const char * featureName,
TSLFeatureID featureID,
TSLRenderingAttributeDouble attribute,
double * result ) const

Gets rendering for a specified feature class.

For further information about what attributes are available, see the setRendering methods on TSLEntity.

If a name is specified, then all data layers attached to the drawing surface are searched to provide a mapping to ID. They are searched in rendering order from back to front.

Where possible, it is more efficient for an application to use the featureID directly.

Parameters
featureNameName of feature class. NULL means use featureID.
featureIDNumeric ID of feature class as stored in TSLEntity::featureID
attributeType of rendering attribute to get
resultStorage for returned rendering attribute value
Returns
true if rendering attribute successfully read and stored in result, false otherwise.

◆ getFeatureRendering() [3/4]

bool TSLDrawingSurfaceBase::getFeatureRendering ( const char * featureName,
TSLFeatureID featureID,
TSLRenderingAttributeInt attribute,
int * result ) const

Gets rendering for a specified feature class.

For further information about what attributes are available, see the setRendering methods on TSLEntity.

If a name is specified, then all data layers attached to the drawing surface are searched to provide a mapping to ID. They are searched in rendering order from back to front.

Where possible, it is more efficient for an application to use the featureID directly.

Parameters
featureNameName of feature class. NULL means use featureID.
featureIDNumeric ID of feature class as stored in TSLEntity::featureID
attributeType of rendering attribute to get
resultStorage for returned rendering attribute value
Returns
true if rendering attribute successfully read and stored in result, false otherwise.

◆ getFeatureRendering() [4/4]

bool TSLDrawingSurfaceBase::getFeatureRendering ( const char * featureName,
TSLFeatureID featureID,
TSLRenderingAttributes * result ) const

Gets rendering for a specified feature class.

If a name is specified, then all data layers attached to the drawing surface are searched to provide a mapping to ID. They are searched in rendering order from back to front.

Where possible, it is more efficient for an application to use the featureID directly.

Parameters
featureNameName of feature class. NULL means use featureID.
featureIDNumeric ID of feature class as stored in TSLEntity::featureID
resultStorage for returned rendering attribute values
Returns
true if rendering attributes successfully read and stored in result, false otherwise.

◆ getLoader()

static TSLFileLoader * TSLDrawingSurfaceBase::getLoader ( )
static

Returns either the loader added by addLoader or the default static loader. If no static loader exists it is created.

◆ getNumDataLayers()

int TSLDrawingSurfaceBase::getNumDataLayers ( ) const

Returns the number of Data Layers attached to this Drawing Surface.

◆ getOption()

bool TSLDrawingSurfaceBase::getOption ( TSLOptionEnum option)

Query option flag.

Parameters
optionEnumeration value specifying option to query
Returns
the specified options flag for the behaviour of the TSLDrawingSurface.

◆ id() [1/2]

int TSLDrawingSurfaceBase::id ( ) const

Returns the user drawing surface ID. If no ID has been set, a number less than 0 that uniquely identifies the drawing surface will be returned instead.

◆ id() [2/2]

void TSLDrawingSurfaceBase::id ( int id_)

Sets the user drawing surface ID. Negative values are reserved.

Parameters
id_the user drawing surface ID to be set.

◆ idleProcess()

bool TSLDrawingSurfaceBase::idleProcess ( )

Perform idle processing.

This method should be called by the client application when it is idle to allow MapLink to carry out low priority tasks.

Returns true if MapLink needs more idle time, false if all idle processing is complete.

◆ loadDeclutter()

bool TSLDrawingSurfaceBase::loadDeclutter ( const char * filename)

Load feature decluttering file.

This method allows the user to load a set of declutter data from a given file. Each TSLDrawingSurface may, optionally, declutter features differently from another TSLDrawingSurface.

If addPathList or loadStandardConfig has been called then the pathlist is used to search for the file in suitable directories (using keying), if not then the system Path and the environment variable MAPLINK_PATH are used to search for the file, or alternatively the filename may be fully qualified.

Parameters
filenameDeclutter file name.
Returns
true if the file was found and loaded successfully, false otherwise.

◆ loadRendering()

bool TSLDrawingSurfaceBase::loadRendering ( const char * filename)

Load feature rendering file.

This method allows the user to load a set of rendering data from a given file. Each TSLDrawingSurface may, optionally, render data types in different ways from another TSLDrawingSurface.

If addPathList or loadStandardConfig has been called then the pathlist is used to search for the file in suitable directories (using keying), if not then the system Path and the environment variable MAPLINK_PATH are used to search for the file, or alternatively the filename may be fully qualified.

When MapLink is rendering a feature, it first looks at whether the entity has an attribute set. If so, then it tries to apply that attribute set and render the entity. If not, then it uses the feature id of the entity to index into the rendering information loaded into the TSLDrawingSurface. If there is no rendering information in the TSLDrawingSurface, then it defaults to the rendering information stored with the TSLDataLayer.

If an entity has neither attribute set nor feature id, then the parent is recursively queried for attribute set and feature code.

If neither an entity, nor any of its parents have attribute sets or feature id, then the entity will not be rendered.

Parameters
filenameName of the rendering data file.
Returns
true if file successfully loaded, false otherwise.

◆ pick() [1/2]

TSLPickResultSet * TSLDrawingSurfaceBase::pick ( const char * data_id,
TSLDeviceUnits x,
TSLDeviceUnits y,
TSLDeviceUnits aperture,
int depth = -1,
TSLPickSelector * selector = 0 )

Pick objects from a data layer from specified pixel location.

The detail layers used are the layer for the current drawing surface extent.

This method the specified layer to return a set of TSLPickResult objects which allows the user to determine what objects are contained within the specified pick area.

The TSLPickResultSet for a TSLDrawingSurface is only valid for immediate use since the data tiles to which they refer may be removed from memory if the cache is flushed.

In the default case, all tiles whose extent intersects the specified extent will be returned. These will include all entities within those tiles, even though some individual entities may not be within the extent.

Alternatively, if a depth is specified, then the query recurses into the tiles and returns only those individual entities that whose extents intersect the region. An optional feature name may also be specified.

NOTE:

  • When querying an Optimised map the query may return objects that can not be further analysed.
  • 3D picking does not maintain the geometry hierarchy due to the way picking has been implemented.
Parameters
data_idID of the datalayer to pick from.
(x,y)The location in pixels of the area to pick.
apertureThe size in pixels of the area to pick.
depthSpecifies how deep to look before returning a pointer to an object. If the depth is -1 (the default), individual entities are returned. If the depth is 0 it searches at the highest level in the tile (that is it may return a Group rather than an entity within the Group).
selectorOptional class derived from TSLPickSelector that can be used to further filter the results based on user criteria.

The return value is a TSLPickResultSet that contains the picked results. This object must be destroyed when finished with.

◆ pick() [2/2]

TSLPickResultSet * TSLDrawingSurfaceBase::pick ( TSLDeviceUnits x,
TSLDeviceUnits y,
TSLDeviceUnits aperture,
int depth,
TSLPickSelector * selector = 0 )

Pick objects from datalayers from specified pixel location.

The detail layers used are the layer for the current drawing surface extent.

This method requests all layers to return a set of TSLPickResult objects which allows the user to determine what objects are contained within the specified pick area.

The TSLPickResultSet for a TSLDrawingSurface is only valid for immediate use since the data tiles to which they refer may be removed from memory if the cache is flushed.

In the default case, all tiles whose extent intersects the specified extent will be returned. These will include all entities within those tiles, even though some individual entities may not be within the extent.

Alternatively, if a depth is specified, then the query recurses into the tiles and returns only those individual entities that whose extents intersect the region. An optional feature name may also be specified.

NOTE:

  • When querying an Optimised map the query may return objects that can not be further analysed.
  • 3D picking does not maintain the geometry hierarchy due to the way picking has been implemented.
Parameters
(x,y)The location in pixels of the area to pick.
apertureThe size in pixels of the area to pick.
depthSpecifies how deep to look before returning a pointer to an object. If the depth is -1 (the default), individual entities are returned. If the depth is 0 it searches at the highest level in the tile (that is it may return a Group rather than an entity within the Group).
selectorOptional class derived from TSLPickSelector that can be used to further filter the results based on user criteria.

The return value is a TSLPickResultSet that contains the picked results. This object must be destroyed when finished with.

◆ queryActiveLayer()

bool TSLDrawingSurfaceBase::queryActiveLayer ( const char * data_id,
char * detail_layer_name,
int detail_layer_name_size )

Query active detail layer from map data layer.

This method gets the name of the current detail layer used by the specified TSLMapDataLayer on the drawing surface. The name is copied into the supplied buffer.

Parameters
data_idThis is the user defined name of the data layer when it was added to the Drawing Surface, ie. passed to 'addDataLayer'.
detail_layer_nameLayer name output buffer.
detail_layer_name_sizeSize of the buffer
Returns
true on success, false otherwise.

◆ removeDataLayer()

bool TSLDrawingSurfaceBase::removeDataLayer ( const char * data_id)

Removes the named Data Layer from the Drawing Surface.

Parameters
data_idUser defined name of the TSLDataLayer object instance to be removed from the Drawing Surface.
Returns
true if the data layer has been removed successfully, false otherwise.

◆ saveDeclutter()

bool TSLDrawingSurfaceBase::saveDeclutter ( const char * filename,
TSLMapLinkVersion ver = TSL_CURRENT_MAPLINK_VERSION )

Save feature decluttering file.

This method allows any declutter data that the user has set for a TSLDrawingSurface to be saved to the specified file.

Parameters
filenameDeclutter file name.
verthe MapLink version to save as
Returns
true if the file was successfully saved, false otherwise.

◆ saveRendering()

bool TSLDrawingSurfaceBase::saveRendering ( const char * filename,
TSLMapLinkVersion ver = TSL_CURRENT_MAPLINK_VERSION )

Save rendering file.

This method allows any rendering information that the user has set up for a TSLDrawingSurface to be saved to the specified file.

Parameters
filenameName of the rendering data file.
verthe MapLink version to save as
Returns
true on success , false otherwise.

◆ sendToBack()

bool TSLDrawingSurfaceBase::sendToBack ( const char * move_data_layer)

Move Data Layer to bottom of Drawing Surface display list.

This method allows the specified TSLDataLayer to be placed behind all other attached TSLDataLayer instances attached to this TSLDrawingSurface.

Parameters
move_data_layerName of a TSLDataLayer instance. This is the 'data_id' parameter that was passed when the TSLDataLayer was added to the TSLDrawingSurface.
Returns
true on success, false otherwise.

◆ sendToBackOf()

bool TSLDrawingSurfaceBase::sendToBackOf ( const char * move_data_layer,
const char * target_data_layer )

Move Data Layer behind another Data Layer.

This method allows the display order of the attached TSLDatalayer instances to be modified. The TSLDataLayer object 'move_data_layer' is moved immediately behind the TSLDataLayer object 'target_data_layer'.

Parameters
move_data_layerName of a TSLDataLayer instance. This is the 'data_id' parameter that was passed when the TSLDataLayer was added to the TSLDrawingSurface.
target_data_layerName of a TSLDataLayer instance. This is the 'data_id' parameter that was passed when the TSLDataLayer was added to the TSLDrawingSurface.
Returns
true on success, false otherwise.

◆ setBackgroundColour()

bool TSLDrawingSurfaceBase::setBackgroundColour ( int value)

Set colour index for background colour.

This method sets the colour to be used by the TSLDrawingSurface when drawing a background area before the MapLink map data is drawn.

The default for the background colour is either the map background colour (should there be one) or else see the documentation for clearBackgroundColour.

Parameters
valueIndex into the current colour palette used by the application.
Returns
true on success, false otherwise.

◆ setCoordinateProvidingLayer()

bool TSLDrawingSurfaceBase::setCoordinateProvidingLayer ( const char * layer_name)

Sets the current coordinate providing layer to the one specified.

Once this method has been called with a valid layer name the coordinate providing layer will be fixed until the method is called again or the layer is removed from the drawing-surface.

Passing NULL as the parameter removes the current coordinate providing layer, and the surface uses the default behaviour for selection of a coordinate providing layer.

Parameters
layer_nameName of an attached data layer
Returns
true if the layer is a valid coordinate providing layer that is attached to the drawing-surface.

◆ setDataLayerProps()

bool TSLDrawingSurfaceBase::setDataLayerProps ( const char * data_id,
TSLPropertyEnum property_id,
TSLPropertyValue new_value )

Set properties and flags for Data Layer.

This method allows the user to set the properties for the TSLDataLayer. The properties are specific to this Drawing Surface and will not affect any other Drawing Surface that the named Data Layer is displayed in.

Default values for the properties are documented in TSLPropertyEnum.

Parameters
data_idUser defined name of a TSLDataLayer in this TSLDrawingSurface. This is the 'data_id' parameter that was passed when the TSLDataLayer was added to the TSLDrawingSurface.
property_idProperty to be set.
new_valueNew value for this property.
Returns
true on success, false otherwise.

◆ setDeclutterStatus() [1/2]

bool TSLDrawingSurfaceBase::setDeclutterStatus ( const char * feature_name,
TSLDeclutterStatusEnum value,
const char * dataLayerName = 0,
const char * detailLayerName = 0 )

Set feature decluttering action for a named feature.

This method sets the visibility of a feature within the TSLDrawingSurface. If the visibility is set to automatic the TSLDrawingSurface will determine when a feature should be made visible or invisible based upon on a resolution factor set in the setDeclutterRange method.

Passing a partial feature class name allows decluttering of the set of all subclasses. For example, decluttering "VMAP0.Contour Line (Land)" will declutter all VMAP0 contour lines.

Parameters
feature_nameName of the feature class.
valueStatus value.
dataLayerNameName of the layer to set the decluttering on. If this is NULL then the name feature(s) are decluttered on all layers in the drawing surface.
detailLayerNamename of the detail layer to set the decluttering on - default is 0 to set decluttering for all detail layers in which the feature appears
Returns
true on success, false otherwise.

◆ setDeclutterStatus() [2/2]

bool TSLDrawingSurfaceBase::setDeclutterStatus ( TSLFeatureID feature_id,
TSLDeclutterStatusEnum value,
const char * dataLayerName = 0,
const char * detailLayerName = 0 )

Set feature decluttering action for a feature by its identifier.

This method sets the visibility of a feature within the TSLDrawingSurface. If the visibility is set to automatic the TSLDrawingSurface will determine when a feature should be made visible or invisible based upon on a resolution factor set in the setDeclutterRange method.

If setting the declutter status of a singular feature and the feature ID is known then this method is more efficient than the alternative setDeclutterStatus that takes the feature name instead of the feature ID.

Applications should generally always pass a layer name to this function. Features in different data layers may have the same feature ID associated with different features as feature IDs are only unique to a data layer. Therefore decluttering features by ID across layers may result in a different feature being decluttered in each layer as the ID maps to a different feature name.

Parameters
feature_idID of the feature class.
valueStatus value.
dataLayerNameName of the layer to set the decluttering on. If this is NULL, the given feature ID will be decluttered on all layers in the drawing surface.
detailLayerNamename of the detail layer to set the decluttering on - default is 0 to set decluttering for all detail layers in which the feature appears
Returns
true on success, false otherwise.

◆ setDeclutterStatusOnAllFeatures()

bool TSLDrawingSurfaceBase::setDeclutterStatusOnAllFeatures ( TSLDeclutterStatusEnum value,
const char * dataLayerName = 0,
const char * detailLayerName = 0 )

Set feature decluttering action on all features that meet the criteria passed.

This method sets the visibility of a set of features within the TSLDrawingSurface. If the visibility is set to automatic the TSLDrawingSurface will determine when a feature should be made visible or invisible based upon on a resolution factor set in the setDeclutterRange method.

Parameters
valueStatus value.
dataLayerNameName of the layer to set the decluttering on. Default is 0 i.e. set for all layers.
detailLayerNameName of the detail layer to set the decluttering on - default is 0 to set decluttering for all detail layers in which the feature appears
Returns
true on success, false otherwise.

◆ setFeatureRendering() [1/4]

bool TSLDrawingSurfaceBase::setFeatureRendering ( const char * featureName,
TSLFeatureID featureID,
TSLRenderingAttributeBool attribute,
bool value )

Sets rendering for a specified feature class.

For further information about what attributes are available, see the setRendering methods on TSLEntity.

If a name is specified, then all data layers attached to the drawing surface are searched to provide a mapping to ID. They are searched in rendering order from back to front.

Where possible, it is more efficient for an application to use the featureID directly.

Parameters
featureNameName of feature class. NULL means use featureID.
featureIDNumeric ID of feature class as stored in TSLEntity::featureID
attributeType of rendering attribute to set
valueNew value for rendering attribute
Returns
true if rendering attribute successfully set, false otherwise.

◆ setFeatureRendering() [2/4]

bool TSLDrawingSurfaceBase::setFeatureRendering ( const char * featureName,
TSLFeatureID featureID,
TSLRenderingAttributeDouble attribute,
double value )

Sets rendering for a specified feature class.

For further information about what attributes are available, see the setRendering methods on TSLEntity.

If a name is specified, then all data layers attached to the drawing surface are searched to provide a mapping to ID. They are searched in rendering order from back to front.

Where possible, it is more efficient for an application to use the featureID directly.

Parameters
featureNameName of feature class. NULL means use featureID.
featureIDNumeric ID of feature class as stored in TSLEntity::featureID
attributeType of rendering attribute to set
valueNew value for rendering attribute
Returns
true if rendering attribute successfully set, false otherwise.

◆ setFeatureRendering() [3/4]

bool TSLDrawingSurfaceBase::setFeatureRendering ( const char * featureName,
TSLFeatureID featureID,
TSLRenderingAttributeInt attribute,
int value )

Sets rendering for a specified feature class.

For further information about what attributes are available, see the setRendering methods on TSLEntity.

If a name is specified, then all data layers attached to the drawing surface are searched to provide a mapping to ID. They are searched in rendering order from back to front.

Where possible, it is more efficient for an application to use the featureID directly.

Parameters
featureNameName of feature class. NULL means use featureID.
featureIDNumeric ID of feature class as stored in TSLEntity::featureID
attributeType of rendering attribute to set
valueNew value for rendering attribute
Returns
true if rendering attribute successfully set, false otherwise.

◆ setFeatureRendering() [4/4]

bool TSLDrawingSurfaceBase::setFeatureRendering ( const char * featureName,
TSLFeatureID featureID,
TSLRenderingAttributes * value )

Sets rendering for a specified feature class.

If a name is specified, then all data layers attached to the drawing surface are searched to provide a mapping to ID. They are searched in rendering order from back to front.

Where possible, it is more efficient for an application to use the featureID directly.

Parameters
featureNameName of feature class. NULL means use featureID.
featureIDNumeric ID of feature class as stored in TSLEntity::featureID
valueNew value for rendering attributes
Returns
true if rendering attributes successfully set, false otherwise.

◆ setFrame()

bool TSLDrawingSurfaceBase::setFrame ( int style,
int colour,
int thickness )

Setup a frame to be drawn around drawing surface.

This frame is drawn once all rendering is complete.

This functionality is not supported in the OpenGL drawing surface.

Parameters
styleStyle for the frame
colourColour of the frame
thicknessThickness of the frame
Returns
true on success, false otherwise.

◆ setOption()

virtual void TSLDrawingSurfaceBase::setOption ( TSLOptionEnum option,
bool value )
virtual

Set option bitfield.

Parameters
optionEnumeration value specifying option to set
valueNew value for option flag.

Reimplemented in TSL3DDrawingSurface, and TSLAcceleratedSurface.

◆ TMCperMU()

double TSLDrawingSurfaceBase::TMCperMU ( )

Query number of TMC units per map unit.

This value is the number of internal TMC co-ordinates per map unit. These is based upon the last map data layer added to the drawing surface.

Returns the TMC units per map unit, 0.0 on error.

◆ type()

TSLDrawingSurfaceTypeEnum TSLDrawingSurfaceBase::type ( ) const

This method returns the type of the drawing surface.

◆ userWord() [1/2]

void * TSLDrawingSurfaceBase::userWord ( ) const

Returns a pointer to the user data stored on the drawing surface.

◆ userWord() [2/2]

void TSLDrawingSurfaceBase::userWord ( void * ptr) const

Stores a pointer to user data on the drawing surface.

Parameters
ptrThe pointer to the user data.

Member Data Documentation

◆ m_classID

void* TSLDrawingSurfaceBase::m_classID
protected