UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TMeshAttributesRef< ElementIDType, AttributeType > Class Template Reference

#include <MeshAttributeArray.h>

Public Types

using BaseArrayType = TCopyQualifiersFromTo_T< AttributeType, FMeshAttributeArraySetBase >
 
using ArrayType = TCopyQualifiersFromTo_T< AttributeType, TMeshAttributeArraySet< std::remove_cv_t< AttributeType > > >
 

Public Member Functions

 TMeshAttributesRef (BaseArrayType *InArrayPtr=nullptr, uint32 InExtent=1)
 
template<typename SrcAttributeType , typename DestAttributeType = AttributeType, typename TEnableIf< std::is_const_v< DestAttributeType >, int >::Type = 0, typename TEnableIf<!std::is_const_v< SrcAttributeType >, int >::Type = 0>
 TMeshAttributesRef (const TMeshAttributesRef< ElementIDType, SrcAttributeType > &InRef)
 
template<typename IDType = ElementIDType, typename TEnableIf<!std::is_same_v< IDType, int32 >, int >::Type = 0>
 TMeshAttributesRef (const TMeshAttributesRef< int32, AttributeType > &InRef)
 
template<typename SrcAttributeType , typename DestAttributeType = AttributeType, typename IDType = ElementIDType, typename TEnableIf<!std::is_same_v< IDType, int32 >, int >::Type = 0, typename TEnableIf< std::is_const_v< DestAttributeType >, int >::Type = 0, typename TEnableIf<!std::is_const_v< SrcAttributeType >, int >::Type = 0>
 TMeshAttributesRef (const TMeshAttributesRef< int32, SrcAttributeType > &InRef)
 
template<typename T = ElementIDType, typename TEnableIf< TIsDerivedFrom< T, FElementID >::Value, int >::Type = 0>
AttributeType & operator[] (const ElementIDType ElementID) const
 
template<typename T = ElementIDType, typename TEnableIf< TIsDerivedFrom< T, FElementID >::Value, int >::Type = 0>
AttributeType Get (const ElementIDType ElementID, const int32 Channel=0) const
 
AttributeType & operator[] (int32 ElementIndex) const
 
AttributeType Get (int32 ElementIndex, const int32 Channel=0) const
 
TArrayView< AttributeType > GetArrayView (int32 ElementIndex, const int32 Channel=0) const
 
TArrayView< AttributeType > GetRawArray (const int32 AttributeChannel=0) const
 
bool IsValid () const
 
AttributeType GetDefaultValue () const
 
int32 GetNumIndices () const
 
int32 GetNumChannels () const
 
int32 GetNumElements () const
 
EMeshAttributeFlags GetFlags () const
 
uint32 GetExtent () const
 
template<typename T = ElementIDType, typename TEnableIf< TIsDerivedFrom< T, FElementID >::Value, int >::Type = 0>
void Set (const ElementIDType ElementID, const AttributeType &Value) const
 
template<typename T = ElementIDType, typename TEnableIf< TIsDerivedFrom< T, FElementID >::Value, int >::Type = 0>
void Set (const ElementIDType ElementID, const int32 Channel, const AttributeType &Value) const
 
void Set (int32 ElementIndex, const AttributeType &Value) const
 
void Set (int32 ElementIndex, const int32 Channel, const AttributeType &Value) const
 
void SetArrayView (int32 ElementIndex, TArrayView< const AttributeType > Value) const
 
void SetArrayView (int32 ElementIndex, const int32 Channel, TArrayView< const AttributeType > Value) const
 
void Copy (TMeshAttributesRef< ElementIDType, const AttributeType > Src, const int32 DestChannel=0, const int32 SrcChannel=0)
 
void SetNumIndices (const int32 NumChannels) const
 
void SetNumChannels (const int32 NumChannels) const
 
void InsertIndex (const int32 Index) const
 
void InsertChannel (const int32 Channel) const
 
void RemoveIndex (const int32 Index) const
 
void RemoveChannel (const int32 Channel) const
 

Friends

template<typename T , typename U >
class TMeshAttributesRef
 

Detailed Description

template<typename ElementIDType, typename AttributeType>
class TMeshAttributesRef< ElementIDType, AttributeType >

This is the class used to access attribute values. It is a proxy object to a TMeshAttributeArraySet<> and should be passed by value. It is valid for as long as the owning FMeshDescription exists.

Member Typedef Documentation

◆ ArrayType

template<typename ElementIDType , typename AttributeType >
using TMeshAttributesRef< ElementIDType, AttributeType >::ArrayType = TCopyQualifiersFromTo_T<AttributeType, TMeshAttributeArraySet<std::remove_cv_t<AttributeType> >>

◆ BaseArrayType

template<typename ElementIDType , typename AttributeType >
using TMeshAttributesRef< ElementIDType, AttributeType >::BaseArrayType = TCopyQualifiersFromTo_T<AttributeType, FMeshAttributeArraySetBase>

Constructor & Destructor Documentation

◆ TMeshAttributesRef() [1/4]

template<typename ElementIDType , typename AttributeType >
TMeshAttributesRef< ElementIDType, AttributeType >::TMeshAttributesRef ( BaseArrayType InArrayPtr = nullptr,
uint32  InExtent = 1 
)
inlineexplicit

Constructor taking a pointer to a FMeshAttributeArraySetBase

◆ TMeshAttributesRef() [2/4]

template<typename ElementIDType , typename AttributeType >
template<typename SrcAttributeType , typename DestAttributeType = AttributeType, typename TEnableIf< std::is_const_v< DestAttributeType >, int >::Type = 0, typename TEnableIf<!std::is_const_v< SrcAttributeType >, int >::Type = 0>
TMeshAttributesRef< ElementIDType, AttributeType >::TMeshAttributesRef ( const TMeshAttributesRef< ElementIDType, SrcAttributeType > &  InRef)
inline

Implicitly construct a TMeshAttributesRef-to-const from a regular one

◆ TMeshAttributesRef() [3/4]

template<typename ElementIDType , typename AttributeType >
template<typename IDType = ElementIDType, typename TEnableIf<!std::is_same_v< IDType, int32 >, int >::Type = 0>
TMeshAttributesRef< ElementIDType, AttributeType >::TMeshAttributesRef ( const TMeshAttributesRef< int32, AttributeType > &  InRef)
inline

Implicitly construct a TMeshAttributesRef from a TMeshAttributesArray

◆ TMeshAttributesRef() [4/4]

template<typename ElementIDType , typename AttributeType >
template<typename SrcAttributeType , typename DestAttributeType = AttributeType, typename IDType = ElementIDType, typename TEnableIf<!std::is_same_v< IDType, int32 >, int >::Type = 0, typename TEnableIf< std::is_const_v< DestAttributeType >, int >::Type = 0, typename TEnableIf<!std::is_const_v< SrcAttributeType >, int >::Type = 0>
TMeshAttributesRef< ElementIDType, AttributeType >::TMeshAttributesRef ( const TMeshAttributesRef< int32, SrcAttributeType > &  InRef)
inline

Implicitly construct a TMeshAttributesRef-to-const from a TMeshAttributesArray

Member Function Documentation

◆ Copy()

template<typename ElementIDType , typename AttributeType >
void TMeshAttributesRef< ElementIDType, AttributeType >::Copy ( TMeshAttributesRef< ElementIDType, const AttributeType >  Src,
const int32  DestChannel = 0,
const int32  SrcChannel = 0 
)

Copies the given attribute array and channel to this channel

◆ Get() [1/2]

template<typename ElementIDType , typename AttributeType >
template<typename T = ElementIDType, typename TEnableIf< TIsDerivedFrom< T, FElementID >::Value, int >::Type = 0>
AttributeType TMeshAttributesRef< ElementIDType, AttributeType >::Get ( const ElementIDType  ElementID,
const int32  Channel = 0 
) const
inline

Get the element with the given ID and channel

◆ Get() [2/2]

template<typename ElementIDType , typename AttributeType >
AttributeType TMeshAttributesRef< ElementIDType, AttributeType >::Get ( int32  ElementIndex,
const int32  Channel = 0 
) const
inline

◆ GetArrayView()

template<typename ElementIDType , typename AttributeType >
TArrayView< AttributeType > TMeshAttributesRef< ElementIDType, AttributeType >::GetArrayView ( int32  ElementIndex,
const int32  Channel = 0 
) const
inline

◆ GetDefaultValue()

template<typename ElementIDType , typename AttributeType >
AttributeType TMeshAttributesRef< ElementIDType, AttributeType >::GetDefaultValue ( ) const
inline

Return default value for this attribute type

◆ GetExtent()

template<typename ElementIDType , typename AttributeType >
uint32 TMeshAttributesRef< ElementIDType, AttributeType >::GetExtent ( ) const
inline

Get the extent for this attribute type

◆ GetFlags()

template<typename ElementIDType , typename AttributeType >
EMeshAttributeFlags TMeshAttributesRef< ElementIDType, AttributeType >::GetFlags ( ) const
inline

Get the flags for this attribute array set

◆ GetNumChannels()

template<typename ElementIDType , typename AttributeType >
int32 TMeshAttributesRef< ElementIDType, AttributeType >::GetNumChannels ( ) const
inline

Return number of indices this attribute has

◆ GetNumElements()

template<typename ElementIDType , typename AttributeType >
int32 TMeshAttributesRef< ElementIDType, AttributeType >::GetNumElements ( ) const
inline

