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

Detailed Description

Specialist user defined 3D 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 TSL3DUserGeometryEntity).

It is suggested that you write out a header that clearly identifies the object type uniquely within your application or company.

It is the developers responsibility to ensure thread safety.

Deprecated
Deprecated as of MapLink 11.1. Advised to use MapLink Earth SDK instead.

Public Member Functions

virtual ~TSL3DClientUserGeometryEntity ()
 
virtual double boundingSphereRadius () const
 
virtual const TSL3DCoordcentre () const =0
 
virtual bool draw (int uniqueSurfaceID, TSL3DRenderingInterface *renderingInterface)=0
 
virtual bool equals (const TSL3DEntity *other) const
 
virtual void releaseResources (int surfaceID)
 
virtual void scale (double scaleParam, const TSL3DCoord *origin=0)
 
virtual void scale (double scaleX, double scaleY, double scaleZ, const TSL3DCoord *origin=0)
 
virtual int save (TSLofstream &stream)
 
virtual void translate (double latitudeOffset, double longitudeOffset, double altitudeOffset)
 
virtual bool valid ()
 

Protected Member Functions

 TSL3DClientUserGeometryEntity ()
 

Constructor & Destructor Documentation

◆ ~TSL3DClientUserGeometryEntity()

virtual TSL3DClientUserGeometryEntity::~TSL3DClientUserGeometryEntity ( )
virtual

Default destructor for TSL3DClientUserGeometryEntity

◆ TSL3DClientUserGeometryEntity()

TSL3DClientUserGeometryEntity::TSL3DClientUserGeometryEntity ( )
protected

Default constructor for TSL3DClientUserGeometryEntity

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

Member Function Documentation

◆ boundingSphereRadius()

virtual double TSL3DClientUserGeometryEntity::boundingSphereRadius ( ) const
virtual

The developer needs to implement this method in their derived class if the functionality is required.

This method is used during drawing to perform bounding sphere culling of entities. The implementation should return the radius of the bounding sphere of the entity in meters.

The default implementation returns DBL_MAX.

◆ centre()

virtual const TSL3DCoord & TSL3DClientUserGeometryEntity::centre ( ) const
pure virtual

The developer needs to implement this method in their derived class.

This method should return the position around which the entity should be drawn.

◆ draw()

virtual bool TSL3DClientUserGeometryEntity::draw ( int uniqueSurfaceID,
TSL3DRenderingInterface * renderingInterface )
pure virtual

The developer needs to implement this method in their derived class.

This method is called to draw the entity.

The entity will be positioned such that 0,0,0 in model space is at the location returned by the centre() method, with the positive Z axis perpendicular to the surface of the earth at that point. The units of the coordinate system are meters.

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.

The OpenGL state on entry to this function is indeterminate. Care should be taken to ensure that any modifications made to the OpenGL state are reversed before returning from this function. Failure to do so may result in incorrect rendering of subsequent entities.

Parameters
uniqueSurfaceIDA unique surface number. Can be used for caching data as this will be unique to the calling surface.
renderingInterfaceRendering Interface. Allows the developer to draw using the MapLink 3D Rendering Engine.

Return true if an object is drawn, false otherwise.

◆ equals()

virtual bool TSL3DClientUserGeometryEntity::equals ( const TSL3DEntity * other) const
virtual

The developer needs to implement this method in their derived class if the functionality is required. The default implementation returns false.

This function should test to see if the entity is the same as the given entity.

Parameters
otherAnother entity to perform test against.

Return true if the entities are the same, false otherwise.

◆ releaseResources()

virtual void TSL3DClientUserGeometryEntity::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.

Parameters
surfaceIDA unique surface number.

◆ save()

virtual int TSL3DClientUserGeometryEntity::save ( TSLofstream & stream)
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.

Note: 1. The returned value is passed to any registered callback functions to identify the geometry object type saved. It is therefore suggested that you publish and track the use of these IDs in your application or SDK (OEM users) as the values must be unique.

2. The value returned will be passed to the load callback when the entity is being loaded.

Parameters
streamThe output file stream to store the User Geometry object data to.
Returns
a positive integer value that is unique to your application or company for this object type. Negative numbers are reserved for internal use only.

◆ scale() [1/2]

virtual void TSL3DClientUserGeometryEntity::scale ( double scaleParam,
const TSL3DCoord * origin = 0 )
virtual

The developer needs to implement this method in their derived class if the functionality is required. The default implementation does nothing.

This function should scale this entity equally in all directions.

Parameters
scaleParamScaling factor to apply. 0 is invalid.
originOrigin to scale about. If origin is NULL, the origin of the scale is the centroid of the TSL3DEntity.

◆ scale() [2/2]

virtual void TSL3DClientUserGeometryEntity::scale ( double scaleX,
double scaleY,
double scaleZ,
const TSL3DCoord * origin = 0 )
virtual

The developer needs to implement this method in their derived class if the functionality is required. The default implementation does nothing.

This function should scale this entity.

Parameters
scaleXScaling factor to apply in X dimension. 0 is invalid.
scaleYScaling factor to apply in Y dimension. 0 is invalid.
scaleZScaling factor to apply in Z dimension. 0 is invalid.
originOrigin to scale about. If origin is NULL, the origin of the scale is the centroid of the TSL3DEntity.

◆ translate()

virtual void TSL3DClientUserGeometryEntity::translate ( double latitudeOffset,
double longitudeOffset,
double altitudeOffset )
virtual

The developer needs to implement this method in their derived class if the functionality is required. The default implementation does nothing.

This function should translate this entity by the given deltas.

Parameters
latitudeOffsetOffset to apply in Latitude direction.
longitudeOffsetOffset to apply in Longitude direction.
altitudeOffsetOffset to apply in Altitude direction

◆ valid()

virtual bool TSL3DClientUserGeometryEntity::valid ( )
virtual

The developer needs to implement this method in their derived class if the functionality is required.

Return true if the entity is valid, false otherwise. The default implementation always returns true.