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

Detailed Description

Specialist entity for the handling of user-defined geometry objects.

The User Geometry Entity allows the developer to create an object that can be stored inside a TMF file and drawn as part of the drawing of a Standard Data-Layer.

The developer should at minimum derive from TSLClientUserGeometryEntity in the application and implement the pure virtual draw method. Additional methods on TSLClientUserGeometryEntity may be overridden as necessary.

Only the methods defined on TSLClientUserGeometryEntity are supported for a user defined Entity at present. This means that setting of attributes, etc. is not supported.

This extension is purely for rendering of objects defined by the user.

It is the developer's responsibility to ensure thread safety.

Note: If you are not using the version of Visual Studio that MapLink was built with then you need to manage the deletion of the TSLClientUserGeometryEntity derived object yourself.

Public Member Functions

TSLClientUserGeometryEntitygetClientUserGeometryEntity ()
const TSLClientUserGeometryEntitygetClientUserGeometryEntity () const
void setClientUserGeometryEntity (TSLClientUserGeometryEntity *client, bool ownsClient=false)
bool valid () const
Public Member Functions inherited from TSLEntity
TSLCoord centroid () const
TSLEntityclone () const
bool contains (const TSLEntity *other) const
bool crosses (const TSLEntity *other) const
void alwaysMergeDifferences (bool _alwaysMergeDifferences)
TSLEntitydifference (const TSLEntity *other) const
double distance (const TSLCoord &point, bool useRenderedExtent=true, int drawingSurfaceID=-1) const
TSLEnvelope envelope (int surfaceID=-1) const
bool equals (const TSLEntity *other) const
TSLEntityintersection (const TSLEntity *other) const
bool intersects (const TSLEntity *other) const
bool intersects (const TSLEnvelope *envelope) const
bool move (const TSLCoord &location, const TSLCoord &reference)
bool overlaps (const TSLEntity *other) const
TSLEntitySetparent ()
const TSLEntitySetparent () const
void renderLevel (int level)
int renderLevel () const
bool rotate (double angle, const TSLCoord *origin=NULL)
double rotation () const
bool rotation (double newValue)
bool scale (double scaleParam, TSLCoord *origin=0)
bool scaleXY (double scaleX, double scaleY, TSLCoord *origin=0)
double squareDistance (const TSLCoord &point, bool useRenderedExtent=true, int drawingSurfaceID=-1) const
double squareDistance (const TSLEntity *otherEntity) const
bool touches (const TSLEntity *other) const
bool translate (TSLTMC xoffset, TSLTMC yoffset)
TSLEntityunionWith (const TSLEntity *other) const
bool within (const TSLEntity *other) const
TSLCoord adjustedWeightedCentroid ()
 reserved for future use
TSLCoord centreOfGravity ()
 reserved for future use
Public Member Functions inherited from TSLEntityBase
bool addDataSet ()
bool addDataSet (TSLDataHandler *toUseDataHandler)
bool clearRenderingAttributes ()
TSLDataSetdataSet ()
const TSLDataSetdataSet () const
short dataSourceID () const
void dataSourceID (short dataSourceID)
bool deleteDataSet ()
void destroy ()
TSLEntityID entityID () const
void entityID (TSLEntityID value)
TSLFeatureID featureID () const
void featureID (TSLFeatureID newValue)
bool getRendering (TSLRenderingAttributeInt attribute, int *result) const
bool getRendering (TSLRenderingAttributeDouble attribute, double *result) const
bool getRendering (TSLRenderingAttributeBool attribute, bool *result) const
bool getRendering (TSLRenderingAttributes &result) const
TSL3DEntityis3DEntity ()
const TSL3DEntityis3DEntity () const
TSLEntityisEntity ()
const TSLEntityisEntity () const
bool isOptimisedEntity () const
void name (const char *newValue)
const char * name () const
void releaseResources (int surfaceID)
bool setRendering (TSLRenderingAttributeInt attribute, int value)
bool setRendering (TSLRenderingAttributeDouble attribute, double value)
bool setRendering (TSLRenderingAttributeBool attribute, bool value)
bool setRendering (const TSLRenderingAttributes &attributes)
void sourceID (int value)
int sourceID () const
TSLGeometryType type () const
void version (TSLVersion value)
TSLVersion version () const

Static Public Member Functions

static TSLUserGeometryEntitycreate (TSLClientUserGeometryEntity *client, bool takeOwnership=true)
static const TSLUserGeometryEntityisUserGeometry (const TSLEntity *entity)
static TSLUserGeometryEntityisUserGeometry (TSLEntity *entity)
static bool registerUserGeometryClientLoadCallback (TSLUserGeometryLoadCallback callback)
Static Public Member Functions inherited from TSLEntity
static TSLEntitycreateFromWKB (const unsigned char *wkb, unsigned int wkbLength, double TMCPerMU, double mapOffsetX=0.0, double mapOffsetY=0.0, bool multiAsEntitySet=false, double maxCurveAngle=0.0)
static TSLEntitycreateFromWKT (const char *wkt, double TMCPerMU, double mapOffsetX=0.0, double mapOffsetY=0.0, bool multiAsEntitySet=false, double maxCurveAngle=0.0)

Protected Member Functions

 TSLUserGeometryEntity ()
 ~TSLUserGeometryEntity ()
 TSLUserGeometryEntity (const TSLUserGeometryEntity &)
TSLUserGeometryEntityoperator= (const TSLUserGeometryEntity &userGeom)
Protected Member Functions inherited from TSLEntity
 ~TSLEntity ()
Protected Member Functions inherited from TSLEntityBase
 ~TSLEntityBase ()

Constructor & Destructor Documentation

◆ TSLUserGeometryEntity() [1/2]

TSLUserGeometryEntity::TSLUserGeometryEntity ( )
protected

Protected destructor to inhibit user construction

◆ ~TSLUserGeometryEntity()

TSLUserGeometryEntity::~TSLUserGeometryEntity ( )
protected

◆ TSLUserGeometryEntity() [2/2]

TSLUserGeometryEntity::TSLUserGeometryEntity ( const TSLUserGeometryEntity & )
protected

Member Function Documentation

◆ create()

TSLUserGeometryEntity * TSLUserGeometryEntity::create ( TSLClientUserGeometryEntity * client,
bool takeOwnership = true )
static

Creates a user geometry object with the specified parameters.

This call should only be used for temporary entities. For example, this call may be used to create entities that are used in the spatial tests.

Parameters
clientAn instance of TSLClientUserGeometryEntity
takeOwnershipif true this instance takes ownership of the client.
Returns
an instance of TSLUserGeometryEntity. NULL is returned if an error occurred and the client will not be owned.

◆ getClientUserGeometryEntity() [1/2]

TSLClientUserGeometryEntity * TSLUserGeometryEntity::getClientUserGeometryEntity ( )

Returns the client user geometry entity instance attached to this TSLUserGeometryEntity.

◆ getClientUserGeometryEntity() [2/2]

const TSLClientUserGeometryEntity * TSLUserGeometryEntity::getClientUserGeometryEntity ( ) const

Returns the client user geometry entity instance attached to this TSLUserGeometryEntity.

◆ isUserGeometry() [1/2]

const TSLUserGeometryEntity * TSLUserGeometryEntity::isUserGeometry ( const TSLEntity * entity)
static

Query whether the entity is an TSLUserGeometryEntity

If this entity is an TSLUserGeometryEntity returns an accessor, otherwise returns NULL.

When querying Optimised maps this query may return NULL.

Parameters
entitythe entity to query

◆ isUserGeometry() [2/2]

TSLUserGeometryEntity * TSLUserGeometryEntity::isUserGeometry ( TSLEntity * entity)
static

Query whether the entity is an TSLUserGeometryEntity.

If this entity is an TSLUserGeometryEntity, returns an accessor, otherwise returns NULL.

When querying Optimised maps this query may return NULL.

Parameters
entitythe entity to query

◆ operator=()

TSLUserGeometryEntity & TSLUserGeometryEntity::operator= ( const TSLUserGeometryEntity & userGeom)
protected

Assignment operator.

Sets the user geometry to be equal to that specified.

Parameters
userGeomSource for new user geometry.
Returns
reference to updated value.

◆ registerUserGeometryClientLoadCallback()

bool TSLUserGeometryEntity::registerUserGeometryClientLoadCallback ( TSLUserGeometryLoadCallback callback)
static

This function stores a pointer to the callback function to the User defined Load function that reads, creates and returns the User Geometry object.

You can register more than one callback. Once registered you can not remove a callback.

Parameters
callbackfunction to call to load user geometry object.

◆ setClientUserGeometryEntity()

void TSLUserGeometryEntity::setClientUserGeometryEntity ( TSLClientUserGeometryEntity * client,
bool ownsClient = false )

Attaches an instance of TSLClientUserGeometryEntity to the TSLUserGeometryEntity.

This should be used to attach a handle to the developer's TSLClientUserGeometryEntity derived class.

If this instance already has a client attached the client is deleted if it is owned otherwise the client is replaced.

Parameters
clientA pointer to a TSLClientUserGeometryEntity derived class.
ownsClientIndicates if the TSLUserGeometryEntity owns the client. If true the attached TSLClientUserGeometryEntity will be deleted when the TSLUserGeometryEntity is destroyed. The default value is false.

◆ valid()

bool TSLUserGeometryEntity::valid ( ) const

Queries the validity of the User Geometry (calls through to the Client valid method).

Returns true if it has, false otherwise.