Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.IAttributeContainer

The IAttributeContainer property interface.

This interface provides a common way to store and retrieve individual vertex attributes of different types, usually found in nodes implementing e.g. the Graph::IVertexBuffer interface.


Table members

Methods


AddAttribute(item, type, byteOffset)

Add a predefined vertex attribute. This method adds a predefined vertex attribute to the container, with a given attribute type and a given byte offset relative to each vertex entry's start pointer. As a convenience, the byte offset variable is incremented by the actual number of bytes used by the given attribute type, e.g. 12 for a 3-component vector of floats. If successful, this method returns the zero-based index of the newly created attribute in the container; if failed, -1 is returned.

Integer, Integer AddAttribute(Murl.IEnums.AttributeItem item, Murl.IEnums.AttributeType type, Integer byteOffset)

Parameters
itemThe predefined attribute to add.
typeThe attribute's data type.
byteOffsetThe byte offset of the attribute location relative to a vertex entry's start.
Returns
Integer The zero-based index of the attribute in the container, or -1 if failed.
Integer byteOffset The byte offset of the attribute location relative to a vertex entry's start.

AddAttribute(name, type, byteOffset)

Add a user-defined vertex attribute. This method adds a user-defined vertex attribute to the container, with a given attribute type and a given byte offset relative to each vertex entry's start pointer. The newly created attribute is only in effect when a shader material is currently active that actually uses an attribute with the given name as input to the vertex shader. As a convenience, the byte offset variable is incremented by the actual number of bytes used by the given attribute type, e.g. 12 for a 3-component vector of floats. If successful, this method returns the zero-based index of the newly created attribute in the container; if failed, -1 is returned.

Integer, Integer AddAttribute(String name, Murl.IEnums.AttributeType type, Integer byteOffset)

Parameters
nameThe name of the attribute variable to add.
typeThe attribute's data type.
byteOffsetThe byte offset of the attribute location relative to a vertex entry's start.
Returns
Integer The zero-based index of the attribute in the container, or -1 if failed.
Integer byteOffset The byte offset of the attribute location relative to a vertex entry's start.

GetAttributeIndex(item)

Query the location of a predefined attribute in the container. This method can be used to query the zero-based index of a given predefined attribute in the container. If the container does not hold the given attribute, -1 is returned.

Integer GetAttributeIndex(Murl.IEnums.AttributeItem item)

Parameters
itemThe predefined attribute to query.
Returns
Integer The zero-based index of the attribute, or -1 if not found.

GetAttributeIndex(name)

Query the location of a user-defined attribute in the container. This method can be used to query the zero-based index of a given user-defined attribute in the container. If the container does not hold the given attribute, -1 is returned.

Integer GetAttributeIndex(String name)

Parameters
nameThe name of the user-defined attribute to query.
Returns
Integer The zero-based index of the attribute, or -1 if not found.

GetNumberOfAttributes()

Get the total number of individual attributes in the container.

Integer GetNumberOfAttributes()

Returns
Integer The total number of attributes added.

GetAttributeType(index)

Query the type of an attribute at a given index.

Murl.IEnums.AttributeType GetAttributeType(Integer index)

Parameters
indexThe zero-based index of the attribute to query.
Returns
Murl.IEnums.AttributeType The attribute type.

GetAttributeItem(index)

Query the predefined item of an attribute at a given index. If the attribute at the given index represents a predefined one, this method returns the actual item, e.g. IEnums::ATTRIBUTE_ITEM_NORMAL for vertex normal vectors. If the attribute is a user-defined one, it returns IEnums::ATTRIBUTE_ITEM_CUSTOM.

Murl.IEnums.AttributeItem GetAttributeItem(Integer index)

Parameters
indexThe zero-based index of the attribute to query.
Returns
Murl.IEnums.AttributeItem The predefined attribute item.

GetAttributeName(index)

Query the variable name of an attribute at a given index. If the attribute at the given index represents a user-defined one, this method returns its actual name string. If it is a predefined one, an empty string is returned.

String GetAttributeName(Integer index)

Parameters
indexThe zero-based index of the attribute to query.
Returns
String The user-defined attribute variable name.

GetAttributeByteOffset(index)

Get the byte offset of an attribute at a given index.

