version 3.3

VRS::VertexAttributeMap Class Reference

#include <vrs/vertexattributemap.h>

Inheritance diagram for VRS::VertexAttributeMap:

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

List of all members.

Public Member Functions

 VertexAttributeMap ()
void addMapping (const ID &attributeName, const ID &dataRegister)
ID getMapping (const ID &dataRegister) const
void removeMapping (const ID &dataRegister)
bool registerIsUsed (const ID &dataRegister) const
Iterator< ID > * newVertexAttributeNameIterator () const
Iterator< ID > * newRegisterIterator () const
 VRS_TYPEINFO (VertexAttributeMap, MonoAttribute)
 VRS_SERIALIZABLE (VertexAttributeMap)

Static Public Member Functions

static VertexAttributeMapnewStandardMapping ()


Detailed Description

Monoattribute to delegate varying vertex data to data that corresponds to specific hardware specific registers.

Constructor & Destructor Documentation

VRS::VertexAttributeMap::VertexAttributeMap (  ) 

Vertices can be extended with user defined vertex data e.g. tangents or light direction vectors. Additional data, that has such an abstract name, must be mapped to data of which the hardware register is known for rendering. This attribute provides such a flexibel mapping from identifier for abstract data to vertex registers.

'attributeNames', that must be registered first, uniformly indicate user-defined vertex data types. Some predefined attibute names are given, e.g. 'TANGENT_ID()' and further names can be defined by applications. 'dataRegister' indicated registers data storage that is possibly linked to a register provided by graphics hardware. These are given with the painter interface. Also, the hardware specific painter interprets vertex attribute mappings. Unused hardware registers are not used for rendering; those can be used to store vertex data without the requirement to render them.

As an example, tangents can be transfered as texture coords to graphics hardware to be interpolated by the rasterizer. Then, interpolants result in fragments to be processed next.


Member Function Documentation

void VRS::VertexAttributeMap::addMapping ( const ID attributeName,
const ID dataRegister 
)

Adds a new vertex attribute mapping. The attribute name belongs to the user-defined vertex attrbute and the data register name is an identifier indicating the data type which is linked to the register to be used for the user-defined vertex data. One hardware register can be only assigned to one vertex data name, old vertex data names will be overwritten. On the other hand, the same vertex data name can be mapped to different hardware registers.

ID VRS::VertexAttributeMap::getMapping ( const ID dataRegister  )  const

gets the vertex data type identifier that is mapped to the given register identifier. Asserts if a mapping to the register does not exist.

void VRS::VertexAttributeMap::removeMapping ( const ID dataRegister  ) 

Removes the vertex attribute mapping that maps data to the given register identifier.

bool VRS::VertexAttributeMap::registerIsUsed ( const ID dataRegister  )  const

Checks if a register is already used.

Iterator<ID>* VRS::VertexAttributeMap::newVertexAttributeNameIterator (  )  const

Accessing all vertex attribute names provided.

Iterator<ID>* VRS::VertexAttributeMap::newRegisterIterator (  )  const

Accessing all register identifiers provided.

static VertexAttributeMap* VRS::VertexAttributeMap::newStandardMapping (  )  [static]

Returns a new instance containing the following standard mappings: VERTEX, NORMAL, COLOR, SECONDARY_COLOR, FOG_COORD, EDGE_FLAG, VERTEX_WEIGHT, TEX_COORD_0 The mappings returned may be modified or extended.

VRS::VertexAttributeMap::VRS_TYPEINFO ( VertexAttributeMap  ,
MonoAttribute   
)

VRS::VertexAttributeMap::VRS_SERIALIZABLE ( VertexAttributeMap   ) 


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

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