openscenegraph
osg::BufferData Class Referenceabstract

#include <BufferObject>

Inheritance diagram for osg::BufferData:
osg::Object osg::Referenced osg::BufferTemplate< std::vector< T > > osg::Array osg::BufferTemplate< T > osg::BufferTemplate< std::vector< T > > osg::Image osg::IndirectCommandDrawArrays osg::IndirectCommandDrawElements osg::PrimitiveSet

Classes

struct  ModifiedCallback

Public Member Functions

 BufferData ()
 BufferData (const BufferData &bd, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
virtual bool isSameKindAs (const Object *obj) const
virtual const char * libraryName () const
virtual const char * className () const
virtual const GLvoid * getDataPointer () const =0
virtual unsigned int getTotalDataSize () const =0
virtual osg::Array * asArray ()
virtual const osg::Array * asArray () const
virtual osg::PrimitiveSet * asPrimitiveSet ()
virtual const osg::PrimitiveSet * asPrimitiveSet () const
virtual osg::Image * asImage ()
virtual const osg::Image * asImage () const
void setBufferObject (BufferObject *bufferObject)
BufferObject * getBufferObject ()
const BufferObject * getBufferObject () const
void setBufferIndex (unsigned int index)
unsigned int getBufferIndex () const
GLBufferObject * getGLBufferObject (unsigned int contextID) const
GLBufferObject * getOrCreateGLBufferObject (unsigned int contextID) const
void setModifiedCallback (ModifiedCallback *md)
ModifiedCallback * getModifiedCallback ()
const ModifiedCallback * getModifiedCallback () const
void dirty ()
void setModifiedCount (unsigned int value)
unsigned int getModifiedCount () const
virtual void resizeGLObjectBuffers (unsigned int maxSize)
void releaseGLObjects (State *state=0) const
unsigned int getNumClients () const
void addClient (osg::Object *)
void removeClient (osg::Object *)
Public Member Functions inherited from osg::Object
 Object ()
 Object (bool threadSafeRefUnref)
 Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
virtual Object * cloneType () const =0
virtual Object * clone (const CopyOp &) const =0
std::string getCompoundClassName () const
virtual Node * asNode ()
virtual const Node * asNode () const
virtual NodeVisitor * asNodeVisitor ()
virtual const NodeVisitor * asNodeVisitor () const
virtual StateSet * asStateSet ()
virtual const StateSet * asStateSet () const
virtual StateAttribute * asStateAttribute ()
virtual const StateAttribute * asStateAttribute () const
virtual Uniform * asUniform ()
virtual const Uniform * asUniform () const
virtual Camera * asCamera ()
virtual const Camera * asCamera () const
virtual Drawable * asDrawable ()
virtual const Drawable * asDrawable () const
virtual Callback * asCallback ()
virtual const Callback * asCallback () const
virtual CallbackObject * asCallbackObject ()
virtual const CallbackObject * asCallbackObject () const
virtual UserDataContainer * asUserDataContainer ()
virtual const UserDataContainer * asUserDataContainer () const
virtual ValueObject * asValueObject ()
virtual const ValueObject * asValueObject () const
virtual void setThreadSafeRefUnref (bool threadSafe)
virtual void setName (const std::string &name)
void setName (const char *name)
const std::string & getName () const
void setDataVariance (DataVariance dv)
DataVariance getDataVariance () const
virtual void computeDataVariance ()
void setUserDataContainer (osg::UserDataContainer *udc)
template<class T>
void setUserDataContainer (const ref_ptr< T > &udc)
osg::UserDataContainer * getUserDataContainer ()
const osg::UserDataContainer * getUserDataContainer () const
osg::UserDataContainer * getOrCreateUserDataContainer ()
virtual void setUserData (Referenced *obj)
template<class T>
void setUserData (const ref_ptr< T > &ud)
virtual Referenced * getUserData ()
virtual const Referenced * getUserData () const
template<typename T>
bool getUserValue (const std::string &name, T &value) const
template<typename T>
void setUserValue (const std::string &name, const T &value)
template<typename T>
BoolValueObject UCharValueObject UShortValueObject UIntValueObject DoubleValueObject Vec3fValueObject Vec2dValueObject Vec4dValueObject PlaneValueObject MatrixdValueObject BoundingBoxdValueObject BoundingSpheredValueObject bool getUserValue (const std::string &name, T &value) const
Public Member Functions inherited from osg::Referenced
 Referenced ()
 Referenced (bool threadSafeRefUnref)
 Referenced (const Referenced &)
Referenced & operator= (const Referenced &)
bool getThreadSafeRefUnref () const
OpenThreads::Mutex * getRefMutex () const
int ref () const
int unref () const
int unref_nodelete () const
int referenceCount () const
ObserverSet * getObserverSet () const
ObserverSet * getOrCreateObserverSet () const
void addObserver (Observer *observer) const
void removeObserver (Observer *observer) const

Protected Member Functions

virtual ~BufferData ()
Protected Member Functions inherited from osg::Object
virtual ~Object ()
Protected Member Functions inherited from osg::Referenced
virtual ~Referenced ()
void signalObserversAndDelete (bool signalDelete, bool doDelete) const
void deleteUsingDeleteHandler () const

Protected Attributes

unsigned int _modifiedCount
unsigned int _bufferIndex
osg::ref_ptr< BufferObject > _bufferObject
osg::ref_ptr< ModifiedCallback > _modifiedCallback
unsigned int _numClients
Protected Attributes inherited from osg::Object
std::string _name
DataVariance _dataVariance
osg::UserDataContainer * _userDataContainer
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr _observerSet
OpenThreads::Atomic _refCount

Additional Inherited Members

Public Types inherited from osg::Object
enum  DataVariance { DYNAMIC , STATIC , UNSPECIFIED }
Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * getGlobalReferencedMutex ()
static void setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * getDeleteHandler ()

Constructor & Destructor Documentation

◆ BufferData() [1/2]

◆ BufferData() [2/2]

osg::BufferData::BufferData ( const BufferData & bd,
const CopyOp & copyop = CopyOp::SHALLOW_COPY )
inline

Copy constructor using CopyOp to manage deep vs shallow copy.

References _bufferIndex, _modifiedCallback, _modifiedCount, _numClients, BufferData(), osg::Object::Object(), and osg::CopyOp::SHALLOW_COPY.

◆ ~BufferData()

virtual osg::BufferData::~BufferData ( )
protectedvirtual

Member Function Documentation

◆ addClient()

void osg::BufferData::addClient ( osg::Object * )
inline

References _numClients.

◆ asArray() [1/2]

virtual osg::Array * osg::BufferData::asArray ( )
inlinevirtual

Reimplemented in osg::Array.

◆ asArray() [2/2]

virtual const osg::Array * osg::BufferData::asArray ( ) const
inlinevirtual

Reimplemented in osg::Array.

◆ asImage() [1/2]

virtual osg::Image * osg::BufferData::asImage ( )
inlinevirtual

Convert 'this' into a Image pointer if Object is a Image, otherwise return 0. Equivalent to dynamic_cast<Image*>(this).

Reimplemented from osg::Object.

Reimplemented in osg::Image.

◆ asImage() [2/2]

virtual const osg::Image * osg::BufferData::asImage ( ) const
inlinevirtual

Convert 'this' into a Image pointer if Object is a Image, otherwise return 0. Equivalent to dynamic_cast<Image*>(this).

Reimplemented from osg::Object.

Reimplemented in osg::Image.

◆ asPrimitiveSet() [1/2]

virtual osg::PrimitiveSet * osg::BufferData::asPrimitiveSet ( )
inlinevirtual

Reimplemented in osg::PrimitiveSet.

◆ asPrimitiveSet() [2/2]

virtual const osg::PrimitiveSet * osg::BufferData::asPrimitiveSet ( ) const
inlinevirtual

Reimplemented in osg::PrimitiveSet.

◆ className()

◆ dirty()

void osg::BufferData::dirty ( )
inline

Dirty the primitive, which increments the modified count, to force buffer objects to update. If a ModifiedCallback is attached to this BufferData then the callback is called prior to the bufferObject's dirty is called.

References _bufferObject, _modifiedCallback, and _modifiedCount.

Referenced by osg::BufferTemplate< T >::setData(), and osg::BufferTemplate< std::vector< T > >::setData().

◆ getBufferIndex()

unsigned int osg::BufferData::getBufferIndex ( ) const
inline

References _bufferIndex.

◆ getBufferObject() [1/2]

BufferObject * osg::BufferData::getBufferObject ( )
inline

◆ getBufferObject() [2/2]

const BufferObject * osg::BufferData::getBufferObject ( ) const
inline

References _bufferObject.

◆ getDataPointer()

virtual const GLvoid * osg::BufferData::getDataPointer ( ) const
pure virtual

Implemented in osg::Array, osg::BufferTemplate< T >, osg::BufferTemplate< std::vector< T > >, osg::DefaultIndirectCommandDrawArrays, osg::DefaultIndirectCommandDrawElements, osg::DrawElementsIndirectUByte, osg::DrawElementsIndirectUInt, osg::DrawElementsIndirectUShort, osg::DrawElementsUByte, osg::DrawElementsUInt, osg::DrawElementsUShort, osg::Image, osg::PrimitiveSet, osg::TemplateArray< T, ARRAYTYPE, DataSize, DataType >, osg::TemplateArray< GLdouble, Array::DoubleArrayType, 1, GL_DOUBLE >, osg::TemplateArray< GLfloat, Array::FloatArrayType, 1, GL_FLOAT >, osg::TemplateArray< Matrixd, Array::MatrixdArrayType, 16, GL_DOUBLE >, osg::TemplateArray< Matrixf, Array::MatrixArrayType, 16, GL_FLOAT >, osg::TemplateArray< Quat, Array::QuatArrayType, 4, GL_DOUBLE >, osg::TemplateArray< Vec2, Array::Vec2ArrayType, 2, GL_FLOAT >, osg::TemplateArray< Vec2b, Array::Vec2bArrayType, 2, GL_BYTE >, osg::TemplateArray< Vec2d, Array::Vec2dArrayType, 2, GL_DOUBLE >, osg::TemplateArray< Vec2i, Array::Vec2iArrayType, 2, GL_INT >, osg::TemplateArray< Vec2s, Array::Vec2sArrayType, 2, GL_SHORT >, osg::TemplateArray< Vec2ub, Array::Vec2ubArrayType, 2, GL_UNSIGNED_BYTE >, osg::TemplateArray< Vec2ui, Array::Vec2uiArrayType, 2, GL_UNSIGNED_INT >, osg::TemplateArray< Vec2us, Array::Vec2usArrayType, 2, GL_UNSIGNED_SHORT >, osg::TemplateArray< Vec3, Array::Vec3ArrayType, 3, GL_FLOAT >, osg::TemplateArray< Vec3b, Array::Vec3bArrayType, 3, GL_BYTE >, osg::TemplateArray< Vec3d, Array::Vec3dArrayType, 3, GL_DOUBLE >, osg::TemplateArray< Vec3i, Array::Vec3iArrayType, 3, GL_INT >, osg::TemplateArray< Vec3s, Array::Vec3sArrayType, 3, GL_SHORT >, osg::TemplateArray< Vec3ub, Array::Vec3ubArrayType, 3, GL_UNSIGNED_BYTE >, osg::TemplateArray< Vec3ui, Array::Vec3uiArrayType, 3, GL_UNSIGNED_INT >, osg::TemplateArray< Vec3us, Array::Vec3usArrayType, 3, GL_UNSIGNED_SHORT >, osg::TemplateArray< Vec4, Array::Vec4ArrayType, 4, GL_FLOAT >, osg::TemplateArray< Vec4b, Array::Vec4bArrayType, 4, GL_BYTE >, osg::TemplateArray< Vec4d, Array::Vec4dArrayType, 4, GL_DOUBLE >, osg::TemplateArray< Vec4i, Array::Vec4iArrayType, 4, GL_INT >, osg::TemplateArray< Vec4s, Array::Vec4sArrayType, 4, GL_SHORT >, osg::TemplateArray< Vec4ub, Array::Vec4ubArrayType, 4, GL_UNSIGNED_BYTE >, osg::TemplateArray< Vec4ui, Array::Vec4uiArrayType, 4, GL_UNSIGNED_INT >, osg::TemplateArray< Vec4us, Array::Vec4usArrayType, 4, GL_UNSIGNED_SHORT >, osg::TemplateIndexArray< T, ARRAYTYPE, DataSize, DataType >, osg::TemplateIndexArray< GLbyte, Array::ByteArrayType, 1, GL_BYTE >, osg::TemplateIndexArray< GLint, Array::IntArrayType, 1, GL_INT >, osg::TemplateIndexArray< GLint64, Array::Int64ArrayType, 1, GL_INT64_ARB >, osg::TemplateIndexArray< GLshort, Array::ShortArrayType, 1, GL_SHORT >, osg::TemplateIndexArray< GLubyte, Array::UByteArrayType, 1, GL_UNSIGNED_BYTE >, osg::TemplateIndexArray< GLuint, Array::UIntArrayType, 1, GL_UNSIGNED_INT >, osg::TemplateIndexArray< GLuint64, Array::UInt64ArrayType, 1, GL_UNSIGNED_INT64_ARB >, and osg::TemplateIndexArray< GLushort, Array::UShortArrayType, 1, GL_UNSIGNED_SHORT >.

◆ getGLBufferObject()

GLBufferObject * osg::BufferData::getGLBufferObject ( unsigned int contextID) const
inline

References _bufferObject.

◆ getModifiedCallback() [1/2]

ModifiedCallback * osg::BufferData::getModifiedCallback ( )
inline

References _modifiedCallback.

◆ getModifiedCallback() [2/2]

const ModifiedCallback * osg::BufferData::getModifiedCallback ( ) const
inline

References _modifiedCallback.

◆ getModifiedCount()

unsigned int osg::BufferData::getModifiedCount ( ) const
inline

Get modified count value.

References _modifiedCount.

◆ getNumClients()

unsigned int osg::BufferData::getNumClients ( ) const
inline

References _numClients.

◆ getOrCreateGLBufferObject()

GLBufferObject * osg::BufferData::getOrCreateGLBufferObject ( unsigned int contextID) const
inline

References _bufferObject.

◆ getTotalDataSize()

virtual unsigned int osg::BufferData::getTotalDataSize ( ) const
pure virtual

Implemented in osg::Array, osg::BufferTemplate< T >, osg::BufferTemplate< std::vector< T > >, osg::DrawElementsIndirectUByte, osg::DrawElementsIndirectUInt, osg::DrawElementsIndirectUShort, osg::DrawElementsUByte, osg::DrawElementsUInt, osg::DrawElementsUShort, osg::Image, osg::IndirectCommandDrawArrays, osg::IndirectCommandDrawElements, osg::PrimitiveSet, osg::TemplateArray< T, ARRAYTYPE, DataSize, DataType >, osg::TemplateArray< GLdouble, Array::DoubleArrayType, 1, GL_DOUBLE >, osg::TemplateArray< GLfloat, Array::FloatArrayType, 1, GL_FLOAT >, osg::TemplateArray< Matrixd, Array::MatrixdArrayType, 16, GL_DOUBLE >, osg::TemplateArray< Matrixf, Array::MatrixArrayType, 16, GL_FLOAT >, osg::TemplateArray< Quat, Array::QuatArrayType, 4, GL_DOUBLE >, osg::TemplateArray< Vec2, Array::Vec2ArrayType, 2, GL_FLOAT >, osg::TemplateArray< Vec2b, Array::Vec2bArrayType, 2, GL_BYTE >, osg::TemplateArray< Vec2d, Array::Vec2dArrayType, 2, GL_DOUBLE >, osg::TemplateArray< Vec2i, Array::Vec2iArrayType, 2, GL_INT >, osg::TemplateArray< Vec2s, Array::Vec2sArrayType, 2, GL_SHORT >, osg::TemplateArray< Vec2ub, Array::Vec2ubArrayType, 2, GL_UNSIGNED_BYTE >, osg::TemplateArray< Vec2ui, Array::Vec2uiArrayType, 2, GL_UNSIGNED_INT >, osg::TemplateArray< Vec2us, Array::Vec2usArrayType, 2, GL_UNSIGNED_SHORT >, osg::TemplateArray< Vec3, Array::Vec3ArrayType, 3, GL_FLOAT >, osg::TemplateArray< Vec3b, Array::Vec3bArrayType, 3, GL_BYTE >, osg::TemplateArray< Vec3d, Array::Vec3dArrayType, 3, GL_DOUBLE >, osg::TemplateArray< Vec3i, Array::Vec3iArrayType, 3, GL_INT >, osg::TemplateArray< Vec3s, Array::Vec3sArrayType, 3, GL_SHORT >, osg::TemplateArray< Vec3ub, Array::Vec3ubArrayType, 3, GL_UNSIGNED_BYTE >, osg::TemplateArray< Vec3ui, Array::Vec3uiArrayType, 3, GL_UNSIGNED_INT >, osg::TemplateArray< Vec3us, Array::Vec3usArrayType, 3, GL_UNSIGNED_SHORT >, osg::TemplateArray< Vec4, Array::Vec4ArrayType, 4, GL_FLOAT >, osg::TemplateArray< Vec4b, Array::Vec4bArrayType, 4, GL_BYTE >, osg::TemplateArray< Vec4d, Array::Vec4dArrayType, 4, GL_DOUBLE >, osg::TemplateArray< Vec4i, Array::Vec4iArrayType, 4, GL_INT >, osg::TemplateArray< Vec4s, Array::Vec4sArrayType, 4, GL_SHORT >, osg::TemplateArray< Vec4ub, Array::Vec4ubArrayType, 4, GL_UNSIGNED_BYTE >, osg::TemplateArray< Vec4ui, Array::Vec4uiArrayType, 4, GL_UNSIGNED_INT >, osg::TemplateArray< Vec4us, Array::Vec4usArrayType, 4, GL_UNSIGNED_SHORT >, osg::TemplateIndexArray< T, ARRAYTYPE, DataSize, DataType >, osg::TemplateIndexArray< GLbyte, Array::ByteArrayType, 1, GL_BYTE >, osg::TemplateIndexArray< GLint, Array::IntArrayType, 1, GL_INT >, osg::TemplateIndexArray< GLint64, Array::Int64ArrayType, 1, GL_INT64_ARB >, osg::TemplateIndexArray< GLshort, Array::ShortArrayType, 1, GL_SHORT >, osg::TemplateIndexArray< GLubyte, Array::UByteArrayType, 1, GL_UNSIGNED_BYTE >, osg::TemplateIndexArray< GLuint, Array::UIntArrayType, 1, GL_UNSIGNED_INT >, osg::TemplateIndexArray< GLuint64, Array::UInt64ArrayType, 1, GL_UNSIGNED_INT64_ARB >, and osg::TemplateIndexArray< GLushort, Array::UShortArrayType, 1, GL_UNSIGNED_SHORT >.

◆ isSameKindAs()

◆ libraryName()

virtual const char * osg::BufferData::libraryName ( ) const
inlinevirtual

◆ releaseGLObjects()

void osg::BufferData::releaseGLObjects ( State * state = 0) const
virtual

If State is non-zero, this function releases OpenGL objects for the specified graphics context. Otherwise, releases OpenGL objects for all graphics contexts.

Reimplemented from osg::Object.

◆ removeClient()

void osg::BufferData::removeClient ( osg::Object * )
inline

References _numClients.

◆ resizeGLObjectBuffers()

virtual void osg::BufferData::resizeGLObjectBuffers ( unsigned int maxSize)
virtual

Resize any per context GLObject buffers to specified size.

Reimplemented from osg::Object.

◆ setBufferIndex()

void osg::BufferData::setBufferIndex ( unsigned int index)
inline

References _bufferIndex.

◆ setBufferObject()

◆ setModifiedCallback()

void osg::BufferData::setModifiedCallback ( ModifiedCallback * md)
inline

References _modifiedCallback.

◆ setModifiedCount()

void osg::BufferData::setModifiedCount ( unsigned int value)
inline

Set the modified count value.

References _modifiedCount.

Member Data Documentation

◆ _bufferIndex

unsigned int osg::BufferData::_bufferIndex
protected

◆ _bufferObject

◆ _modifiedCallback

osg::ref_ptr<ModifiedCallback> osg::BufferData::_modifiedCallback
protected

◆ _modifiedCount

unsigned int osg::BufferData::_modifiedCount
protected

◆ _numClients

unsigned int osg::BufferData::_numClients
protected

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