version 3.3

VRS::MappedVertexAttributeDataGL Class Reference

#include <vrs/opengl/mappedvertexattributedatagl.h>

Inheritance diagram for VRS::MappedVertexAttributeDataGL:

VRS::MonoAttribute VRS::Attribute VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 MappedVertexAttributeDataGL (const PolygonSet *source, BufferObjectGL::UsagePattern usage=BufferObjectGL::STATIC_DRAW)
 MappedVertexAttributeDataGL (BaseVertexAttributeBufferObjectGL *vertices=NULL, BaseVertexAttributeBufferObjectGL *normals=NULL, BaseVertexAttributeBufferObjectGL *color=NULL, BaseVertexAttributeBufferObjectGL *tex_coord_0=NULL)
BaseVertexAttributeBufferObjectGLgetBufferObject (const ID &vertexAttributeName) const
void setBufferObject (const ID &vertexAttributeName, BaseVertexAttributeBufferObjectGL *content)
 Set and get per-vertex values for a vertex attribute name.
SO< Dictionary< ID, SO
< BaseVertexAttributeBufferObjectGL > > > 
getBufferObjects () const
 Returns the dictionary with all contained buffer objects.
void clear ()
 Throws away all internal data, resulting in an empty object.
UINT usedMemory () const
 VRS_TYPEINFO (MappedVertexAttributeDataGL, MonoAttribute)
 VRS_SERIALIZABLE (MappedVertexAttributeDataGL)


Detailed Description

Class for specifying attributes for vertices in vertex arrays. This class is similar to MappedVertexAttributeShapeGL. The only difference is, that a MappedVertexAttributeDataGL provides only the vertex attributes, but does not determine how they are rendered. Shapes being painted with an active MappedVertexAttributeDataGL can use the vertex attribute data by openGL calls (e.g. glDrawElements()). This is done e.g. by VertexAttributeIndexGL.

Constructor & Destructor Documentation

VRS::MappedVertexAttributeDataGL::MappedVertexAttributeDataGL ( const PolygonSet source,
BufferObjectGL::UsagePattern  usage = BufferObjectGL::STATIC_DRAW 
)

Creates a mapped vertex attribute data from a given polygon set 'source', which must not be NULL. For the usage parameter see "bufferobjectgl.h". The data of 'source' is copied into buffers objects. For efficiency the data is stored in the following form: > vector data: 3-tuple of floats > color data: 4-tuple of unsigned char

VRS::MappedVertexAttributeDataGL::MappedVertexAttributeDataGL ( BaseVertexAttributeBufferObjectGL vertices = NULL,
BaseVertexAttributeBufferObjectGL normals = NULL,
BaseVertexAttributeBufferObjectGL color = NULL,
BaseVertexAttributeBufferObjectGL tex_coord_0 = NULL 
)

The attribute stores per-vertex values for user-defined vertex attribute names. These names are independent from the underlying OpenGL graphics hardware Due to the mapping provided by the MonoAttribute 'VertexAttributeMap' per-vertex values will be mapped to target data resp. OpenGL registers. Per-vertex values for common names can be added using the constructor. To extend the set of vertex attribute names registrate a new vertex attribute names (see VertexAtributeMap).

Note: If no mapping is available for a vertex name no vertex data will be transfered to graphics hardware. Also, if the target register is not supported by the painter no transfer will be appied.


Member Function Documentation

BaseVertexAttributeBufferObjectGL* VRS::MappedVertexAttributeDataGL::getBufferObject ( const ID vertexAttributeName  )  const

void VRS::MappedVertexAttributeDataGL::setBufferObject ( const ID vertexAttributeName,
BaseVertexAttributeBufferObjectGL content 
)

Set and get per-vertex values for a vertex attribute name.

SO<Dictionary<ID, SO<BaseVertexAttributeBufferObjectGL> > > VRS::MappedVertexAttributeDataGL::getBufferObjects (  )  const

Returns the dictionary with all contained buffer objects.

void VRS::MappedVertexAttributeDataGL::clear (  ) 

Throws away all internal data, resulting in an empty object.

Note that it is faster to use clear an existing MappedVertexAttributeShapeGL-object than to instantiate a new MappedVertexAttributeShapeGL-object and destruct the old one

UINT VRS::MappedVertexAttributeDataGL::usedMemory (  )  const

Returns the sum of bytes allocated by all buffer objects belonging to this vertex attribute set.

VRS::MappedVertexAttributeDataGL::VRS_TYPEINFO ( MappedVertexAttributeDataGL  ,
MonoAttribute   
)

VRS::MappedVertexAttributeDataGL::VRS_SERIALIZABLE ( MappedVertexAttributeDataGL   ) 


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

Generated on Mon May 21 06:00:21 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact