CustomDataTag Class Reference

#include <lib_customdatatag.h>

Inheritance diagram for CustomDataTag:

详细描述

CustomDataTag contains data attached to each mesh vertex or each polyvertex. The CustomDataTag is automatically registered by implementing CustomDataTagClassInterface. While each CustomDataTagClassInterface implementation registers a specific CustomdataTag whith the provided plugin id (returned by BaseTag::GetType() ) all CustomDataTags are instances of Tmeshattribute. In the case of polyvertex data storage the indexing follows the CPolygon pattern.

公共成员函数

maxon::Result < void >  InitData ()
maxon::Result < maxon::CustomDataTagClass >  GetCustomDataTagClass () const
maxon::Result < maxon::DataType GetDataType () const
CUSTOMDATATAG_MODE   GetMode () const
void  SetMode ( CUSTOMDATATAG_MODE mode)
maxon::Result < void >  Resize ( Int newCount)
Int   GetComponentCount () const
const void *  GetConstVertexDataPtr ( Int32 vertexIndex) const
void *  GetVertexDataPtr ( Int32 vertexIndex)
void  SetVertexDataPtr (void *data, Int32 vertexIndex)
const void *  GetConstPolyVertexDataPtr ( Int32 polygonIndex, Int32 polyVertexIndex) const
void *  GetPolyVertexDataPtr ( Int32 polygonIndex, Int32 polyVertexIndex)
void  SetPolyVertexDataPtr (const void *data, Int32 polygonIndex, Int32 polyVertexIndex)
const maxon::PolyData < const void * >  GetConstPolygonDataPtr ( Int32 polygonIndex) const
maxon::PolyData < void * >  GetPolygonDataPtr ( Int32 polygonIndex)
void  SetPolygonDataPtr ( maxon::PolyData < void * > data, Int32 polygonIndex)
maxon::MeshAttribute   GetVertexAttribute ( Int32 vertexIndex)
void  SetVertexAttribute (const maxon::MeshAttribute &data, Int32 vertexIndex)
maxon::MeshAttribute   GetPolyVertexAttribute ( Int32 polygonIndex, Int32 polyVertexIndex)
void  SetPolyVertexAttribute (const maxon::MeshAttribute &data, Int32 polygonIndex, Int32 polyVertexIndex)
maxon::PolyData < maxon::MeshAttribute GetPolygonAttribute ( Int32 polygonIndex)
void  SetPolygonAttribute ( maxon::PolyData < maxon::MeshAttribute > data, Int32 polygonIndex)
maxon::Result < void >  DisplayControl ( BaseDocument *doc, BaseObject *op, BaseDraw *bd, BaseDrawHelp *bh, ControlDisplayStruct &cds) const
maxon::Result < void >  InitDisplayControl ( BaseDocument *doc, BaseDraw *bd, const AtomArray *active)
void  FreeDisplayControl ()
template<typename TYPE >
const TYPE GetVertexData ( Int32 vertexIndex) const
template<typename TYPE >
maxon::ResultRef < TYPE GetVertexDataRef ( Int32 vertexIndex)
template<typename TYPE >
void  SetVertexData ( Int32 vertexIndex, TYPE &&value)
template<typename TYPE >
const TYPE GetPolyVertexData ( Int32 polygonIndex, Int32 polyVertexIndex) const
template<typename TYPE >
maxon::ResultRef < TYPE GetPolyVertexDataRef ( Int32 polygonIndex, Int32 polyVertexIndex)
template<typename TYPE >
void  SetPolyVertexData ( Int32 polygonIndex, Int32 polyVertexIndex, TYPE &&value)
template<typename TYPE >
const maxon::PolyData < TYPE > &  GetPolygonData ( Int32 polygonIndex) const
template<typename TYPE >
maxon::Result < maxon::PolyData < TYPE & > >  GetPolygonDataRef ( Int32 polygonIndex)
template<typename TYPE >
void  SetPolygonData ( Int32 polygonIndex, maxon::PolyData < TYPE > &&value)
-  Public Member Functions inherited from BaseTag
Bool   Draw ( BaseObject *op, BaseDraw *bd, BaseDrawHelp *bh)
BaseTag GetNext (void)
BaseTag GetPred (void)
BaseObject GetObject (void)
BaseTag GetOrigin ()
-  Public Member Functions inherited from BaseList2D
const Char GetViewportRenderId ( VIEWPORT_RENDER_ID typeId) const
BaseList2D GetNext ()
BaseList2D GetPred ()
void  SetBit ( Int32 mask)
Bool   GetBit ( Int32 mask) const
void  DelBit ( Int32 mask)
void  ToggleBit ( Int32 mask)
Int32   GetAllBits () const
void  SetAllBits ( Int32 bits)
void  SetBitEx ( Int32 mask, Int32 flags)
BaseContainer   GetData ()
void  SetData (const BaseContainer &bc, Bool add=true)
const BaseContainer GetDataInstance () const
BaseContainer GetDataInstance ()
const BaseContainer GetDataInstanceRef () const
BaseContainer GetDataInstanceRef ()
String   GetName () const
void  SetName (const maxon::String &name)
String   GetBubbleHelp ()
Bool   TransferGoal ( BaseList2D *dst, Bool undolink)
Bool   TransferMarker ( BaseList2D *dst) const
Bool   比例 ( Float scale)
Bool   编辑 ()
void  GetIcon ( IconData *dat)
GeListHead GetNLARoot ()
BaseList2D AnimationLayerRemap ( BaseObject **layer=nullptr)
String   GetTypeName ()
BaseList2D GetMain () const
void  InsertTrackSorted ( CTrack *track)
Bool   AddEventNotification ( BaseList2D *bl, NOTIFY_EVENT eventid, NOTIFY_EVENT_FLAG flags, const BaseContainer *data)
Bool   RemoveEventNotification ( BaseDocument *doc, BaseList2D *bl, NOTIFY_EVENT eventid)
Bool   FindEventNotification ( BaseDocument *doc, BaseList2D *bl, NOTIFY_EVENT eventid)
Bool   SetDescIDState (const DescID &id, DESCIDSTATE descidstate)
DESCIDSTATE   GetDescIDState (const DescID &id, Bool tolerant) const
GeListHead GetOverrideRoot ()
BaseOverride GetFirstOverride ()
GeListHead GetShaderRepositoryRoot ()
GeListHead GetHiddenShaderRoot ()
maxon::NimbusInterface *  GetNimbusRef (const maxon::Id &spaceId) const
maxon::Result < maxon::NimbusInterface * >  GetOrCreateNimbusRef (const maxon::Id &spaceId)
void  RemoveNimbusRef (const maxon::Id &spaceId)
maxon::Result < maxon::HashMap < maxon::Id , maxon::ForwardRef < maxon::NimbusRef > > >  GetAllNimbusRefs () const
Bool   IsNodeBased () const
void  GetMarkerStampEx ( UInt32 *l1, UInt32 *l2)
const GeMarker GetMarker () const
void  SetMarker (const GeMarker &m)
Bool   AddUniqueID ( Int32 appid, const Char *const mem, Int bytes)
Bool   FindUniqueID ( Int32 appid, const Char *&mem, Int &bytes) const
Int32   GetUniqueIDCount () const
Bool   GetUniqueIDIndex ( Int32 idx, Int32 &id, const Char *&mem, Int &bytes) const
Bool   SetAnimatedParameter ( CTrack *track, const DescID &id, const GeData &t_data1, const GeData &t_data2, Float mix, DESCFLAGS_SET flags)
Bool   GetAnimatedParameter (const DescID &id, GeData &t_data1, GeData &t_data2, Float &mix, DESCFLAGS_GET flags)
BaseShader GetFirstShader () const
void  InsertShader ( BaseShader *shader, BaseShader *pred=nullptr)
void  ClearKeyframeSelection ()
Bool   FindKeyframeSelection (const DescID &id)
Bool   SetKeyframeSelection (const DescID &id, Bool selection)
Bool   KeyframeSelectionContent ()
LayerObject GetLayerObject ( BaseDocument *doc)
Bool   SetLayerObject ( LayerObject *layer)
const LayerData GetLayerData ( BaseDocument *doc, Bool rawdata=false)
Bool   SetLayerData ( BaseDocument *doc, const LayerData &data)
GeListHead GetCTrackRoot ()
CTrack GetFirstCTrack ()
CTrack FindCTrack (const DescID &id)
-  Public Member Functions inherited from GeListNode
GeListNode GetNext ()
GeListNode GetPred ()
GeListNode GetDown ()
GeListNode GetUp ()
GeListNode GetDownLast ()
void  InsertBefore ( GeListNode *bl)
void  InsertAfter ( GeListNode *bl)
void  InsertUnder ( GeListNode *bl)
void  InsertUnderLast ( GeListNode *bl)
void  移除 ()
GeListHead GetListHead ()
Int32   GetNodeID ( Int32 index=0) const
template<typename CAST >
const CAST *  GetNodeData ( Int32 index=0) const
template<typename CAST >
CAST *  GetNodeData ( Int32 index=0)
void  SetCustomData ( GeListNode *node)
GeListNode GetCustomData ()
BaseDocument GetDocument ()
Int32   GetBranchInfo ( BranchInfo *info, Int32 max, GETBRANCHINFO flags)
Bool   IsDocumentRelated ()
Int32   GetInfo ()
Bool   GetNBit ( NBIT bit) const
UInt32   GetNBitMask ( Int32 index) const
Bool   ChangeNBit ( NBIT bit, NBITCONTROL bitmode)
-  Public Member Functions inherited from C4DAtom
Int32   GetType () const
Int32   GetRealType () const
Int32   GetDiskType () const
Bool   IsInstanceOf ( Int32 id) const
Int32   GetClassification () const
Bool   消息 ( Int32 type, void *data=nullptr)
Bool   MultiMessage ( MULTIMSG_ROUTE flags, Int32 type, void *data)
C4DAtom GetClone ( COPYFLAGS flags, AliasTrans *trn)
Bool   CopyTo ( C4DAtom *dst, COPYFLAGS flags, AliasTrans *trn)
Bool   读取 ( HyperFile *hf, Int32 id, Int32 level)
Bool   Write ( HyperFile *hf)
Bool   ReadObject ( HyperFile *hf, Bool readheader)
Bool   WriteObject ( HyperFile *hf)
Bool   GetDescription ( 描述 *description, DESCFLAGS_DESC flags)
Bool   GetParameter (const DescID &id, GeData &t_data, DESCFLAGS_GET flags)
Bool   SetParameter (const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
DynamicDescription GetDynamicDescription ()
Bool   GetEnabling (const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc)
Bool   TranslateDescID (const DescID &id, DescID &res_id, C4DAtom *&res_at)
UInt32   GetDirty ( DIRTYFLAGS flags) const
void  SetDirty ( DIRTYFLAGS flags)
UInt32   GetHDirty ( HDIRTYFLAGS mask) const
void  SetHDirty ( HDIRTYFLAGS mask)

静态公共成员函数

static CustomDataTag Alloc ( Int32 tagId)
static void  Free ( CustomDataTag *&tag)
-  Static Public Member Functions inherited from BaseTag
static BaseTag Alloc ( Int32 type)
static void  Free ( BaseTag *&bl)
-  Static Public Member Functions inherited from BaseList2D
static BaseList2D Alloc ( Int32 type)
static void  Free ( BaseList2D *&bl)

私有成员函数

  CustomDataTag ()
  ~CustomDataTag ()

Additional Inherited Members

-  Static Public Attributes inherited from BaseList2D
static const Int32   SETBIT_FLAG_NODIRTY
static const Int32   SETBIT_FLAG_REMOVE

构造函数 & 析构函数文档编制

◆  CustomDataTag()

CustomDataTag () private

◆  ~CustomDataTag()

~ CustomDataTag () private

成员函数文档编制

◆  Alloc()

static CustomDataTag * Alloc ( Int32   tagId )
static

Allocates a new instance of a specific type of CustomDataTag .

参数
[in] tagId The plugin id for the new instance.
返回
A new CustomDataTag pointer.

◆  Free()

static void Free ( CustomDataTag *&  tag )
static

Destroys a CustomDataTag instance and frees all resources.

参数
[in,out] tag The tag to destroy.

◆  InitData()

maxon::Result <void> InitData ( )

Initializes the data with the correct component count based on the mesh vertex or PolygonCount. Must be called after BaseObject::InsertTag() .

返回
OK on success.

◆  GetCustomDataTagClass()

maxon::Result <maxon::CustomDataTagClass> GetCustomDataTagClass ( ) const

Returns a reference to the underlying CustomDataTagClass.

返回
MeshAttributeClass reference or an error.

◆  GetDataType()

maxon::Result < maxon::DataType > GetDataType ( ) const

Returns a pointer to the datatype used by the CustomDataTag .

返回
The dataType pointer or an error.

◆  GetMode()

CUSTOMDATATAG_MODE GetMode ( ) const

Returns the component mode, i.e. if it is attached to mesh vertices or to mesh polyvertices.

返回
The current mode.

◆  SetMode()

void SetMode ( CUSTOMDATATAG_MODE   mode )

Sets the component mode and translates existing data (e.g. from CUSTOMDATATAG_MODE::POLYVERTEX to CUSTOMDATATAG_MODE::VERTEX each vertex will receive the average value of all attached polyvertices)

参数
[in] mode The new CUSTOMDATATAG_MODE.

◆  Resize()

maxon::Result <void> Resize ( Int   newCount )

Resizes the data count.

参数
[in] newCount The new data count.
返回
OK on success.

◆  GetComponentCount()

Int GetComponentCount ( ) const

Gets the component count.

返回
The data count.

◆  GetConstVertexDataPtr()

const void* GetConstVertexDataPtr ( Int32   vertexIndex ) const

Gets a read-only pointer to the data at the passed vertex index. Must be called only if GetMode() == CUSTOMDATATAG_MODE::VERTEX .

参数
[in] vertexIndex The vertex index.
返回
A read-only pointer to the data at vertexIndex.

◆  GetVertexDataPtr()

void* GetVertexDataPtr ( Int32   vertexIndex )

Gets a writable pointer to the data at the passed vertex index. Must be called only if GetMode() == CUSTOMDATATAG_MODE::VERTEX .

参数
[in] vertexIndex The vertex index.
返回
A writable pointer to the data at vertexIndex.

◆  SetVertexDataPtr()

void SetVertexDataPtr ( void *  data ,
Int32   vertexIndex  
)

Sets data at vertexIndex. Must be called only if GetMode() == CUSTOMDATATAG_MODE::VERTEX . Data is copied.

参数
[in] data A pointer to the original data.
[in] vertexIndex The vertex index.

◆  GetConstPolyVertexDataPtr()

const void* GetConstPolyVertexDataPtr ( Int32   polygonIndex ,
Int32   polyVertexIndex  
) const

Gets a read-only pointer to the data at the passed polyVertexIndex in polygonIndex. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX .

参数
[in] polygonIndex The polygon index.
[in] polyVertexIndex The polygon vertex index in range 0 to 3.
返回
A read-only pointer to the data at polyVertexIndex in polygonIndex.

◆  GetPolyVertexDataPtr()

void* GetPolyVertexDataPtr ( Int32   polygonIndex ,
Int32   polyVertexIndex  
)

Gets a writable pointer to the data at the passed polyVertexIndex in polygonIndex. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX .

参数
[in] polygonIndex The polygon index.
[in] polyVertexIndex The polygon vertex index in range 0 to 3.
返回
A writable pointer to the data at polyVertexIndex in polygonIndex.

◆  SetPolyVertexDataPtr()

void SetPolyVertexDataPtr ( const void *  data ,
Int32   polygonIndex ,
Int32   polyVertexIndex  
)

Sets data at polyVertexIndex in polygonIndex. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX . Data is copied.

参数
[in] data A pointer to the original data.
[in] polygonIndex The polygon index.
[in] polyVertexIndex The polygon vertex index in range 0 to 3.

◆  GetConstPolygonDataPtr()

const maxon::PolyData <const void*> GetConstPolygonDataPtr ( Int32   polygonIndex ) const

Retrieves read-only PolyData pointers to the data at the passed polygonIndex. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX .

参数
[in] polygonIndex The polygon index.
返回
A PolyData that contains read-only pointers.

◆  GetPolygonDataPtr()

maxon::PolyData <void*> GetPolygonDataPtr ( Int32   polygonIndex )

Retrieves writable PolyData pointers to the data at the passed polygonIndex. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX .

参数
[in] polygonIndex The polygon index.
返回
A PolyData that contains writable pointers.

◆  SetPolygonDataPtr()

void SetPolygonDataPtr ( maxon::PolyData < void * >  data ,
Int32   polygonIndex  
)

Sets data for a polygon. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX . Data is copied.

参数
[in] data A PolyData that contains to the original data.
[in] polygonIndex The polygon index.

◆  GetVertexAttribute()

maxon::MeshAttribute GetVertexAttribute ( Int32   vertexIndex )

Gets a writable MeshAttribute at the passed vertex index. Must be called only if GetMode() == CUSTOMDATATAG_MODE::VERTEX .

参数
[in] vertexIndex The vertex index.
返回
A writable MeshAttribute at vertexIndex.

◆  SetVertexAttribute()

void SetVertexAttribute ( const maxon::MeshAttribute data ,
Int32   vertexIndex  
)

Sets MeshAttribute at vertexIndex. Must be called only if GetMode() == CUSTOMDATATAG_MODE::VERTEX . Data is copied.

参数
[in] data A MeshAttribute which contains the original data.
[in] vertexIndex The vertex index.

◆  GetPolyVertexAttribute()

maxon::MeshAttribute GetPolyVertexAttribute ( Int32   polygonIndex ,
Int32   polyVertexIndex  
)

Gets a writable MeshAttribute to the data at the passed polyVertexIndex in polygonIndex. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX .

参数
[in] polygonIndex The polygon index.
[in] polyVertexIndex The polygon vertex index in range 0 to 3.
返回
A writable MeshAttribute at polyVertexIndex in polygonIndex.

◆  SetPolyVertexAttribute()

void SetPolyVertexAttribute ( const maxon::MeshAttribute data ,
Int32   polygonIndex ,
Int32   polyVertexIndex  
)

Sets MeshAttribute at polyVertexIndex in polygonIndex. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX . Data is copied.

参数
[in] data A MeshAttribute which contains the original data.
[in] polygonIndex The polygon index.
[in] polyVertexIndex The polygon vertex index in range 0 to 3.

◆  GetPolygonAttribute()

maxon::PolyData < maxon::MeshAttribute > GetPolygonAttribute ( Int32   polygonIndex )

Retrieves writable PolyData of MeshAttributes at the passed polygonIndex. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX .

参数
[in] polygonIndex The polygon index.
返回
A writable PolyData of MeshAttributes.

◆  SetPolygonAttribute()

void SetPolygonAttribute ( maxon::PolyData < maxon::MeshAttribute data ,
Int32   polygonIndex  
)

Sets MeshAttribute data for a polygon. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX . Data is copied.

参数
[in] data A PolyData of MeshAttribute which contains the original data.
[in] polygonIndex The polygon index.

◆  DisplayControl()

maxon::Result <void> DisplayControl ( BaseDocument doc ,
BaseObject op ,
BaseDraw bd ,
BaseDrawHelp bh ,
ControlDisplayStruct cds  
) const

Private .

◆  InitDisplayControl()

maxon::Result <void> InitDisplayControl ( BaseDocument doc ,
BaseDraw bd ,
const AtomArray active  
)

Private .

◆  FreeDisplayControl()

void FreeDisplayControl ( )

Private .

◆  GetVertexData()

const TYPE & GetVertexData ( Int32   vertexIndex ) const

Gets a read-only data reference for the given index. The specified type must match, otherwise this will crash. Must be called only if GetMode() == CUSTOMDATATAG_MODE::VERTEX .

Template Parameters
TYPE The type that will be returned.
参数
[in] vertexIndex The vertex index.
返回
Reference to the data at vertexIndex.

◆  GetVertexDataRef()

maxon::ResultRef < TYPE > GetVertexDataRef ( Int32   vertexIndex )

Gets a writable data reference for the given index. The specified type must match, otherwise this will crash. Must be called only if GetMode() == CUSTOMDATATAG_MODE::VERTEX .

Template Parameters
TYPE The type that will be returned.
参数
[in] vertexIndex The vertex index.
返回
Reference to the data at vertexIndex.

◆  SetVertexData()

void SetVertexData ( Int32   vertexIndex ,
TYPE &&  value  
)

Sets a data value at vertexIndex. The operation always succeeds as the datatype either needs to be trivially copyable or support move semantics. Must be called only if GetMode() == CUSTOMDATATAG_MODE::VERTEX .

Template Parameters
TYPE The type that will be set.
参数
[in] vertexIndex The vertex index.
[in] value The new data value.

◆  GetPolyVertexData()

const TYPE & GetPolyVertexData ( Int32   polygonIndex ,
Int32   polyVertexIndex  
) const

Gets a read-only data reference for the given polygonIndex and polyVertexIndex. The specified type must match, otherwise this will crash. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX .

Template Parameters
TYPE The type that will be returned.
参数
[in] polygonIndex The polygon index.
[in] polyVertexIndex The polygon vertex index in range 0 to 3.
返回
Reference to the data at polyVertexIndex in polygonIndex.

◆  GetPolyVertexDataRef()

maxon::ResultRef < TYPE > GetPolyVertexDataRef ( Int32   polygonIndex ,
Int32   polyVertexIndex  
)

Gets a writable data reference for the given polygonIndex and polyVertexIndex. The specified type must match, otherwise this will crash. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX .

Template Parameters
TYPE The type that will be returned.
参数
[in] polygonIndex The polygon index.
[in] polyVertexIndex The polygon vertex index in range 0 to 3.
返回
Reference to the data at polyVertexIndex in polygonIndex.

◆  SetPolyVertexData()

void SetPolyVertexData ( Int32   polygonIndex ,
Int32   polyVertexIndex ,
TYPE &&  value  
)

Sets a data value for a given polygonIndex and polyVertexIndex. The operation always succeeds as the datatype either needs to be trivially copyable or support move semantics. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX .

Template Parameters
TYPE The type that will be set.
参数
[in] polygonIndex The polygon index.
[in] polyVertexIndex The polygon vertex index in range 0 to 3.
[in] value The new data value.

◆  GetPolygonData()

const maxon::PolyData < TYPE >& GetPolygonData ( Int32   polygonIndex ) const

Gets a read-only PolyData data reference for the given polygonIndex. The specified type must match, otherwise this will crash. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX .

Template Parameters
TYPE The type that will be returned.
参数
[in] polygonIndex The polygon index.
返回
Reference to the PolyData at polygonIndex.

◆  GetPolygonDataRef()

maxon::Result < maxon::PolyData < TYPE &> > GetPolygonDataRef ( Int32   polygonIndex )

Gets a writable PolyData data reference for the given polygonIndex. The specified type must match, otherwise this will crash. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX .

Template Parameters
TYPE The type that will be returned.
参数
[in] polygonIndex The polygon index.
返回
Reference to the PolyData at polygonIndex.

◆  SetPolygonData()

void SetPolygonData ( Int32   polygonIndex ,
maxon::PolyData < TYPE > &&  value  
)

Sets a polygon data value. The operation always succeeds as the datatype either needs to be trivially copyable or support move semantics. Must be called only if GetMode() == CUSTOMDATATAG_MODE::POLYVERTEX .

Template Parameters
TYPE The type that will be set.
参数
[in] polygonIndex The polygon index.
[in] value The new data values.