Integer GetAttributeByteOffset(Integer index)

Parameters
indexThe zero-based index of the attribute to query.
Returns
Integer The attribute's byte offset relative to the beginning of a vertex entry.

GetAttribute(index)

Get the attribute object at a given index. This method returns an actual attribute object by its Graph::IAttribute base interface. The base interface can be used to query common attribute properties; if access to actual attribute data is required, use either a dynamic_cast to one of the available specialized interfaces (e.g. Graph::IFloatVector4Attribute), or use the respective explicit method, e.g. GetFloatVector4Attribute().

Murl.Graph.IAttribute GetAttribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IAttribute The attribute object.

GetFloatAttribute(index)

Get the attribute at a given index as a scalar float object. This method can be used as a convenience to retrieve a typed attribute object. If the attribute present in the container at the given index does not match the requested type (scalar float in this case), a null pointer is returned.

Murl.Graph.IFloatAttribute GetFloatAttribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IFloatAttribute The attribute object, or a null pointer if the types do not match.

GetFloatVector2Attribute(index)

Get the attribute at a given index as a 2-component float vector object. See GetFloatAttribute().

Murl.Graph.IFloatVector2Attribute GetFloatVector2Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IFloatVector2Attribute The attribute object, or a null pointer if the types do not match.

GetFloatVector3Attribute(index)

Get the attribute at a given index as a 3-component float vector object. See GetFloatAttribute().

Murl.Graph.IFloatVector3Attribute GetFloatVector3Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IFloatVector3Attribute The attribute object, or a null pointer if the types do not match.

GetFloatVector4Attribute(index)

Get the attribute at a given index as a 4-component float vector object. See GetFloatAttribute().

Murl.Graph.IFloatVector4Attribute GetFloatVector4Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IFloatVector4Attribute The attribute object, or a null pointer if the types do not match.

GetUInt8Attribute(index)

Get the attribute at a given index as a scalar UInt8 object. See GetFloatAttribute().

Murl.Graph.IUInt8Attribute GetUInt8Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt8Attribute The attribute object, or a null pointer if the types do not match.

GetUInt8Vector2Attribute(index)

Get the attribute at a given index as a 2-component UInt8 vector object. See GetFloatAttribute().

Murl.Graph.IUInt8Vector2Attribute GetUInt8Vector2Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt8Vector2Attribute The attribute object, or a null pointer if the types do not match.

GetUInt8Vector3Attribute(index)

Get the attribute at a given index as a 3-component UInt8 vector object. See GetFloatAttribute().

Murl.Graph.IUInt8Vector3Attribute GetUInt8Vector3Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt8Vector3Attribute The attribute object, or a null pointer if the types do not match.

GetUInt8Vector4Attribute(index)

Get the attribute at a given index as a 4-component UInt8 vector object. See GetFloatAttribute().

Murl.Graph.IUInt8Vector4Attribute GetUInt8Vector4Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt8Vector4Attribute The attribute object, or a null pointer if the types do not match.

GetSInt8Attribute(index)

Get the attribute at a given index as a scalar SInt8 object. See GetFloatAttribute().

Murl.Graph.ISInt8Attribute GetSInt8Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt8Attribute The attribute object, or a null pointer if the types do not match.

GetSInt8Vector2Attribute(index)

Get the attribute at a given index as a 2-component SInt8 vector object. See GetFloatAttribute().

Murl.Graph.ISInt8Vector2Attribute GetSInt8Vector2Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt8Vector2Attribute The attribute object, or a null pointer if the types do not match.

GetSInt8Vector3Attribute(index)

Get the attribute at a given index as a 3-component SInt8 vector object. See GetFloatAttribute().

Murl.Graph.ISInt8Vector3Attribute GetSInt8Vector3Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt8Vector3Attribute The attribute object, or a null pointer if the types do not match.

GetSInt8Vector4Attribute(index)

Get the attribute at a given index as a 4-component SInt8 vector object. See GetFloatAttribute().

Murl.Graph.ISInt8Vector4Attribute GetSInt8Vector4Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt8Vector4Attribute The attribute object, or a null pointer if the types do not match.

GetUInt16Attribute(index)

Get the attribute at a given index as a scalar UInt16 object. See GetFloatAttribute().

