OpenSceneGraph  3.4.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
osg::Array Class Reference
Inheritance diagram for osg::Array:
Inheritance graph
[legend]

List of all members.

Public Types

enum  Type {
  ArrayType = 0, ByteArrayType = 1, ShortArrayType = 2, IntArrayType = 3,
  UByteArrayType = 4, UShortArrayType = 5, UIntArrayType = 6, FloatArrayType = 7,
  DoubleArrayType = 8, Vec2bArrayType = 9, Vec3bArrayType = 10, Vec4bArrayType = 11,
  Vec2sArrayType = 12, Vec3sArrayType = 13, Vec4sArrayType = 14, Vec2iArrayType = 15,
  Vec3iArrayType = 16, Vec4iArrayType = 17, Vec2ubArrayType = 18, Vec3ubArrayType = 19,
  Vec4ubArrayType = 20, Vec2usArrayType = 21, Vec3usArrayType = 22, Vec4usArrayType = 23,
  Vec2uiArrayType = 24, Vec3uiArrayType = 25, Vec4uiArrayType = 26, Vec2ArrayType = 27,
  Vec3ArrayType = 28, Vec4ArrayType = 29, Vec2dArrayType = 30, Vec3dArrayType = 31,
  Vec4dArrayType = 32, MatrixArrayType = 33, MatrixdArrayType = 34
}
enum  Binding {
  BIND_UNDEFINED = -1, BIND_OFF = 0, BIND_OVERALL = 1, BIND_PER_PRIMITIVE_SET = 2,
  BIND_PER_VERTEX = 4
}

Public Member Functions

 Array (Type arrayType=ArrayType, GLint dataSize=0, GLenum dataType=0, Binding binding=BIND_UNDEFINED)
 Array (const Array &array, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
virtual bool isSameKindAs (const Object *obj) const
virtual const char * libraryName () const
 return the name of the object's library.
virtual const char * className () const
 return the name of the object's class type.
virtual void accept (ArrayVisitor &)=0
virtual void accept (ConstArrayVisitor &) const =0
virtual void accept (unsigned int index, ValueVisitor &)=0
virtual void accept (unsigned int index, ConstValueVisitor &) const =0
virtual int compare (unsigned int lhs, unsigned int rhs) const =0
 Return -1 if lhs element is less than rhs element, 0 if equal, 1 if lhs element is greater than rhs element.
Type getType () const
GLint getDataSize () const
GLenum getDataType () const
virtual osg::ArrayasArray ()
virtual const osg::ArrayasArray () const
virtual unsigned int getElementSize () const =0
virtual const GLvoid * getDataPointer () const =0
virtual unsigned int getTotalDataSize () const =0
virtual unsigned int getNumElements () const =0
virtual void reserveArray (unsigned int num)=0
virtual void resizeArray (unsigned int num)=0
void setBinding (Binding binding)
 Specify how this array should be passed to OpenGL.
Binding getBinding () const
 Get how this array should be passed to OpenGL.
void setNormalize (bool normalize)
 Specify whether the array data should be normalized by OpenGL.
bool getNormalize () const
 Get whether the array data should be normalized by OpenGL.
void setPreserveDataType (bool preserve)
 Set hint to ask that the array data is passed via integer or double, or normal setVertexAttribPointer function.
bool getPreserveDataType () const
 Get hint to ask that the array data is passed via integer or double, or normal setVertexAttribPointer function.
virtual void trim ()
 Frees unused space on this vector - i.e.
void setVertexBufferObject (osg::VertexBufferObject *vbo)
 Set the VertexBufferObject.
osg::VertexBufferObjectgetVertexBufferObject ()
 Get the VertexBufferObject.
const osg::VertexBufferObjectgetVertexBufferObject () const
 Get the const VertexBufferObject.

Protected Member Functions

virtual ~Array ()

Protected Attributes

Type _arrayType
GLint _dataSize
GLenum _dataType
Binding _binding
bool _normalize
bool _preserveDataType

Member Enumeration Documentation

Enumerator:
BIND_UNDEFINED 
BIND_OFF 
BIND_OVERALL 
BIND_PER_PRIMITIVE_SET 
BIND_PER_VERTEX 
Enumerator:
ArrayType 
ByteArrayType 
ShortArrayType 
IntArrayType 
UByteArrayType 
UShortArrayType 
UIntArrayType 
FloatArrayType 
DoubleArrayType 
Vec2bArrayType 
Vec3bArrayType 
Vec4bArrayType 
Vec2sArrayType 
Vec3sArrayType 
Vec4sArrayType 
Vec2iArrayType 
Vec3iArrayType 
Vec4iArrayType 
Vec2ubArrayType 
Vec3ubArrayType 
Vec4ubArrayType 
Vec2usArrayType 
Vec3usArrayType 
Vec4usArrayType 
Vec2uiArrayType 
Vec3uiArrayType 
Vec4uiArrayType 
Vec2ArrayType 
Vec3ArrayType 
Vec4ArrayType 
Vec2dArrayType 
Vec3dArrayType 
Vec4dArrayType 
MatrixArrayType 
MatrixdArrayType 

Constructor & Destructor Documentation

osg::Array::Array ( Type  arrayType = ArrayType,
GLint  dataSize = 0,
GLenum  dataType = 0,
Binding  binding = BIND_UNDEFINED 
) [inline]
osg::Array::Array ( const Array array,
const CopyOp copyop = CopyOp::SHALLOW_COPY 
) [inline]
virtual osg::Array::~Array ( ) [inline, protected, virtual]

Member Function Documentation

virtual void osg::Array::accept ( ArrayVisitor ) [pure virtual]
virtual void osg::Array::accept ( ConstArrayVisitor ) const [pure virtual]
virtual void osg::Array::accept ( unsigned int  index,
ValueVisitor  
) [pure virtual]
virtual void osg::Array::accept ( unsigned int  index,
ConstValueVisitor  
) const [pure virtual]
virtual osg::Array* osg::Array::asArray ( ) [inline, virtual]

Reimplemented from osg::BufferData.

virtual const osg::Array* osg::Array::asArray ( ) const [inline, virtual]

Reimplemented from osg::BufferData.

virtual const char* osg::Array::className ( ) const [virtual]

return the name of the object's class type.

Must be defined by derived classes.

Reimplemented from osg::BufferData.

virtual int osg::Array::compare ( unsigned int  lhs,
unsigned int  rhs 
) const [pure virtual]

Return -1 if lhs element is less than rhs element, 0 if equal, 1 if lhs element is greater than rhs element.

Implemented in osg::TemplateIndexArray< T, ARRAYTYPE, DataSize, DataType >, and osg::TemplateArray< T, ARRAYTYPE, DataSize, DataType >.

Binding osg::Array::getBinding ( ) const [inline]
virtual const GLvoid* osg::Array::getDataPointer ( ) const [pure virtual]
GLint osg::Array::getDataSize ( ) const [inline]
GLenum osg::Array::getDataType ( ) const [inline]
virtual unsigned int osg::Array::getElementSize ( ) const [pure virtual]
bool osg::Array::getNormalize ( ) const [inline]
virtual unsigned int osg::Array::getNumElements ( ) const [pure virtual]
bool osg::Array::getPreserveDataType ( ) const [inline]

Get hint to ask that the array data is passed via integer or double, or normal setVertexAttribPointer function.

virtual unsigned int osg::Array::getTotalDataSize ( ) const [pure virtual]
Type osg::Array::getType ( ) const [inline]

Get the VertexBufferObject.

If no VBO is assigned returns NULL

Get the const VertexBufferObject.

If no VBO is assigned returns NULL

virtual bool osg::Array::isSameKindAs ( const Object obj) const [inline, virtual]

Reimplemented from osg::BufferData.

Reimplemented in osg::IndexArray.

References NULL.

virtual const char* osg::Array::libraryName ( ) const [inline, virtual]

return the name of the object's library.

Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name.

Reimplemented from osg::BufferData.

virtual void osg::Array::reserveArray ( unsigned int  num) [pure virtual]
virtual void osg::Array::resizeArray ( unsigned int  num) [pure virtual]
void osg::Array::setBinding ( Binding  binding) [inline]

Specify how this array should be passed to OpenGL.

void osg::Array::setNormalize ( bool  normalize) [inline]

Specify whether the array data should be normalized by OpenGL.

void osg::Array::setPreserveDataType ( bool  preserve) [inline]

Set hint to ask that the array data is passed via integer or double, or normal setVertexAttribPointer function.

virtual void osg::Array::trim ( ) [inline, virtual]

Frees unused space on this vector - i.e.

the difference between size() and max_size() of the underlying vector.

Reimplemented in osg::TemplateIndexArray< T, ARRAYTYPE, DataSize, DataType >, and osg::TemplateArray< T, ARRAYTYPE, DataSize, DataType >.


Member Data Documentation

GLint osg::Array::_dataSize [protected]
GLenum osg::Array::_dataType [protected]
bool osg::Array::_normalize [protected]

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

osg logo
Generated at Tue Dec 8 2015 00:16:40 for the OpenSceneGraph by doxygen 1.7.6.1.