MIRA
|
#include <visualization/3d/DynamicPoints.h>
Classes | |
struct | PointData |
Public Types | |
enum | Flags { NONE = 0, INDEX_BUFFER_32BIT = 1 } |
Flags that can be specified in prepareHardwareBuffers(). More... | |
Public Member Functions | |
DynamicPoints (OperationType opType=Ogre::RenderOperation::OT_POINT_LIST) | |
Constructor - see setOperationType() for description of argument. More... | |
virtual | ~DynamicPoints () |
void | addPoint (const Ogre::Vector3 &p, const Ogre::ColourValue &c) |
Add a point to the point list. More... | |
void | addPoint (Real x, Real y, Real z, const Ogre::ColourValue &c) |
Add a point to the point list. More... | |
void | setPoint (unsigned short index, const Vector3 &value) |
Change the location of an existing point in the point list. More... | |
const Vector3 & | getPoint (unsigned short index) const |
Return the location of an existing point in the point list. More... | |
void | setColor (const Ogre::ColourValue &c) |
Change the colour of existing points. More... | |
unsigned short | getNumPoints (void) const |
Return the total number of points in the point list. More... | |
void | clear () |
Remove all points from the point list. More... | |
void | update () |
Call this to update the hardware buffer after making changes. More... | |
void | setOperationType (OperationType opType) |
Set the type of operation to draw with. More... | |
OperationType | getOperationType () const |
void | initialize (Ogre::RenderOperation::OperationType operationType, const Ogre::VertexDeclaration &vertexDecl, bool useIndices) |
Initializes the dynamic renderable. More... | |
void | enableIndexBuffer (bool enable=true) |
Allows to enable/disable the index buffer, after initialize() was already called. More... | |
MIRA_ENUM_TO_FLAGS_INCLASS (Flags) | |
void | prepareBuffers (size_t vertexCount, size_t indexCount=0, Flags flags=NONE, Ogre::HardwareBuffer::Usage usage=Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY) |
Prepares the hardware buffers for the requested vertex and index counts. More... | |
void | updateVertexCount (size_t vertexCount) |
Update the count of vertices actually filled into the buffer. More... | |
Ogre::HardwareVertexBufferSharedPtr | getVertexBuffer (unsigned short index=0) |
Gets the vertex buffer bound to the given source index. More... | |
Ogre::HardwareIndexBufferSharedPtr | getIndexBuffer () |
Gets the index buffer of this renderable (or NULL, if no index buffer was created) More... | |
virtual Ogre::Real | getBoundingRadius (void) const |
Implementation of Ogre::SimpleRenderable. More... | |
virtual Ogre::Real | getSquaredViewDepth (const Ogre::Camera *cam) const |
Implementation of Ogre::SimpleRenderable. More... | |
virtual void | _updateRenderQueue (Ogre::RenderQueue *queue) |
Protected Attributes | |
size_t | mVertexBufferCapacity |
Maximum capacity of the currently allocated vertex buffer. More... | |
size_t | mIndexBufferCapacity |
Maximum capacity of the currently allocated index buffer. More... | |
|
inherited |
DynamicPoints | ( | OperationType | opType = Ogre::RenderOperation::OT_POINT_LIST | ) |
Constructor - see setOperationType() for description of argument.
|
virtual |
void addPoint | ( | const Ogre::Vector3 & | p, |
const Ogre::ColourValue & | c | ||
) |
Add a point to the point list.
void addPoint | ( | Real | x, |
Real | y, | ||
Real | z, | ||
const Ogre::ColourValue & | c | ||
) |
Add a point to the point list.
void setPoint | ( | unsigned short | index, |
const Vector3 & | value | ||
) |
Change the location of an existing point in the point list.
const Vector3& getPoint | ( | unsigned short | index | ) | const |
Return the location of an existing point in the point list.
void setColor | ( | const Ogre::ColourValue & | c | ) |
Change the colour of existing points.
unsigned short getNumPoints | ( | void | ) | const |
Return the total number of points in the point list.
void clear | ( | ) |
Remove all points from the point list.
void update | ( | ) |
Call this to update the hardware buffer after making changes.
void setOperationType | ( | OperationType | opType | ) |
Set the type of operation to draw with.
opType | Can be one of
|
OperationType getOperationType | ( | ) | const |
|
inherited |
Initializes the dynamic renderable.
This function should only be only called once! It initializes all necessary structures and specifies the operation type (triangle list, fan, etc), the vertex declaration (vertex,normals,texturecoords) and specifies, whether to use an index buffer or not.
operationType | The type of render operation to perform. |
vertexDecl | The vertex declaration describing the content of the vertex buffer |
useIndices | Specifies whether to use an index buffer or not |
|
inherited |
Allows to enable/disable the index buffer, after initialize() was already called.
Note, that you can enable the index buffer only, is the parameter useIndices in the call to initialize() was set true. Otherwise, this method will throw an exception here.
|
inherited |
|
inherited |
Prepares the hardware buffers for the requested vertex and index counts.
This function must be called at least once before locking the buffers to fill in data. 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. This method can be called more than once to increase the size of the buffers, if necessary.
vertexCount | The number of vertices the buffer must hold. |
indexCount | The number of indices the buffer must hold. This parameter is ignored if not using indices. |
|
inherited |
Update the count of vertices actually filled into the buffer.
You should use this if the number of vertices that were eventually filled into the buffer is smaller than the initial count used with prepareBuffers, in order to avoid rendering uninitialized data. Make sure it is not greater than the vertexCount used in the call to prepareBuffers!
|
inherited |
Gets the vertex buffer bound to the given source index.
|
inherited |
Gets the index buffer of this renderable (or NULL, if no index buffer was created)
|
virtualinherited |
Implementation of Ogre::SimpleRenderable.
|
virtualinherited |
Implementation of Ogre::SimpleRenderable.
|
inlinevirtualinherited |
|
protectedinherited |
Maximum capacity of the currently allocated vertex buffer.
|
protectedinherited |
Maximum capacity of the currently allocated index buffer.