Murl.Graph.IUInt16Attribute GetUInt16Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt16Attribute The attribute object, or a null pointer if the types do not match.

GetUInt16Vector2Attribute(index)

Get the attribute at a given index as a 2-component UInt16 vector object. See GetFloatAttribute().

Murl.Graph.IUInt16Vector2Attribute GetUInt16Vector2Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt16Vector2Attribute The attribute object, or a null pointer if the types do not match.

GetUInt16Vector3Attribute(index)

Get the attribute at a given index as a 3-component UInt16 vector object. See GetFloatAttribute().

Murl.Graph.IUInt16Vector3Attribute GetUInt16Vector3Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt16Vector3Attribute The attribute object, or a null pointer if the types do not match.

GetUInt16Vector4Attribute(index)

Get the attribute at a given index as a 4-component UInt16 vector object. See GetFloatAttribute().

Murl.Graph.IUInt16Vector4Attribute GetUInt16Vector4Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt16Vector4Attribute The attribute object, or a null pointer if the types do not match.

GetSInt16Attribute(index)

Get the attribute at a given index as a scalar SInt16 object. See GetFloatAttribute().

Murl.Graph.ISInt16Attribute GetSInt16Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt16Attribute The attribute object, or a null pointer if the types do not match.

GetSInt16Vector2Attribute(index)

Get the attribute at a given index as a 2-component SInt16 vector object. See GetFloatAttribute().

Murl.Graph.ISInt16Vector2Attribute GetSInt16Vector2Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt16Vector2Attribute The attribute object, or a null pointer if the types do not match.

GetSInt16Vector3Attribute(index)

Get the attribute at a given index as a 3-component SInt16 vector object. See GetFloatAttribute().

Murl.Graph.ISInt16Vector3Attribute GetSInt16Vector3Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt16Vector3Attribute The attribute object, or a null pointer if the types do not match.

GetSInt16Vector4Attribute(index)

Get the attribute at a given index as a 4-component SInt16 vector object. See GetFloatAttribute().

Murl.Graph.ISInt16Vector4Attribute GetSInt16Vector4Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt16Vector4Attribute The attribute object, or a null pointer if the types do not match.

GetUInt32Attribute(index)

Get the attribute at a given index as a scalar UInt32 object. See GetFloatAttribute().

Murl.Graph.IUInt32Attribute GetUInt32Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt32Attribute The attribute object, or a null pointer if the types do not match.

GetUInt32Vector2Attribute(index)

Get the attribute at a given index as a 2-component UInt32 vector object. See GetFloatAttribute().

Murl.Graph.IUInt32Vector2Attribute GetUInt32Vector2Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt32Vector2Attribute The attribute object, or a null pointer if the types do not match.

GetUInt32Vector3Attribute(index)

Get the attribute at a given index as a 3-component UInt32 vector object. See GetFloatAttribute().

Murl.Graph.IUInt32Vector3Attribute GetUInt32Vector3Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt32Vector3Attribute The attribute object, or a null pointer if the types do not match.

GetUInt32Vector4Attribute(index)

Get the attribute at a given index as a 4-component UInt32 vector object. See GetFloatAttribute().

Murl.Graph.IUInt32Vector4Attribute GetUInt32Vector4Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt32Vector4Attribute The attribute object, or a null pointer if the types do not match.

GetSInt32Attribute(index)

Get the attribute at a given index as a scalar SInt32 object. See GetFloatAttribute().

Murl.Graph.ISInt32Attribute GetSInt32Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt32Attribute The attribute object, or a null pointer if the types do not match.

GetSInt32Vector2Attribute(index)

Get the attribute at a given index as a 2-component SInt32 vector object. See GetFloatAttribute().

Murl.Graph.ISInt32Vector2Attribute GetSInt32Vector2Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt32Vector2Attribute The attribute object, or a null pointer if the types do not match.

GetSInt32Vector3Attribute(index)

Get the attribute at a given index as a 3-component SInt32 vector object. See GetFloatAttribute().

Murl.Graph.ISInt32Vector3Attribute GetSInt32Vector3Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt32Vector3Attribute The attribute object, or a null pointer if the types do not match.

GetSInt32Vector4Attribute(index)

Get the attribute at a given index as a 4-component SInt32 vector object. See GetFloatAttribute().

