C4DAtom Class Reference

#include <c4d_baselist.h>

Inheritance diagram for C4DAtom:

详细描述

The base class of many classes within the API.
Represents an object that can be read from and written to disk, copied and that has a description for the Attribute Manager.

另请参阅
AtomArray

私有成员函数

  C4DAtom ()
  ~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)

Read/Write

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)

Dirty Flags

UInt32   GetDirty ( DIRTYFLAGS flags) const
void  SetDirty ( DIRTYFLAGS flags)
UInt32   GetHDirty ( HDIRTYFLAGS mask) const
void  SetHDirty ( HDIRTYFLAGS mask)

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

◆  C4DAtom()

C4DAtom () private

◆  ~C4DAtom()

~ C4DAtom () private

成员函数文档编制

◆  GetType()

Int32 GetType ( ) const

Gets the type of the atom.

警告
This must be used to make sure that the derived object is really of the right type before casting it and accessing its members.
注意
Plugin nodes return their unique plugin IDs.
返回
The type, for example Ocube .

◆  GetRealType()

Int32 GetRealType ( ) const

Gets the real type of the atom. This is similar to GetType() , but for multinodes the ID of the last linked part is returned.
E.g. XPresso nodes have the type ID_GV_GROUPDATA or ID_GV_NODEDATA but GetRealType() returns the ID of the operator.

返回
The type, for example Ocube .

◆  GetDiskType()

Int32 GetDiskType ( ) const

Gets the atoms unique disk type ID.

注意
Normally this is the same as GetType() but there are exceptions.
返回
The type, for example Ocube .

◆  IsInstanceOf()

Bool IsInstanceOf ( Int32   id ) const

Checks if the atom is an instance of a base type.

注意
To check if an object is a spline, check BaseList2D::GetInfo() & OBJECT_ISSPLINE instead.
Be aware that generators like the Cloner or Alembic objects have the flag OBJECT_ISSPLINE set at registration, but calling ToSpline() would not return a valid SplineObject .
In the case of an Alembic generator representing a spline, get the cache and check the type of it.
参数
[in] id The base type ID, for example Obase .
返回
true if the atom is an instance of the given type id , otherwise false .

◆  GetClassification()

Int32 GetClassification ( ) const

Returns the base type of the atom; e.g. Obase for objects, Tbase for tags etc.

返回
The base type.

◆  Message()

Bool 消息 ( Int32   type ,
void *  data = nullptr  
)

Sends a message to the atom only.

注意
Some notification messages are automatically passed along to branches: MSG_POINTS_CHANGED , MSG_POLYGONS_CHANGED and MSG_SEGMENTS_CHANGED.
This is for convenience and historical reasons.
参数
[in] type The message type, one of the following: MSG
[in,out] data The message data. The sender owns the pointed data.
返回
Depends on the message type .

◆  MultiMessage()

Bool MultiMessage ( MULTIMSG_ROUTE   flags ,
Int32   type ,
void *  data  
)

Sends a message to the atom and to its children, parents or branches, depending on flags .

参数
[in] flags A combination of the following flags: MULTIMSG_ROUTE
[in] type The message type, one of the following types: MSG
[in,out] data The message data. The sender owns the pointed data.
返回
Depends on the message type .

◆  GetClone()

C4DAtom * GetClone ( COPYFLAGS   flags ,
AliasTrans trn  
)

Retrieves a copy of the atom.

参数
[in] flags Flags for the clone: COPYFLAGS
[in] trn An alias translator for the operation. Can be nullptr . The caller owns the pointed object.
返回
The cloned atom. The caller owns the pointed object.

◆  CopyTo()

Bool CopyTo ( C4DAtom dst ,
COPYFLAGS   flags ,
AliasTrans trn  
)

Copies all values from *this to *dst .

警告
The atoms must be of the same type.
参数
[out] dst The destination. The caller owns the pointed object.
[in] flags Flags for the copy: COPYFLAGS
[in] trn An alias translator for the operation. Can be nullptr . The caller owns the pointed object.
返回
true if the atom was copied, otherwise false .

◆  Read()

Bool 读取 ( HyperFile hf ,
Int32   id ,
Int32   level  
)

Reads the atom from a HyperFile , manually specifying id and disk level .

注意
This is the function to use if the hyper has been opened manually and the object is read separately. If reading within a plugin function where Cinema 4D has passed the hyper file use ReadObject() .
Read() , Write() , ReadObject() and WriteObject() are generally not recommended for plugins.
参数
[in] hf The hyper file to read from. The caller owns the pointed object.
[in] id The ID of the atom to read.
[in] level The disk level of the atom to read.
返回
true if the atom was read, otherwise false .

