RAMSES Documentation  27.0.130
Information for RAMSES users and developers
Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
ramses::ArrayBuffer Class Reference

The ArrayBuffer is a data object used to provide vertex or index data to ramses::GeometryBinding::setInputBuffer and ramses::GeometryBinding::setIndices. The buffer data of an ArrayBuffer is not filled initially and can be fully or partially updated in between scene flushes. More...

#include <ArrayBuffer.h>

Inheritance diagram for ramses::ArrayBuffer:
[legend]
Collaboration diagram for ramses::ArrayBuffer:
[legend]

Public Member Functions

status_t updateData (uint32_t firstElement, uint32_t numElements, const void *bufferData)
 Update data of the ArrayBuffer object. More...
 
uint32_t getMaximumNumberOfElements () const
 Returns the maximum number of data elements that can be stored in the data buffer. More...
 
uint32_t getUsedNumberOfElements () const
 Returns the used number of data elements. More...
 
EDataType getDataType () const
 Returns the data type associated with the buffer data. More...
 
status_t getData (void *buffer, uint32_t numElements) const
 Copies the data of the data buffer into a user-provided buffer. The buffer must be sufficiently large to hold the data for the whole data buffer. More...
 
- Public Member Functions inherited from ramses::SceneObject
sceneObjectId_t getSceneObjectId () const
 Returns scene object id which is automatically assigned at creation time of object and is unique within scope of one scene. More...
 
sceneId_t getSceneId () const
 Returns sceneid to which this object belongs to. More...
 
- Public Member Functions inherited from ramses::RamsesObject
const char * getName () const
 Returns the name of the object. More...
 
status_t setName (const char *name)
 Changes the name of the object. More...
 
ERamsesObjectType getType () const
 Gets type of the object. More...
 
bool isOfType (ERamsesObjectType type) const
 Checks if the object is of given type. More...
 
- Public Member Functions inherited from ramses::StatusObject
status_t validate () const
 Generates verbose validation of the object. More...
 
const char * getValidationReport (EValidationSeverity minSeverity=EValidationSeverity_Info) const
 Provides verbose report in human readable form generated by validate. More...
 
const char * getStatusMessage (status_t status) const
 Get the string description for a status provided by a RAMSES API function. More...
 
 StatusObject (const StatusObject &other)=delete
 Deleted copy constructor. More...
 
StatusObjectoperator= (const StatusObject &other)=delete
 Deleted copy assignment. More...
 

Public Attributes

class ArrayBufferImpl & impl
 
- Public Attributes inherited from ramses::SceneObject
class SceneObjectImpl & impl
 
- Public Attributes inherited from ramses::ClientObject
class ClientObjectImpl & impl
 
- Public Attributes inherited from ramses::RamsesObject
class RamsesObjectImpl & impl
 
- Public Attributes inherited from ramses::StatusObject
class StatusObjectImpl & impl
 

Protected Member Functions

 ArrayBuffer (ArrayBufferImpl &pimpl)
 Constructor for ArrayBuffer. More...
 
virtual ~ArrayBuffer ()
 Destructor of the ArrayBuffer. More...
 
- Protected Member Functions inherited from ramses::SceneObject
 SceneObject (SceneObjectImpl &pimpl)
 Constructor for SceneObject. More...
 
virtual ~SceneObject ()
 Destructor of the SceneObject. More...
 
- Protected Member Functions inherited from ramses::ClientObject
 ClientObject (ClientObjectImpl &pimpl)
 Constructor for ClientObject. More...
 
virtual ~ClientObject ()
 Destructor of the ClientObject. More...
 
- Protected Member Functions inherited from ramses::RamsesObject
 RamsesObject (RamsesObjectImpl &pimpl)
 Constructor for RamsesObject. More...
 
virtual ~RamsesObject ()
 Destructor of the RamsesObject. More...
 
- Protected Member Functions inherited from ramses::StatusObject
 StatusObject (StatusObjectImpl &pimpl)
 Constructor for StatusObject. More...
 
virtual ~StatusObject ()
 Destructor of the StatusObject. More...
 

Friends

class SceneImpl
 Scene is the factory for creating ArrayBuffer instances. More...
 

Detailed Description

The ArrayBuffer is a data object used to provide vertex or index data to ramses::GeometryBinding::setInputBuffer and ramses::GeometryBinding::setIndices. The buffer data of an ArrayBuffer is not filled initially and can be fully or partially updated in between scene flushes.

If an ArrayBuffer object is created with type ramses::EDataType::ByteBlob then an element is defined as one byte, rather than a logical vertex element. Hence, all functions of ArrayBuffer referring to element refer to a single byte within byte array.

Examples
ramses-example-data-buffers-vertices/src/main.cpp, ramses-example-interleaved-vertex-buffers/src/main.cpp, and ramses-example-local-pick-handling/src/main.cpp.

Constructor & Destructor Documentation

◆ ArrayBuffer()

ramses::ArrayBuffer::ArrayBuffer ( ArrayBufferImpl &  pimpl)
explicitprotected

Constructor for ArrayBuffer.

Parameters
[in]pimplInternal data for implementation specifics of ArrayBuffer (sink - instance becomes owner)

◆ ~ArrayBuffer()

virtual ramses::ArrayBuffer::~ArrayBuffer ( )
protectedvirtual

Destructor of the ArrayBuffer.

Member Function Documentation

◆ getData()

status_t ramses::ArrayBuffer::getData ( void *  buffer,
uint32_t  numElements 
) const

Copies the data of the data buffer into a user-provided buffer. The buffer must be sufficiently large to hold the data for the whole data buffer.

Parameters
[out]bufferThe buffer where the buffer data will be copied into
[in]numElementsThe number of elements to copy. For ArrayBuffer objects of type ramses::EDataType::ByteBlob this is the size in bytes of the data to copy.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ getDataType()

EDataType ramses::ArrayBuffer::getDataType ( ) const

Returns the data type associated with the buffer data.

Returns
data type of buffer data

◆ getMaximumNumberOfElements()

uint32_t ramses::ArrayBuffer::getMaximumNumberOfElements ( ) const

Returns the maximum number of data elements that can be stored in the data buffer.

For ArrayBuffer objects of type ramses::EDataType::ByteBlob this function returns the maximum size of buffer data in bytes.

Returns
Maximum number of elements

◆ getUsedNumberOfElements()

uint32_t ramses::ArrayBuffer::getUsedNumberOfElements ( ) const

Returns the used number of data elements.

If data buffer fully set by updateData, then used and maximum number of elements are equal. For ArrayBuffer objects of type ramses::EDataType::ByteBlob this function returns the used size of buffer data in bytes becuase element is defined as byte for this type.

Returns
Used size in number of elements

◆ updateData()

status_t ramses::ArrayBuffer::updateData ( uint32_t  firstElement,
uint32_t  numElements,
const void *  bufferData 
)

Update data of the ArrayBuffer object.

For ArrayBuffer objects of type ramses::EDataType::ByteBlob an element is defined as 1 byte.

Parameters
firstElementThe element index at which data update should begin.
numElementsThe number of elements to be updated. FirstElement + numElements must be less than or equal to getMaximumNumberOfElements specified at creation time of the ArrayBuffer object. The function writes (or overwrites) buffer data up to the specified count only, leaving any previously written or un-initialized data untouched.
bufferDataPointer in memory to the data provided for update. The function makes a copy of the data into ArrayBuffer data structures. ArrayBuffer object does not take ownership of the memory data passed to it.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-data-buffers-vertices/src/main.cpp, ramses-example-interleaved-vertex-buffers/src/main.cpp, and ramses-example-local-pick-handling/src/main.cpp.

Friends And Related Function Documentation

◆ SceneImpl

friend class SceneImpl
friend

Scene is the factory for creating ArrayBuffer instances.

Member Data Documentation

◆ impl

class ArrayBufferImpl& ramses::ArrayBuffer::impl

Stores internal data for implementation specifics of ArrayBuffer.


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