Murl.Graph.ISInt32Vector4Attribute GetSInt32Vector4Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt32Vector4Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedUInt8Attribute(index)

Get the attribute at a given index as a normalized scalar UInt8 object. See GetFloatAttribute().

Murl.Graph.IUInt8Attribute GetNormalizedUInt8Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt8Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedUInt8Vector2Attribute(index)

Get the attribute at a given index as a normalized 2-component UInt8 vector object. See GetFloatAttribute().

Murl.Graph.IUInt8Vector2Attribute GetNormalizedUInt8Vector2Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt8Vector2Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedUInt8Vector3Attribute(index)

Get the attribute at a given index as a normalized 3-component UInt8 vector object. See GetFloatAttribute().

Murl.Graph.IUInt8Vector3Attribute GetNormalizedUInt8Vector3Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt8Vector3Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedUInt8Vector4Attribute(index)

Get the attribute at a given index as a normalized 4-component UInt8 vector object. See GetFloatAttribute().

Murl.Graph.IUInt8Vector4Attribute GetNormalizedUInt8Vector4Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt8Vector4Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedSInt8Attribute(index)

Get the attribute at a given index as a normalized scalar SInt8 object. See GetFloatAttribute().

Murl.Graph.ISInt8Attribute GetNormalizedSInt8Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt8Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedSInt8Vector2Attribute(index)

Get the attribute at a given index as a normalized 2-component SInt8 vector object. See GetFloatAttribute().

Murl.Graph.ISInt8Vector2Attribute GetNormalizedSInt8Vector2Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt8Vector2Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedSInt8Vector3Attribute(index)

Get the attribute at a given index as a normalized 3-component SInt8 vector object. See GetFloatAttribute().

Murl.Graph.ISInt8Vector3Attribute GetNormalizedSInt8Vector3Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt8Vector3Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedSInt8Vector4Attribute(index)

Get the attribute at a given index as a normalized 4-component SInt8 vector object. See GetFloatAttribute().

Murl.Graph.ISInt8Vector4Attribute GetNormalizedSInt8Vector4Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt8Vector4Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedUInt16Attribute(index)

Get the attribute at a given index as a normalized scalar UInt16 object. See GetFloatAttribute().

Murl.Graph.IUInt16Attribute GetNormalizedUInt16Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt16Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedUInt16Vector2Attribute(index)

Get the attribute at a given index as a normalized 2-component UInt16 vector object. See GetFloatAttribute().

Murl.Graph.IUInt16Vector2Attribute GetNormalizedUInt16Vector2Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt16Vector2Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedUInt16Vector3Attribute(index)

Get the attribute at a given index as a normalized 3-component UInt16 vector object. See GetFloatAttribute().

Murl.Graph.IUInt16Vector3Attribute GetNormalizedUInt16Vector3Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt16Vector3Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedUInt16Vector4Attribute(index)

Get the attribute at a given index as a normalized 4-component UInt16 vector object. See GetFloatAttribute().

Murl.Graph.IUInt16Vector4Attribute GetNormalizedUInt16Vector4Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.IUInt16Vector4Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedSInt16Attribute(index)

Get the attribute at a given index as a normalized scalar SInt16 object. See GetFloatAttribute().

Murl.Graph.ISInt16Attribute GetNormalizedSInt16Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt16Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedSInt16Vector2Attribute(index)

Get the attribute at a given index as a normalized 2-component SInt16 vector object. See GetFloatAttribute().

Murl.Graph.ISInt16Vector2Attribute GetNormalizedSInt16Vector2Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt16Vector2Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedSInt16Vector3Attribute(index)

Get the attribute at a given index as a normalized 3-component SInt16 vector object. See GetFloatAttribute().

Murl.Graph.ISInt16Vector3Attribute GetNormalizedSInt16Vector3Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt16Vector3Attribute The attribute object, or a null pointer if the types do not match.

GetNormalizedSInt16Vector4Attribute(index)

Get the attribute at a given index as a normalized 4-component SInt16 vector object. See GetFloatAttribute().

Murl.Graph.ISInt16Vector4Attribute GetNormalizedSInt16Vector4Attribute(Integer index)

Parameters
indexThe zero-based index of the attribute to retrieve.
Returns
Murl.Graph.ISInt16Vector4Attribute The attribute object, or a null pointer if the types do not match.