CustomDataTagClassInterface Class Reference

#include <mesh_attribute_base.h>

Inheritance diagram for CustomDataTagClassInterface:

Detailed Description

CustomDataTagClassInterface uses MeshAttributeClassInterface as a base interface and allows to add informations and functionality to the mesh attribute to be used as tag. It mainly contains the information about the CustomDataTag registration, read/write, icons and the optional display implementation. By using the MAXON_CUSTOMDATATAG macro, only the Read, Write and GetIcon methods need to be implemented.

class VertexColorImpl : public Component<VertexColorImpl, CustomDataTagClassInterface>
{
MAXON_CUSTOMDATATAG(ID_CUSTOMDATA_TAG_VC, "Vertex Color Tag"_s, ""_s, Id("net.maxon.mesh_misc.meshattibutedisplay.vertxecolor"), 0, 1, flags);
public:
...
MAXON_METHOD Result<void> Read(void* data, HyperFile* hf, Int32 level) const;
MAXON_METHOD Result<void> Write(const void* data, HyperFile* hf) const;
MAXON_METHOD Int32 GetIcon(Bool perPolyVertex) const;
};

Public Member Functions

MAXON_METHOD Int32 GetTagPluginId () const
 
const MAXON_METHOD StringGetTagPluginName () const
 
const MAXON_METHOD StringGetResourceId () const
 
MAXON_METHOD Int32 GetTagPluginLevel () const
 
MAXON_METHOD Id GetDisplayClassId () const
 
MAXON_METHOD Bool IsSdsCompatible (Int32 &floatSize) const
 
MAXON_METHOD Result< void > Read (void *data, HyperFile *hf, Int32 level) const
 
MAXON_METHOD Result< void > Write (const void *data, HyperFile *hf) const
 
MAXON_METHOD Int32 GetIcon (Bool perPolyVertex) const
 
const MAXON_FUNCTION StringGetDefaultResourceId () const
 
MAXON_METHOD Int32 GetTagPluginFlags () const
 
MAXON_METHOD Bool Message (GeListNode *node, Int32 type, void *data) const
 

Member Function Documentation

◆ GetTagPluginId()

MAXON_METHOD Int32 GetTagPluginId ( ) const

Returns the Tag plugin ID to be registered with this implementation.

Returns
A unique plugin ID.

◆ GetTagPluginName()

const MAXON_METHOD String& GetTagPluginName ( ) const

Returns the Tag string name to be registered with this implementation.

Returns
A string that represent the tag in the interface.

◆ GetResourceId()

const MAXON_METHOD String& GetResourceId ( ) const

Returns the resource id for the Tag.

Returns
A string that represent the tag res ID.

◆ GetTagPluginLevel()

MAXON_METHOD Int32 GetTagPluginLevel ( ) const

Returns the Tag level to be used as data versioning system.

Returns
The disk level.

◆ GetDisplayClassId()

MAXON_METHOD Id GetDisplayClassId ( ) const

Get the Id of the display implementation or an empty Id if display is not implemented.

Returns
The id of the associated display implementation.

◆ IsSdsCompatible()

MAXON_METHOD Bool IsSdsCompatible ( Int32 floatSize) const

Returns if the datatype is compatible with the SDS interpolation. SDS implementations, both internal and OSD, are only able to interpolate float values. The floatSize allows to define how many values are used for each entry, for example a vector will have a floatSize = 3.

Parameters
[out]floatSizeThe number of float values that the datatype contains.
Returns
True if this interface can be processed for SDS interpolations.

◆ Read()

MAXON_METHOD Result<void> Read ( void *  data,
HyperFile hf,
Int32  level 
) const

Reads a single data entry from a file.

Parameters
[in]dataThe data pointer.
[in]hfThe file handle to read.
[in]levelThe disk level.
Returns
OK on success.

◆ Write()

MAXON_METHOD Result<void> Write ( const void *  data,
HyperFile hf 
) const

Writes a single data entry to a fil.

Parameters
[in]dataThe data pointer.
[in]hfThe file handle to write on.
Returns
OK on success.

◆ GetIcon()

MAXON_METHOD Int32 GetIcon ( Bool  perPolyVertex) const

Gets the icon id according to the data location (per vertex vs. per polyvertex).

Parameters
[in]perPolyVertexIf true the polyvertex icon id is returned.
Returns
The icon id or NOTOK if there is no icon.

◆ GetDefaultResourceId()

const MAXON_FUNCTION String& GetDefaultResourceId ( ) const

By default, all implementations provide a standard UI. Gets the default resource id in case a custom AM UI is not needed.

Returns
The description string identifier.

◆ GetTagPluginFlags()

MAXON_METHOD Int32 GetTagPluginFlags ( ) const

Returns the tag flags to be registered with this implementation.

Returns
The tag flgas.

◆ Message()

MAXON_METHOD Bool Message ( GeListNode node,
Int32  type,
void *  data 
) const

Implements custom mesage for the custom data tag.

Parameters
[in]nodeThe node.
[in]typeThe message type.
[in]dataThe message data.
Returns
True on success.
MAXON_COMPONENT
#define MAXON_COMPONENT(KIND,...)
Definition: objectbase.h:2014
maxon::CustomDataTagClassInterface::GetIcon
MAXON_METHOD Int32 GetIcon(Bool perPolyVertex) const
maxon::CustomDataTagClassInterface::Read
MAXON_METHOD Result< void > Read(void *data, HyperFile *hf, Int32 level) const
MAXON_METHOD
#define MAXON_METHOD
Definition: interfacebase.h:845
Int32
maxon::Int32 Int32
Definition: ge_sys_math.h:45
HyperFile
Definition: c4d_file.h:1057
MAXON_CUSTOMDATATAG
#define MAXON_CUSTOMDATATAG(pluginID, name, resurceID, displayID, level, floatValueCount, flags)
Definition: mesh_attribute_base.h:254
maxon::CustomDataTagClassInterface::Write
MAXON_METHOD Result< void > Write(const void *data, HyperFile *hf) const
Bool
maxon::Bool Bool
Definition: ge_sys_math.h:40
maxon::Component
ComponentWithBase< C, ComponentRoot, INTERFACES... > Component
Definition: objectbase.h:2556