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

Detailed Description

Specialist data layer to be used with TSLCustomDataLayer.

The developer should derive a new class from here and overload the drawLayer() method to receive callbacks when the layer requires redrawing. This allows the developer to custom draw into the drawing surface via the TSLRenderingInterface or TSLCustomDataLayerHandler.

Additional methods can also be overridden to allow the layer to provide a TSLCoordinateSystem to manage coordinate transformations for data layers within a drawing surface in a similar fashion to a TSLMapDataLayer.

When using a Custom Data Layer within a drawing surface from the 3D SDK or Accelerator SDK the developer should ensure that the layer implementation is thread safe. If the data layer implementation is not thread safe a Custom Data Layer must not be shared between multiple drawing surfaces under any circumstances.

Public Member Functions

virtual ~TSLClientCustomDataLayer ()
 
virtual const TSLCoordinateSystemcoordinateSystem () const
 
bool coordinateSystemHasChanged ()
 
virtual TSLClientCustomDataLayerclone () const
 
TSLCustomDataLayerdataLayer ()
 
virtual bool drawLayer (TSLRenderingInterface *renderingInterface, const TSLEnvelope *extent, TSLCustomDataLayerHandler &layerHandler)=0
 
virtual int editableSearchDepth () const
 
virtual TSLDataLayergetActiveLayer (const TSLEnvelope &extent, double screenResolution)
 
virtual bool getActiveLayerName (const TSLEnvelope &extent, double screenResolution, TSLSimpleString &activeLayerName) const
 
virtual TSLEntitySetgetEditableItems ()
 
virtual bool getExtent (TSLEnvelope &extent, int drawingSurfaceID) const
 
virtual TSLDataLayergetLayer (int index)
 
virtual bool hasCoordinateSystem () const
 
virtual bool isCloneable () const
 
virtual bool isDynamic () const
 
virtual bool loadData (const char *filename)
 
virtual int numberOfLayers ()
 
virtual bool pick (const TSLRenderingInterface *renderingInterface, const TSLEnvelope &extent, TSLPickResultSet *results)
 
virtual void releaseResources (int surfaceID)
 
virtual bool removeData ()
 
virtual void setActiveLayer (const char *layerName)
 
virtual bool setCoordinateSystem (const TSLCoordinateSystem *coordinateSystem)
 
virtual bool update (const TSLClientCustomDataLayer *object) const
 

Protected Member Functions

 TSLClientCustomDataLayer ()
 

Constructor & Destructor Documentation

◆ ~TSLClientCustomDataLayer()

virtual TSLClientCustomDataLayer::~TSLClientCustomDataLayer ( )
virtual

Default destructor for TSLClientCustomDataLayer.

◆ TSLClientCustomDataLayer()

TSLClientCustomDataLayer::TSLClientCustomDataLayer ( )
protected

Default constructor for TSLClientCustomDataLayer.

Declared protected to prevent non-derived classes from accessing this class.

Member Function Documentation

◆ clone()

virtual TSLClientCustomDataLayer * TSLClientCustomDataLayer::clone ( ) const
virtual

This method is called when a clone of the user-derived TSLClientCustomDataLayer is required.

The developer may return NULL or a clone of the client.

If NULL is returned then the Custom Data-layer may not be drawn.

Returns NULL or a clone of this TSLClientCustomDataLayer.

◆ coordinateSystem()

virtual const TSLCoordinateSystem * TSLClientCustomDataLayer::coordinateSystem ( ) const
virtual

Provides callbacks to the application when the coordinate system of the layer is needed.

The developer may provide an implementation of this method that returns the TSLCoordinateSystem that the layer uses. The coordinate system remains owned by the user and must not be modified or deleted while a drawing surface containing the layer is drawing.

The default implementation of this method returns NULL, meaning that the layer has no coordinate system.

◆ coordinateSystemHasChanged()

bool TSLClientCustomDataLayer::coordinateSystemHasChanged ( )

This method must be called when the Coordinate System associated with this layer has been changed.

This is required when drawing Geodetic Primitives as the shape is dependent on the projection settings.

Returns true if successful.

◆ dataLayer()

TSLCustomDataLayer * TSLClientCustomDataLayer::dataLayer ( )

Returns the TSLCustomDataLayer that this client has been attached to via the TSLCustomDataLayer::setClientCustomDataLayer() method. If this client has not been attached to any TSLCustomDataLayer this method will return NULL.

◆ drawLayer()

virtual bool TSLClientCustomDataLayer::drawLayer ( TSLRenderingInterface * renderingInterface,
const TSLEnvelope * extent,
TSLCustomDataLayerHandler & layerHandler )
pure virtual

Provides callbacks to the application when the layer is redrawing.

The developer should provide an implementation of this method to allow custom drawing within the application.

Parameters
renderingInterfaceProvides a handle to the drawing operations within a layer.
extentProvides the extent of the area being drawn by the drawing surface in TMCs.
layerHandlerA TSLCustomDataLayerHandler instance that can be used to draw additional TSLDataLayer-derived classes as part of the drawing of the custom data layer.

The implementation should return true if the drawing succeeds, or false otherwise.

◆ editableSearchDepth()

virtual int TSLClientCustomDataLayer::editableSearchDepth ( ) const
virtual

Provides a callback to the application when searching the editable items returned by the getEditableItems() callback.

By default when using the Editor SDK a layer only has the topmost level of its editable items searched during operations such as select. If the custom data layer implementation uses additional entity sets within the editable items for segmentation purposes this may lead to undesirable effects when attempting to select items within the custom data layer for editing.

This callback allows for an implementation to override the default minimum search depth within its editable items in order to allow selection of editable items within these container groups.

The default implementation of this method returns 0, meaning that there is no minimum search depth.

◆ getActiveLayer()

virtual TSLDataLayer * TSLClientCustomDataLayer::getActiveLayer ( const TSLEnvelope & extent,
double screenResolution )
virtual

This method is called to set the active layer

Parameters
extentThe extent to select the datalayer from
screenResolutionThe screen resolution to select the datalayer for
Returns
the active datalayer for the given extent and resolution

◆ getActiveLayerName()

virtual bool TSLClientCustomDataLayer::getActiveLayerName ( const TSLEnvelope & extent,
double screenResolution,
TSLSimpleString & activeLayerName ) const
virtual

This method is called when the Drawing Surface needs to know what active layer the application will be drawing for a given extent and drawing surface resolution.

The activeLayerName is basically a name given to a particular level of data (detail layer) being displayed, for example;

if you have several different scales to display with different data, you would return a different name for each scale (detail layer).

This allows the drawing surface the ability to detect when it needs to throw away any cached detail-layer specific tile data. This affects the Accelerator and 3D drawing surfaces.

This should always be implemented as a matter of course for all custom layers that contain multiple logical layers. Each layer just needs to be uniquely identified by a name within this layer. The layer names do not need to be unique between instances of the layer.

Parameters
extentextent of the area that is being queried
screenResolutionThe TMC units per Device Unit.
activeLayerNameThe layer name for the extent and screenResolution is returned in this parameter.
Returns
This method should return true on success, false otherwise.

◆ getEditableItems()

virtual TSLEntitySet * TSLClientCustomDataLayer::getEditableItems ( )
virtual

Provides callbacks to the application when the layer is being edited via the Editor SDK and the contents of the layer that can be edited are needed.

The developer may provide an implementation of this method that returns a TSLEntitySet containing the entities within the layer that can be edited. The client custom data layer retains ownership of the entity set.

The default implementation of this method returns NULL, meaning that the layer has no editable items.

◆ getExtent()

virtual bool TSLClientCustomDataLayer::getExtent ( TSLEnvelope & extent,
int drawingSurfaceID ) const
virtual

Provides callbacks to the application when the extent of the layer needs to be known.

The developer should provide an implementation of this method that populates the provided TSLEnvelope with the total extent in TMCs of the layer.

The implementation should return true if the provided TSLEnvelope was populated with the extent of the layer, otherwise it should return false. It is not required that this method is implemented, however it allows the drawing surface containing this layer to avoid redrawing the layer should the extent indicate it is outside the area being redrawn. This results in higher performance by avoiding unnecessary drawing.

Parameters
extentStorage for the TMC extent of the layer
drawingSurfaceIDIf the layer is present in more than one drawing surface, this will be the ID of the drawing surface requesting the extent of the layer.
Returns
This method should return true if the extent was set, false otherwise. The default implementation returns false.