Get the number of elements in this attribute array

◆ GetNumIndices()

template<typename ElementIDType , typename AttributeType >
int32 TMeshAttributesRef< ElementIDType, AttributeType >::GetNumIndices ( ) const
inline

◆ GetRawArray()

template<typename ElementIDType , typename AttributeType >
TArrayView< AttributeType > TMeshAttributesRef< ElementIDType, AttributeType >::GetRawArray ( const int32  AttributeChannel = 0) const
inline

◆ InsertChannel()

template<typename ElementIDType , typename AttributeType >
void TMeshAttributesRef< ElementIDType, AttributeType >::InsertChannel ( const int32  Channel) const
inline

Inserts an attribute channel

◆ InsertIndex()

template<typename ElementIDType , typename AttributeType >
void TMeshAttributesRef< ElementIDType, AttributeType >::InsertIndex ( const int32  Index) const
inline

◆ IsValid()

template<typename ElementIDType , typename AttributeType >
bool TMeshAttributesRef< ElementIDType, AttributeType >::IsValid ( ) const
inline

Return whether the reference is valid or not

◆ operator[]() [1/2]

template<typename ElementIDType , typename AttributeType >
template<typename T = ElementIDType, typename TEnableIf< TIsDerivedFrom< T, FElementID >::Value, int >::Type = 0>
AttributeType & TMeshAttributesRef< ElementIDType, AttributeType >::operator[] ( const ElementIDType  ElementID) const
inline

Access elements from attribute channel 0

◆ operator[]() [2/2]

template<typename ElementIDType , typename AttributeType >
AttributeType & TMeshAttributesRef< ElementIDType, AttributeType >::operator[] ( int32  ElementIndex) const
inline

◆ RemoveChannel()

template<typename ElementIDType , typename AttributeType >
void TMeshAttributesRef< ElementIDType, AttributeType >::RemoveChannel ( const int32  Channel) const
inline

Removes an attribute channel

◆ RemoveIndex()

template<typename ElementIDType , typename AttributeType >
void TMeshAttributesRef< ElementIDType, AttributeType >::RemoveIndex ( const int32  Index) const
inline

◆ Set() [1/4]

template<typename ElementIDType , typename AttributeType >
template<typename T = ElementIDType, typename TEnableIf< TIsDerivedFrom< T, FElementID >::Value, int >::Type = 0>
void TMeshAttributesRef< ElementIDType, AttributeType >::Set ( const ElementIDType  ElementID,
const AttributeType &  Value 
) const
inline

Set the element with the given ID and index 0 to the provided value

◆ Set() [2/4]

template<typename ElementIDType , typename AttributeType >
template<typename T = ElementIDType, typename TEnableIf< TIsDerivedFrom< T, FElementID >::Value, int >::Type = 0>
void TMeshAttributesRef< ElementIDType, AttributeType >::Set ( const ElementIDType  ElementID,
const int32  Channel,
const AttributeType &  Value 
) const
inline

Set the element with the given ID and channel to the provided value

◆ Set() [3/4]

template<typename ElementIDType , typename AttributeType >
void TMeshAttributesRef< ElementIDType, AttributeType >::Set ( int32  ElementIndex,
const AttributeType &  Value 
) const
inline

◆ Set() [4/4]

template<typename ElementIDType , typename AttributeType >
void TMeshAttributesRef< ElementIDType, AttributeType >::Set ( int32  ElementIndex,
const int32  Channel,
const AttributeType &  Value 
) const
inline

◆ SetArrayView() [1/2]

template<typename ElementIDType , typename AttributeType >
void TMeshAttributesRef< ElementIDType, AttributeType >::SetArrayView ( int32  ElementIndex,
const int32  Channel,
TArrayView< const AttributeType >  Value 
) const
inline

◆ SetArrayView() [2/2]

template<typename ElementIDType , typename AttributeType >
void TMeshAttributesRef< ElementIDType, AttributeType >::SetArrayView ( int32  ElementIndex,
TArrayView< const AttributeType >  Value 
) const
inline

◆ SetNumChannels()

template<typename ElementIDType , typename AttributeType >
void TMeshAttributesRef< ElementIDType, AttributeType >::SetNumChannels ( const int32  NumChannels) const
inline

Sets number of channels this attribute has

◆ SetNumIndices()

template<typename ElementIDType , typename AttributeType >
void TMeshAttributesRef< ElementIDType, AttributeType >::SetNumIndices ( const int32  NumChannels) const
inline

Friends And Related Symbol Documentation

◆ TMeshAttributesRef

template<typename ElementIDType , typename AttributeType >
template<typename T , typename U >
friend class TMeshAttributesRef
friend

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