◆  Write()

Bool Write ( HyperFile hf )

Writes the atom to a HyperFile .

注意
This is the function to use if the hyper has been opened manually and the object is written separately. If writing within a plugin function where Cinema 4D has passed the hyper file use WriteObject() .
警告
Read() , Write() , ReadObject() and WriteObject() are generally not recommended for plugins.
参数
[in] hf The hyper file to write to. The caller owns the pointed object.
返回
true if the atom was written, otherwise false .

◆  ReadObject()

Bool ReadObject ( HyperFile hf ,
Bool   readheader  
)

Reads the atom from a HyperFile within another read operation.

注意
This is the function to use where Cinema 4D has passed the hyper file, for example in a plugin hook. Otherwise use Read() .
警告
Read() , Write() , ReadObject() and WriteObject() are generally not recommended for plugins.
参数
[in] hf The hyper file to read from. The caller owns the pointed object.
[in] readheader Normally true . Should only be false if the file header is manually read.
返回
true if the atom was read, otherwise false .

◆  WriteObject()

Bool WriteObject ( HyperFile hf )

Writes the atom to a HyperFile , within another write operation.

注意
This is the function to use where Cinema 4D has passed the hyper file, for example in a plugin hook. Otherwise use Write() .
警告
Read() , Write() , ReadObject() and WriteObject() are generally not recommended for plugins.
参数
[in] hf The hyper file to write to. The caller owns the pointed object.
返回
true if the atom was written, otherwise false .

◆  GetDescription()

Bool GetDescription ( 描述 description ,
DESCFLAGS_DESC   flags  
)

Gets the description for the atom.

参数
[out] description Filled with the atom's description. The caller owns the pointed object.
[in] flags Flags: DESCFLAGS_DESC
返回
true if the description was retrieved, otherwise false .

◆  GetParameter()

Bool GetParameter ( const DescID id ,
GeData t_data ,
DESCFLAGS_GET   flags  
)

Gets a parameter of the atom.

参数
[in] id The ID of the parameter.
[out] t_data Assigned the parameter's data.
[in] flags Flags: DESCFLAGS_GET
返回
true if the parameter was retrieved, otherwise false .

◆  SetParameter()

Bool SetParameter ( const DescID id ,
const GeData t_data ,
DESCFLAGS_SET   flags  
)

Sets a parameter of the atom.

参数
[in] id The ID of the parameter.
[in] t_data The data to set.
[in] flags Flags: DESCFLAGS_SET
返回
true if the parameter was set, otherwise false .

◆  GetDynamicDescription()

DynamicDescription * GetDynamicDescription ( )

Gets the dynamic description of the atom. (Also known as the user data part of the Attribute Manager.)

返回
The dynamic description. The atom owns the pointed object.

◆  GetEnabling()

Bool GetEnabling ( const DescID id ,
const GeData t_data ,
DESCFLAGS_ENABLE   flags ,
const BaseContainer itemdesc  
)

Checks if a description parameter should be disabled or enabled.

参数
[in] id The ID of the parameter.
[out] t_data Assigned the current data.
[in] flags Flags: DESCFLAGS_ENABLE
[out] itemdesc The parameter's description, encoded to a container as described in 描述 .
返回
true if the parameter should be enabled, otherwise false .

◆  TranslateDescID()

Bool TranslateDescID ( const DescID id ,
DescID res_id ,
C4DAtom *&  res_at  
)

Redirects description IDs between nodes.

参数
[in] id The description ID to redirect.
[in] res_id The target description ID.
[in] res_at The target node.
返回
true if successful, otherwise false .

◆  GetDirty()

UInt32 GetDirty ( DIRTYFLAGS   flags ) const

Gets the dirty checksum for the object. This can be used to check if the object has been changed.

另请参阅
GetHDirty()
参数
[in] flags Flags: DIRTYFLAGS
返回
The dirty checksum.

◆  SetDirty()

void SetDirty ( DIRTYFLAGS   flags )

Sets the dirty checksum, the one returned by GetDirty() .

另请参阅
SetHDirty()
参数
[in] flags Flags: DIRTYFLAGS

◆  GetHDirty()

UInt32 GetHDirty ( HDIRTYFLAGS   mask ) const

Gets the dirty bits for the specified mask.

另请参阅
GetDirty() .
参数
[in] mask Mask: HDIRTYFLAGS
返回
The dirty bits.

◆  SetHDirty()

void SetHDirty ( HDIRTYFLAGS   mask )

Sets the dirty bits, the one returned by GetHDirty() .

另请参阅
SetDirty() .
参数
[in] mask Mask: HDIRTYFLAGS