◆ getLayer()

virtual TSLDataLayer * TSLClientCustomDataLayer::getLayer ( int index)
virtual

This method is called to retrieve a specific internal datalayer

Parameters
indexThe index of the datalayer to return
Returns
the TSLDataLayer located at index

◆ hasCoordinateSystem()

virtual bool TSLClientCustomDataLayer::hasCoordinateSystem ( ) const
virtual

Provides callbacks to the application when it is necessary to know if the layer has a coordinate system or not.

The developer may provide an implementation of this method, returning true if the layer has a TSLCoordinateSystem or false if not. If the implementation of this method returns true, the coordinateSystem() method should also be implemented.

The default implementation of this method returns false, meaning that the layer has no coordinate system.

◆ isCloneable()

virtual bool TSLClientCustomDataLayer::isCloneable ( ) const
virtual

The developer should return true if the clone method is capable of returning a valid clone of this class.

◆ isDynamic()

virtual bool TSLClientCustomDataLayer::isDynamic ( ) const
virtual

The developer should return true if the data being drawn is dynamic or the way the data is being drawn is dynamic. False should be returned otherwise.

A drawing surface may make use of the return value to optimise the drawing.

◆ loadData()

virtual bool TSLClientCustomDataLayer::loadData ( const char * filename)
virtual

This method is called to load a specific data file to the layer

Parameters
filenameThe file to load
Returns
true on success, false otherwise

◆ numberOfLayers()

virtual int TSLClientCustomDataLayer::numberOfLayers ( )
virtual

This method is called to retrieve the number of TSLDataLayers used by the TSLClientCustomDataLayer

Returns the number of TSLDataLayers

◆ pick()

virtual bool TSLClientCustomDataLayer::pick ( const TSLRenderingInterface * renderingInterface,
const TSLEnvelope & extent,
TSLPickResultSet * results )
virtual

The developer should implement this method if picking support is required.

If the custom data layer contains additional TSLDataLayers that are drawn as part of the drawLayer() implementation, it is the developer's responsibility to ensure that any items within these data layers are added to the pick results set.

Note that any data layers contained in this fashion do not have their own TSLPropertyDetect, TSLPropertySelect and TSLPropertyTransparent data layer properties. If it is desired that these contained data layers have a different property value from the custom data layer that contains them it is necessary for the developer to implement the mechanism for this.

Parameters
renderingInterfaceProvides access to information on the drawing surface that the pick was triggered from, and the current state of that drawing surface.
extentThe pick extent
resultsThe picking results
Returns
false to exit the pick operation, true to continue.

◆ releaseResources()

virtual void TSLClientCustomDataLayer::releaseResources ( int surfaceID)
virtual

This method is called when the Drawing Surface invalidates its native drawing resources.

The user will need to release any surface specific resources.

The use of this method is very dependent upon the Drawing Surface technology.

If the layer contains other MapLink layers you should call the layers' releaseResources methods with the surfaceID.

Parameters
surfaceIDA unique surface number.

◆ removeData()

virtual bool TSLClientCustomDataLayer::removeData ( )
virtual

This method is called to remove data from the layer.

Returns true on success, false otherwise

◆ setActiveLayer()

virtual void TSLClientCustomDataLayer::setActiveLayer ( const char * layerName)
virtual

This method is called to set the active layer

Parameters
layerNameThe name of the datalayer to use as the active layer

◆ setCoordinateSystem()

virtual bool TSLClientCustomDataLayer::setCoordinateSystem ( const TSLCoordinateSystem * coordinateSystem)
virtual

This method is called to set the Coordinate System of the layer.

The Coordinate System should be cloned.

If a Coordinate System is set then the user should return a clone from coordinateSystem().

Parameters
coordinateSystemThe coordinate system to set.
Returns
true if set, false otherwise.

◆ update()

virtual bool TSLClientCustomDataLayer::update ( const TSLClientCustomDataLayer * object) const
virtual

This method is called with a TSLClientCustomDataLayer of the same derived class.

The developer is expected to update this object with any differences between the object passed in and the this object.

If the this object is updated the developer should return true, otherwise the developer should return false.

Parameters
objectobject to update this this object with.