![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This abstract base class represents the visualisation of a TSLDynamicData Object (DDO). Derived classes will represent concrete display objects (such as e.g. AccidentDO, RoadworksDO, ...).
Derived-TSLDisplayObject (DO) classes must provide an implementation of the draw() method, which is actually responsible for painting the object on screen.
When a TSLObjectDataLayer is added to a TSLDrawingSurface, a DO is created for each DDO by calling the instantiateDO method associated with that DDO class.
A derived-DDO class can have several classes of DOs associated with it. This allows clients to use different visualisation in different drawing surfaces.
Public Member Functions | |
TSLDisplayObject (bool visibility=true) | |
TSLDisplayObject (const TSLDisplayObject &rhs) | |
virtual | ~TSLDisplayObject () |
bool | bringToFront () |
virtual bool | draw (TSLRenderingInterface *d_surface, TSLEnvelope *d_extent)=0 |
void | move (TSLTMC x, TSLTMC y) |
void | move (TSLCoord pos) |
virtual bool | pick (const TSLEnvelope &extent) |
bool | positionIsSet () |
virtual void | releaseResources (int surfaceID) |
void | selectable (bool selectability) |
bool | sendToBack () |
void | translate (TSLCoord pos) |
void | translate (TSLTMC x, TSLTMC y) |
virtual void | unclone () |
void | visible (bool visibility) |
const TSLDynamicDataObject * | DDO () const |
TSLDynamicDataObject * | DDO () |
bool | fixedPixSize () const |
TSLEnvelope | getExtent () |
TSLEnvelope | getPixSize () const |
void | position (const TSLCoord &newPos) |
void | position (TSLTMC x, TSLTMC y) |
TSLCoord | position () const |
bool | selectable () const |
void | setExtent (const TSLEnvelope &extent) |
void | setExtent (TSLTMC x1, TSLTMC y1, TSLTMC x2, TSLTMC y2) |
void | setPixSize (TSLDeviceUnits x1, TSLDeviceUnits y1, TSLDeviceUnits x2, TSLDeviceUnits y2) |
void | setSize (TSLTMC x1, TSLTMC y1, TSLTMC x2, TSLTMC y2) |
bool | visible () const |
Protected Attributes | |
TSLEnvelope | m_extent |
TSLCoord | m_position |
bool | m_selectability |
bool | m_visibility |
TSLDynamicDataObject * | m_ddo |
void * | m_doMgr |
TSLDisplayObject::TSLDisplayObject | ( | bool | visibility = true | ) |
Default constructor.
visibility | If true, then the TSLDisplayObject (DO) is visible. |
After construction, the DO has the specified visibility, is selectable and has zero extent.
TSLDisplayObject::TSLDisplayObject | ( | const TSLDisplayObject & | rhs | ) |
Copy constructor.
rhs | The display object to be copied. |
|
virtual |
Virtual destructor.
Removes itself from its visualisation manager & requests its associated TSLDynamicDataObject to remove it from its list of TSLDisplayObjects.
bool TSLDisplayObject::bringToFront | ( | ) |
Move the DisplayObject to the top of the DrawingSurface display list.
Returns true on success, false otherwise.
|
inline |
Query method for the TSLDynamicDataObject (DDO) that this TSLDisplayObject represents.
Returns a pointer to the associated DDO, 0 otherwise.
|
inline |
Query method for the TSLDynamicDataObject (DDO) that this TSLDisplayObject represents.
Returns a pointer to the associated (const) DDO, 0 otherwise.
Class TSLDisplayObject
|
pure virtual |
Paints the Display Object. This method must be overridden by the application specific class to provide the visualisation of the Display Object
d_surface | The interface into which to draw. |
d_extent | The extent (in TMC units) of the draw area. |
|
inline |
Query method for whether the extent of a TSLDisplayObject (DO) is a fixed pixel size.
Returns true if the extent is a fixed pixel size, false otherwise.
|
inline |
Query method for the extent of a TSLDisplayObject (DO).
If the display object is fixed size and the containing object layer hasn't been added to a drawing surface, this function will return a default constructed extent and an error message will be posted to the Errorstack.
Returns the extent of the DO.
|
inline |
Query method for the pixel size of a TSLDisplayObject (DO).
Note: this method should only be called if setPixSize() has been previously called.
Returns the size of the DO (in pixels).
void TSLDisplayObject::move | ( | TSLCoord | pos | ) |
Move the TSLDisplayObject (DO) to the given (TSLCoord) position. This method also recalculates the DO's extent.
pos | The position to move to in TMC units. |
void TSLDisplayObject::move | ( | TSLTMC | x, |
TSLTMC | y ) |
Move the TSLDisplayObject (DO) to the given (x,y) position. This method also recalculates the DO's extent.
(x,y) | The new position in TMC units. |
|
virtual |
Virtual function that notifies the display object that a Pick operation is being performed on the display object.
Derived display object classes should check using the given extent to see if the display object has been picked and if so return true to pick it.
extent | TMC extent of the are being picked. |
The function should true if the DO is picked else it should return 0.
|
inline |
Query method for the position of the TSLDisplayObject (DO).
Returns the DO position in TMC units.
|
inline |
Set the TSLDisplayObject position (given a TSLCoord).
Does not modify the extent. Usually only used during initialisation.
newPos | The new position in TMC units. |
|
inline |
Set the TSLDisplayObject position (given x & y). Does not modify the extent.
Usually only used during initialisation.
(x,y) | The new position in TMC units. |
bool TSLDisplayObject::positionIsSet | ( | ) |
Queries whether the Display Object position has been set.
This is used by the Object Data Layer after the Display Object has been instantiated. If the position has not already been set, then the Display Objects position is set to the position of the owning Dynamic Data Object.
|
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.
surfaceID | A unique surface number. |
|
inline |
Query method for selectability of the TSLDisplayObject (DO).
Returns true if DO is selectable, false otherwise.
void TSLDisplayObject::selectable | ( | bool | selectability | ) |
Set the selectability of the TSLDisplayObject (DO).
selectability | If true, then DO is selectable. |
bool TSLDisplayObject::sendToBack | ( | ) |
Move the DisplayObject to the bottom of the DrawingSurface display list.
Returns true on success, false otherwise.
|
inline |
Set the extent of the TSLDisplayObject (DO) - mutually exclusive with set Size and setPixSize.
extent | The TSLEnvelope (in TMC units) describing the DO extent. |
|
inline |
Set the extent of the TSLDisplayObject (DO) in TMC units - mutually exclusive with setSize and setPixSize
(x1,y1) | Bottom left co-ordinate (in TMC units) of DO extent. |
(x2,y2) | Upper right co-ordinate (in TMC units) of DO extent. |
|
inline |
Set the pixel size of the TSLDisplayObject (DO) - mutually exclusive with extent and TMC size.
This size should be centred around (0,0). For example, for a 10x10 symbol, whose position is at the centre of the symbol, use (-5,-5),(5,5)
(x1,y1) | Bottom left co-ordinate (in pixels) of DO size. |
(x2,y2) | Upper right co-ordinate (in pixels) of DO size. |
|
inline |
Set the 'size' of the TSLDisplayObject (DO).
This is useful, if the actual extent of the DO is not known at the time of construction but its 'size' is. After the DO has been instantiated, its actual extent will be set based on its position (or its TSLDynamicData Object's position) & this size.
(x1,y1) | Bottom left co-ordinate (in TMC units) of DO size. |
(x2,y2) | Upper right co-ordinate (in TMC units) of DO size. |
void TSLDisplayObject::translate | ( | TSLCoord | pos | ) |
Move the TSLDisplayObject (DO) by the given (TSLCoord) offset. This method also recalculates the DO's extent.
pos | Coord containing TMC delta values to move existing position to the new position. |
void TSLDisplayObject::translate | ( | TSLTMC | x, |
TSLTMC | y ) |
Move the TSLDisplayObject (DO) by the given (x,y) offset. This method also recalculates the DO's extent.
(x,y) | The TMC delta values to move existing position to the new position. |
|
virtual |
This virtual method is used to destroy TSLDisplayObjects which are no longer required. By default, it calls delete for the TSLDisplayObject.
This allows derived classes to use custom memory-management for TSLDisplay Objects (such as pre-allocated memory pools). In these cases, this method would simply return the TSLDisplayObject to the memory pool.
You should provide an implementation of this method if you are not using the same Windows compiler that MapLink has been built with.
|
inline |
Query method for visibility of the TSLDisplayObject (DO).
Returns true if DO is visible, false otherwise.
void TSLDisplayObject::visible | ( | bool | visibility | ) |
Set the visibility of the TSLDisplayObject (DO).
visibility | If true, then DO is visible. |
|
protected |
Data Members for Associations
|
protected |
|
protected |
Deprecated method Deprecated method Deprecated method Deprecated method Data Members for Class Attributes The extent of the TSLDisplayObject.
|
protected |
The map position (TMC) of this TSLDisplayObject.
|
protected |
Selectability of TSLDisplayObject.
|
protected |
Visibility of TSLDisplayObject.