![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This class provides the interface between the OpenGL Accelerated drawing surface and the TSLAcceleratedRenderer.
The class is abstract to allow the user control on how the map tiles are generated (sequentially, separate thread or process [limitations apply]).
The user may also define their own behaviour by inheriting from this class.
When a tile needs to be rendered the method 'renderTile()' will be called.
The derived 'renderTile()' method will need to call the following methods:
renderer->renderTile(tile); // Draws the tile. renderer->tileRendered(); // Notifies the Accelerated Surface // tile has been rendered. callTileRenderedCallback(); // Call the user's callbacks. callRedrawCallback(numberOfTilesLeftToDraw);
When 'renderTile()' is called ownership of the tile passes to this class (or derived class). It is then the responsibility of this class to return ownership once the tile has been drawn by calling 'tileRendered()'.
Before any tiles are rendered via the TSLAcceleratedRenderer the initialise method must be called. This is particularly important on X11 where we need to open a second connection to the X-Server if we are using a thread method. The derived class TSLAcceleratedMTRenderControl takes this approach internally.
A separate process model can only be implemented if process memory can be shared. This is the model adopted on VxWorks (via pthread library).
On Linux it is possible using the clone method. However this may not be fully supported because MapLink uses pthread's internally (there are use group messages that say this approach is not supported).
On X11 we only support 16 True Colour Visuals. The display connection must be to a local X-Server as must the OpenGL display connection as shared pixmaps are used for creating the Texture Tiles.
Public Member Functions | |
virtual | ~TSLAcceleratedRenderControl () |
virtual void | cancelTiles () |
TSLAcceleratedRenderer * | getRenderer () |
virtual bool | isThreaded () const =0 |
virtual void | renderTile (TSLTextureTile *tile, TSLAcceleratedRenderer *renderer)=0 |
virtual void | returnObject (void *object, TSLAcceleratedRenderer *renderer)=0 |
Protected Member Functions | |
TSLAcceleratedRenderControl (TSLAcceleratedRedrawCallback redrawCallback=NULL, void *redrawArg=NULL, TSLTextureTileRenderedCallback tileRenderedCallback=NULL, void *tileRenderedArg=NULL) | |
void | callTileRenderedCallback (int numberLeft=0) |
void | callRedrawCallback () |
|
virtual |
Destructor.
NOTE: A user derived class must only return once a thread has exited.
On the thread being deleted all outstanding tiles should be returned by calling tileRendered. If they are not then the tiles will probably be leaked.
|
protected |
Constructor for TSLAcceleratedRenderControl.
This class can not be created by the user.
Two classes have been implemented:
TSLAcceleratedBlockingRenderControl TSLAcceleratedMTRenderControl
The user may also derive from this class to implement their own tile rendering behaviour.
redrawCallback | User supplied callback which will be called once all the pending tiles have been rendered. |
redrawArg | User supplied argument to pass to the callback. |
tileRenderedCallback | User supplied callback which will be called after each tile has been rendered. A count of the number of tiles pending is also passed to the user method. |
tileRenderedArg | User supplied argument to pass to the callback. |
See | Also TSLTextureTileRenderedCallback TSLAcceleratedRedrawTile. |
|
protected |
Calls the user supplied redraw callback if it is valid.
|
protected |
Calls the user supplied tile rendered callback if it is valid.
numberLeft | the number of tiles left to render. |
|
virtual |
Cancel any pending rendering of tiles.
This method should be overridden in a derived class to supply the expected behaviour.
This method should not be called by any user code.
TSLAcceleratedRenderer * TSLAcceleratedRenderControl::getRenderer | ( | ) |
Returns a pointer to a specialised TSLAcceleratedRenderer.
If NULL is returned then the renderer has not yet been added.
Once the renderer is available a copy of the pointer can be retained for future reference.
|
pure virtual |
This method returns true if the Render Control is multi-threaded.
Implemented in TSLAcceleratedBlockingRenderControl, and TSLAcceleratedMTRenderControl.
|
pure virtual |
This method is called by the Accelerated Surface to render a tile.
This method should not be called by any user code.
Implemented in TSLAcceleratedBlockingRenderControl, and TSLAcceleratedMTRenderControl.
|
pure virtual |
This method is called by the Accelerated Surface to return an object to the Render Control cache.
This method should not be called by any user code.
Implemented in TSLAcceleratedBlockingRenderControl, and TSLAcceleratedMTRenderControl.