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

Detailed Description

This class represents a drawable model that a user has implemented.

The user will need to create a DLL which satisfies the following interface requirements:

The DLL shall contain a number of "C" code methods:

// Call to delete a model.

Parameters
//model An instance of TSL3DCustomModel void deleteModel(void *model);

// Call to obtain an instance of a model.

Parameters
//index the index as defined in tslmodels.dat
//pluginString A user-defined string from tslmodels.dat
//filename full path to the model.
//Returns // A pointer to an TSL3DCustomModel. void*getModel(int index, const char *filename, const char *pluginString );

Once instance of each model will exist per drawing surface. The interface must be thread safe. The Models must be stateless or thread safe.

The user will need to inherit from this class and implement a constructor and the abstract methods.

The base constructor must be called to set the base variables.

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

Public Member Functions

virtual bool draw (int drawingSurfaceId, double distanceToEye, int lodToDraw=0)=0
 
virtual const TSL3DBoundingBoxDUgetBoundingBox () const =0
 
virtual int getNumberOfLODs () const =0
 
virtual void scale (float scaleX, float scaleY, float scaleZ)=0
 
virtual double sphereRadius () const =0
 

Protected Attributes

char * m_pluginString
 
char * m_filename
 
int m_index
 
virtual ~TSL3DCustomModel ()
 
const char *const getPluginString () const
 
const char *const getFilename () const
 
int getIndex () const
 
 TSL3DCustomModel (int index, const char *modelFilename, const char *pluginString)
 

Constructor & Destructor Documentation

◆ ~TSL3DCustomModel()

TSL3DCustomModel::~TSL3DCustomModel ( )
inlinevirtual

◆ TSL3DCustomModel()

TSL3DCustomModel::TSL3DCustomModel ( int index,
const char * modelFilename,
const char * pluginString )
inlineprotected

Constructor.

Parameters
indexindex in tslmodels.dat
modelFilenameThe filename and directory containing the model.
modelDescriptionA plugin-specific configuration string read from tslmodels.dat

Member Function Documentation

◆ draw()

virtual bool TSL3DCustomModel::draw ( int drawingSurfaceId,
double distanceToEye,
int lodToDraw = 0 )
pure virtual

This method is called when the model is to be drawn.

It is assumed in the first release that the drawing state (OpenGL) state is returned to the state it was in on entry to the draw method.

In a future release a GraphicsState object will be implemented to enable the user to set the state as required.

Parameters
drawingSurfaceIdthe ID of the drawing surface
distanceToEyedistance in meters from the eye to the model position.
lodToDrawthe Level of Detail to draw (draw the nearest to the index passed).
NotesThe translate and rotation is already setup before the call to draw.

There will only be one instance of a model per index.

Each instance needs to either be stateless or thread safe.

◆ getBoundingBox()

virtual const TSL3DBoundingBoxDU & TSL3DCustomModel::getBoundingBox ( ) const
pure virtual

Returns the axis aligned bounding box.

◆ getFilename()

const char *const TSL3DCustomModel::getFilename ( ) const
inline

Query the filename and directory of the model.

◆ getIndex()

int TSL3DCustomModel::getIndex ( ) const
inline

Returns the tslmodels.dat index of the model.

◆ getNumberOfLODs()

virtual int TSL3DCustomModel::getNumberOfLODs ( ) const
pure virtual

Return the number of Level of Details the model supports.

◆ getPluginString()

const char *const TSL3DCustomModel::getPluginString ( ) const
inline

Query the plugin-specific configuration string

◆ scale()

virtual void TSL3DCustomModel::scale ( float scaleX,
float scaleY,
float scaleZ )
pure virtual

Allows the scale to be over-ridden by the scale set on TSL3DModel.

A value larger than 1 increases the size of the object. A scale less than 1 decreases the size of the object.

Parameters
scaleXScale for X axis.
scaleYScale for X axis.
scaleZScale for X axis.

◆ sphereRadius()

virtual double TSL3DCustomModel::sphereRadius ( ) const
pure virtual

Returns the radius of the boundary sphere of the model in meters.

Member Data Documentation

◆ m_filename

char* TSL3DCustomModel::m_filename
protected

Filename and directory containing the model

◆ m_index

int TSL3DCustomModel::m_index
protected

Index of the model in the tslmodels.dat file.

◆ m_pluginString

char* TSL3DCustomModel::m_pluginString
protected

Plugin-specific parameter string