This is a version of the attributes set container which accesses elements by typesafe IDs. 更多...
#include <MeshAttributeArray.h>
类 TAttributesSet< ElementIDType > 继承关系图:Public 成员函数 | |
| template<typename ForEachFunc > | |
| void | ForEach (ForEachFunc Func) |
| Call the supplied function on each attribute. 更多... | |
| template<typename ForEachFunc > | |
| void | ForEach (ForEachFunc Func) const |
| Call the supplied function on each attribute. 更多... | |
| template<typename FuncType > | |
| void | ForEachAttributeIndicesArray (const FuncType &Func) |
| Call the supplied function on each attribute. 更多... | |
| template<typename AttributeType > | |
| int32 | GetAttributeIndexCount (const FName AttributeName) const |
| Returns the number of indices for the attribute with the given name | |
| template<typename AttributeType > | |
| TMeshAttributesConstRef< ElementIDType, AttributeType > | GetAttributesRef (const FName AttributeName) const |
| Get an attribute array with the given type and name. 更多... | |
| FORCEINLINE void | Insert (const ElementIDType ElementID) |
| Inserts a default-initialized value for all attributes of the given ID | |
| template<typename AttributeType > | |
| void | InsertAttributeIndex (const FName AttributeName, const int32 Index) |
| Insert a new index for the attribute with the given name | |
| FORCEINLINE void | Remove (const ElementIDType ElementID) |
| Removes all attributes with the given ID | |
| template<typename AttributeType > | |
| void | RemoveAttributeIndex (const FName AttributeName, const int32 Index) |
| Remove an existing index from the attribute with the given name | |
| template<typename AttributeType > | |
| void | SetAttributeIndexCount (const FName AttributeName, const int32 NumIndices) |
| Sets the number of indices for the attribute with the given name | |
Public 成员函数 继承自 FAttributesSetBase | |
| FAttributesSetBase () | |
| Constructor | |
| template<typename Allocator > | |
| void | GetAttributeNames (TArray< FName, Allocator > &OutAttributeNames) const |
| Returns an array of all the attribute names registered | |
| bool | HasAttribute (const FName AttributeName) const |
| Determines whether an attribute exists with the given name | |
| template<typename AttributeType > | |
| bool | HasAttributeOfType (const FName AttributeName) const |
| Determines whether an attribute of the given type exists with the given name | |
| void | Initialize (const int32 Count) |
| Initializes all attributes to have the given number of elements with the default value | |
| template<typename AttributeType > | |
| void | RegisterAttribute (const FName AttributeName, const int32 NumberOfIndices=1, const AttributeType &Default=AttributeType(), const EMeshAttributeFlags Flags=EMeshAttributeFlags::None) |
| Register a new attribute name with the given type (must be a member of the AttributeTypes tuple). 更多... | |
| void | Remap (const TSparseArray< int32 > &IndexRemap) |
| Applies the given remapping to the attributes set | |
| void | UnregisterAttribute (const FName AttributeName) |
| Unregister an attribute with the given name. | |
额外继承的成员函数 | |
Protected 成员函数 继承自 FAttributesSetBase | |
| void | Insert (const int32 Index) |
| Insert a new element at the given index. 更多... | |
| void | Remove (const int32 Index) |
| Remove an element at the given index. 更多... | |
Protected 属性 继承自 FAttributesSetBase | |
| TMap< FName, FAttributesSetEntry > | Map |
| The actual container | |
| int32 | NumElements |
| The number of elements in each attribute array | |
This is a version of the attributes set container which accesses elements by typesafe IDs.
This prevents access of (for example) vertex instance attributes by vertex IDs.
| void TAttributesSet< ElementIDType >::ForEach | ( | ForEachFunc | Func | ) |
Call the supplied function on each attribute.
The prototype should be Func( const FName AttributeName, auto AttributesRef );
| void TAttributesSet< ElementIDType >::ForEach | ( | ForEachFunc | Func | ) | const |
Call the supplied function on each attribute.
The prototype should be Func( const FName AttributeName, auto AttributesConstRef );
|
inline |
Call the supplied function on each attribute.
The prototype should be Func( const FName AttributeName, auto& AttributeIndicesArray );
|
inline |
Get an attribute array with the given type and name.
The attribute type must correspond to the type passed as the template parameter.
Example of use:
TVertexAttributesConstRef<FVector> VertexPositions = VertexAttributes().GetAttributesRef<FVector>( "Position" ); // note: assign to value type
for( const FVertexID VertexID : GetVertices().GetElementIDs() )
{
const FVector Position = VertexPositions.Get( VertexID );
DoSomethingWith( Position );
}
Note that the returned object is a value type which should be assigned and passed by value, not reference. It is valid for as long as this TAttributesSet object exists.