Gazebo Rendering

API Reference

7.4.2

Abstract base class providing mechanisms for dynamically growing hardware buffers. More...

#include <OgreDynamicRenderable.hh>

Public Member Functions

 OgreDynamicRenderable ()
 Constructor. More...
 
virtual ~OgreDynamicRenderable ()
 Virtual destructor. More...
 
virtual Ogre::Real getBoundingRadius () const
 Implementation of Ogre::SimpleRenderable. More...
 
virtual Ogre::Real getSquaredViewDepth (const Ogre::Camera *_cam) const
 Implementation of Ogre::SimpleRenderable. More...
 
void Init (MarkerType _opType, bool _useIndices=false)
 Initializes the dynamic renderable. More...
 
MarkerType OperationType () const
 Get the render operation type. More...
 
void SetOperationType (MarkerType _opType)
 Set the render operation type. More...
 

Protected Member Functions

virtual void CreateVertexDeclaration ()=0
 Creates the vertex declaration. More...
 
virtual void FillHardwareBuffers ()=0
 Fills the hardware vertex and index buffers with data. More...
 
void PrepareHardwareBuffers (size_t _vertexCount, size_t _indexCount)
 Prepares the hardware buffers for the requested vertex and index counts. More...
 

Protected Attributes

size_t indexBufferCapacity = 0
 Maximum capacity of the currently allocated index buffer. More...
 
size_t vertexBufferCapacity = 0
 Maximum capacity of the currently allocated vertex buffer. More...
 

Detailed Description

Abstract base class providing mechanisms for dynamically growing hardware buffers.

Constructor & Destructor Documentation

◆ OgreDynamicRenderable()

Constructor.

◆ ~OgreDynamicRenderable()

virtual ~OgreDynamicRenderable ( )
virtual

Virtual destructor.

Member Function Documentation

◆ CreateVertexDeclaration()

virtual void CreateVertexDeclaration ( )
protectedpure virtual

Creates the vertex declaration.

Remarks
Override and set mRenderOp.vertexData->vertexDeclaration here. mRenderOp.vertexData will be created for you before this method is called.

◆ FillHardwareBuffers()

virtual void FillHardwareBuffers ( )
protectedpure virtual

Fills the hardware vertex and index buffers with data.

Remarks
This function must call prepareHardwareBuffers() before locking the buffers to ensure the they are large enough for the data to be written. Afterwards the vertex and index buffers (if using indices) can be locked, and data can be written to them.

◆ getBoundingRadius()

virtual Ogre::Real getBoundingRadius ( ) const
virtual

Implementation of Ogre::SimpleRenderable.

Returns
The bounding radius

◆ getSquaredViewDepth()

virtual Ogre::Real getSquaredViewDepth ( const Ogre::Camera *  _cam) const
virtual

Implementation of Ogre::SimpleRenderable.

Parameters
[in]_camPointer to the Ogre camera that views the renderable.
Returns
The squared depth in the Camera's view

◆ Init()

void Init ( MarkerType  _opType,
bool  _useIndices = false 
)

Initializes the dynamic renderable.

Remarks
This function should only be called once. It initializes the render operation, and calls the abstract function CreateVertexDeclaration().
Parameters
[in]_opTypeThe type of render operation to perform.
[in]_useIndicesSpecifies whether to use indices to determine the vertices to use as input.

◆ OperationType()

MarkerType OperationType ( ) const

Get the render operation type.

Returns
The render operation type.

◆ PrepareHardwareBuffers()

void PrepareHardwareBuffers ( size_t  _vertexCount,
size_t  _indexCount 
)
protected

Prepares the hardware buffers for the requested vertex and index counts.

Remarks
This function must be called before locking the buffers in fillHardwareBuffers(). It guarantees that the hardware buffers are large enough to hold at least the requested number of vertices and indices (if using indices). The buffers are possibly reallocated to achieve this.
The vertex and index count in the render operation are set to
the values of vertexCount and indexCount respectively.
Parameters
[in]_vertexCountThe number of vertices the buffer must hold.
[in]_indexCountThe number of indices the buffer must hold. This parameter is ignored if not using indices.

◆ SetOperationType()

void SetOperationType ( MarkerType  _opType)

Set the render operation type.

Parameters
[in]_opTypeThe type of render operation to perform.

Member Data Documentation

◆ indexBufferCapacity

size_t indexBufferCapacity = 0
protected

Maximum capacity of the currently allocated index buffer.

◆ vertexBufferCapacity

size_t vertexBufferCapacity = 0
protected

Maximum capacity of the currently allocated vertex buffer.


The documentation for this class was generated from the following file: