![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
Specialist user defined geometry entity.
The developer should derive a new class from this class and implement the draw method as a minimum.
The save method should be implemented if you wish to persist your object when save is called on a layer. You will need to provide callbacks for loading (see TSLUserGeometryEntity).
It is suggested that you write out a header that clearly identifies the object type uniquely within your application or company.
It is the developer's responsibility to ensure thread safety.
Public Member Functions | |
virtual | ~TSLClientUserGeometryEntity () |
virtual bool | contains (const TSLEntity *anotherEntity) const |
virtual bool | crosses (const TSLEntity *anotherEntity) const |
virtual TSLEntitySet * | difference (const TSLEntity *other) const |
virtual bool | draw (int uniqueSurfaceID, TSLRenderingInterface *renderingInterface, const TSLEnvelope &extent, TSLRenderLevel renderLevel, double screenResolution)=0 |
virtual TSLEnvelope | envelope (int uniqueSurfaceID) |
virtual bool | equals (const TSLEntity *anotherEntity) const |
virtual unsigned int | inMemorySize () |
virtual TSLEntitySet * | intersection (const TSLEntity *anotherEntity) const |
virtual bool | intersects (const TSLEntity *anotherEntity) const |
virtual bool | overlaps (const TSLEntity *anotherEntity) const |
virtual void | releaseResources (int surfaceID) |
virtual bool | rotate (double angle, const TSLCoord *origin=NULL) |
virtual int | save (TSLofstream &stream) |
virtual bool | scale (double scaleOnX, double scaleOnY, const TSLCoord *origin=NULL) |
virtual double | squareDistance (const TSLCoord &point, const TSLEnvelope *aperture=NULL, bool useRenderedExtent=true, int drawingSurfaceID=-1) const |
virtual double | squareDistance (const TSLEntity *otherEntity) const |
virtual bool | touches (const TSLEntity *anotherEntity) const |
virtual bool | translate (TSLTMC xoffset, TSLTMC yoffset) |
virtual TSLEntitySet * | unionWith (const TSLEntity *anotherEntity) const |
virtual bool | valid () |
virtual TSLCoord | adjustedWeightedCentroid () |
reserved for future use | |
virtual TSLCoord | centreOfGravity () |
reserved for future use | |
Protected Member Functions | |
TSLClientUserGeometryEntity () | |
|
virtual |
Default destructor for ~TSLClientUserGeometryEntity
|
protected |
Default constructor for TSLClientUserGeometryEntity
Declared protected to prevent non-derived classes from accessing this class.
|
virtual |
reserved for future use
|
virtual |
reserved for future use
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
Tests if this entity 'spatially contains' another entity.
The base implementation returns false.
anotherEntity | Another entity to perform test against. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
Tests if this entity 'spatially crosses' another entity.
The base implementation returns false.
anotherEntity | Another entity to perform test against. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
Creates the spatial difference between the two entities.
The base implementation returns NULL.
other | Another entity to perform test against. |
|
pure virtual |
The developer needs to implement this method in their derived class.
This method is called to draw the entity.
The user is responsible for setting up the rendering and drawing of the object. MapLink will not set up any rendering or apply any feature rendering to this object.
uniqueSurfaceID | A unique surface number. Can be used for caching data as this will be unique to the calling surface. |
renderingInterface | Rendering Interface. Allows the developer to draw using the MapLink Rendering Engine. |
extent | Display drawing extent only. |
renderLevel | The render level that the draw is being called for. The values passed are TSLRenderLevelMinusFive..TSLRenderLevelPlusFive. Most drawing occurs at TSLRenderLevelZero only. |
screenResolution | The screen resolution (TMCs per Device Unit) |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
It is advised that this method is implemented as the returned envelope is used to decide if to call the drawing method. The default implementation returns a full TMC extent.
Query the minimum bounding box of the entity.
uniqueSurfaceID | an id for a drawing surface. This is unique to a surface. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
Test for spatial equality with another entity.
The base implementation returns false.
anotherEntity | Another entity to perform test against. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
The base implementation returns the memory size for this class only.
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
Creates a spatial intersection between the two entities.
The base implementation returns NULL.
anotherEntity | Another entity to perform test against. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
Test for spatial intersection between the two entities.
The base implementation returns false.
anotherEntity | Another entity to perform test against. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
Tests if this entity 'spatially overlaps' another entity.
The base implementation returns false.
anotherEntity | Another entity to perform test against. |
|
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. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
The base implementation returns false.
Rotates the entity.
Rotates the TSLEntity anti-clockwise by angle, about specified origin. Uses centroid as the reference of the rotation if origin is NULL.
Angle is given in radians.
For entities that have an internal rotation, such as text or symbols, this adds to the rotation angle, and possibly changes the position of the entity.
For entities that contain a CoordSet, the coordinates are changed.
angle | Angle to rotate by, in radians, anti-clockwise +ve. |
origin | Point to rotate about. NULL origin uses centroid. |
|
virtual |
This function is called to save the User Geometry object.
The save method should be implemented if you wish to persist your object when save is called on a layer.
It is suggested that you write out a header that clearly identifies the object type uniquely within your application or company. The value returned from this method is used when re-creating the object.
Notes:
stream | The output file stream to store the User Geometry object data to. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
Scales this entity, equally in both directions.
The base implementation returns false.
scaleOnX,scaleOnY | Scaling factors to apply in the X and Y axes. 0 is invalid. |
origin | Origin to scale about. If origin is NULL, the origin of the scale is the centroid of the TSLEntity. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
This method calculates the shortest square distance between an entity and a point.
Depending upon the reason for this method being invoked, an aperture parameter maybe provided to reduce the calculations required, so that anything that falls outside the aperture envelope can be disregarded. If the entity does fall completely outside the aperture, DBL_MAX should be returned.
As entities may have a different extent when rendered, for instance due to scale based rendering attributes, a flag is provided to describe whether the rendered extent should be used to make this calculation. The drawing surface id of the drawing surface upon which the entity's rendered extent is take from is also provided.
The base implementation returns -1.
point | The point to which the square distance should be calculated. |
aperture | The aperture around the point, usually an equal distance in all directions, that may optionally be provided to reduce calculations. |
useRenderedExtent | Flag to indicate whether the rendered extent of the entity should be used. |
drawingSurfaceID | The ID the drawing surface that drew the entity. This is only relevant when the useRenderedExtent is set to true. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
This method calculates the shortest square distance between entities.
The otherEntity may be a group or series of groups. In this case the square distance returned is to the closest non-group entity.
The base implementation returns -1.
otherEntity | entity to query the shortest distance too. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
The base implementation returns false.
Tests if this entity 'spatially touches' another entity.
anotherEntity | Another entity to perform test against. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
The base implementation returns false.
Translates this entity by delta.
xoffset | delta applied to X coordinates. |
yoffset | delta applied to Y coordinates. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
The base implementation returns NULL.
Creates a spatial union between the two entities.
anotherEntity | Another entity to perform test against. |
|
virtual |
The developer needs to implement this method in their derived class if the functionality is required.
The base implementation returns true.