![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
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 TSLCoordinateSystem * | coordinateSystem () const |
bool | coordinateSystemHasChanged () |
virtual TSLClientCustomDataLayer * | clone () const |
TSLCustomDataLayer * | dataLayer () |
virtual bool | drawLayer (TSLRenderingInterface *renderingInterface, const TSLEnvelope *extent, TSLCustomDataLayerHandler &layerHandler)=0 |
virtual int | editableSearchDepth () const |
virtual TSLDataLayer * | getActiveLayer (const TSLEnvelope &extent, double screenResolution) |
virtual bool | getActiveLayerName (const TSLEnvelope &extent, double screenResolution, TSLSimpleString &activeLayerName) const |
virtual TSLEntitySet * | getEditableItems () |
virtual bool | getExtent (TSLEnvelope &extent, int drawingSurfaceID) const |
virtual TSLDataLayer * | getLayer (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 () | |
|
virtual |
Default destructor for TSLClientCustomDataLayer.
|
protected |
Default constructor for TSLClientCustomDataLayer.
Declared protected to prevent non-derived classes from accessing this class.
|
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.
|
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.
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.
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.
|
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.
renderingInterface | Provides a handle to the drawing operations within a layer. |
extent | Provides the extent of the area being drawn by the drawing surface in TMCs. |
layerHandler | A 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.
|
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.
|
virtual |
This method is called to set the active layer
extent | The extent to select the datalayer from |
screenResolution | The screen resolution to select the datalayer for |
|
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.
extent | extent of the area that is being queried |
screenResolution | The TMC units per Device Unit. |
activeLayerName | The layer name for the extent and screenResolution is returned in this parameter. |
|
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.
|
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.
extent | Storage for the TMC extent of the layer |
drawingSurfaceID | If 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. |
|
virtual |
This method is called to retrieve a specific internal datalayer
index | The index of the datalayer to return |
|
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.
|
virtual |
The developer should return true if the clone method is capable of returning a valid clone of this class.
|
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.
|
virtual |
This method is called to load a specific data file to the layer
filename | The file to load |
|
virtual |
This method is called to retrieve the number of TSLDataLayers used by the TSLClientCustomDataLayer
Returns the number of TSLDataLayers
|
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.
renderingInterface | Provides access to information on the drawing surface that the pick was triggered from, and the current state of that drawing surface. |
extent | The pick extent |
results | The picking results |
|
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.
surfaceID | A unique surface number. |
|
virtual |
This method is called to remove data from the layer.
Returns true on success, false otherwise
|
virtual |
This method is called to set the active layer
layerName | The name of the datalayer to use as the active layer |
|
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().
coordinateSystem | The coordinate system to set. |
|
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.
object | object to update this this object with. |