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, Vector);
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;
};
PyCompilerFlags * flags
Definition: ast.h:14
Definition: c4d_file.h:1085
MAXON_METHOD Int32 GetIcon(Bool perPolyVertex) 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::Bool Bool
Definition: ge_sys_math.h:55
maxon::Int32 Int32
Definition: ge_sys_math.h:60
ComponentWithBase< C, ComponentRoot, INTERFACES... > Component
Definition: objectbase.h:2794
#define MAXON_COMPONENT(KIND,...)
Definition: objectbase.h:2212
#define MAXON_METHOD
Definition: interfacebase.h:1001
PyObject PyObject PyObject int level
Definition: import.h:58
#define MAXON_CUSTOMDATATAG(pluginID, name, resurceID, displayID, level, floatValueCount, flags, attributeType)
Definition: mesh_attribute_base.h:260

Public Member Functions

MAXON_METHOD Int32 GetTagPluginId () const
 
MAXON_METHOD const StringGetTagPluginName () const
 
MAXON_METHOD const 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
 
MAXON_FUNCTION const 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()

MAXON_METHOD const 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()

MAXON_METHOD const 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()

MAXON_FUNCTION const 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.