GeData Class Reference

#include <c4d_gedata.h>

详细描述

The GeData class can hold values of many different types, including custom data types.
It is used by many parts of the API, and can be stored in BaseContainer 对象。

Private Attributes

Int32   类型
Int32   dummy
union {
    Int32     DInteger
    Float     DReal
   void *    Ddata
    Int64     DLLong
}; 

Constructor/Destructor

  GeData (void)
  GeData (double n)
  GeData (const GeData &n)
  GeData ( Int32 n)
  GeData ( Float32 n)
  GeData (void *v, VOIDVALUETYPE xdummy)
  GeData ( Int64 v, LLONGVALUETYPE xdummy)
  GeData (const 向量 &n)
  GeData (const C4DUuid &n)
  GeData (const 矩阵 &n)
  GeData (const Char *n)
  GeData (const maxon::String &n)
  GeData (void *mem, Int count)
  GeData (const Filename &n)
  GeData (const BaseTime &n)
  GeData (const BaseContainer &n)
  GeData (const BaseLink *n)
  GeData ( BaseList2D *bl)
  GeData (const maxon::Data &n)
  GeData ( Int32 type, const CustomDataType &data)
  GeData ( Int32 type, DEFAULTVALUETYPE v)
void  Free (void)
  ~GeData (void)

Operator

const GeData operator= (const GeData &n)
Bool   operator== (const GeData &d) const
Bool   operator!= (const GeData &d) const

类型

Bool   SetDefault ( Int32 type)
Int32   GetType (void) const

Get Data

Bool   GetBool (void) const
Int32   GetInt32 (void) const
Int64   GetInt64 (void) const
Float   GetFloat (void) const
void *  GetVoid (void) const
const 向量 GetVector (void) const
const 矩阵 GetMatrix (void) const
const String GetString (void) const
const C4DUuid GetUuid (void) const
const Filename GetFilename (void) const
const BaseTime GetTime (void) const
BaseContainer GetContainer (void) const
BaseLink GetBaseLink (void) const
const maxon::Data GetData (void) const
CustomDataType GetCustomDataType ( Int32 datatype) const
BaseList2D GetLink (const BaseDocument *doc, Int32 instanceof=0) const
C4DAtomGoal GetLinkAtom (const BaseDocument *doc, Int32 instanceof=0) const
void *  GetMemoryAndRelease ( Int &count)
void *  GetMemory ( Int &count)

Set Data

void  CopyData ( GeData *dest, AliasTrans *aliastrans) const
void  SetFloat ( Float v)
void  SetInt32 ( Int32 v)
void  SetInt64 (const Int64 &v)
void  SetVoid (void *v)
void  SetMemory (void *data, Int count)
void  SetVector (const 向量 &v)
void  SetMatrix (const 矩阵 &v)
void  SetString (const maxon::String &v)
void  SetUuid (const C4DUuid &v)
void  SetTristate ()
void  SetData (const maxon::Data &v)
void  SetFilename (const Filename &v)
void  SetBaseTime (const BaseTime &v)
void  SetContainer (const BaseContainer &v)
void  SetBaseLink (const BaseLink &v)
void  SetBaseList2D ( BaseList2D *bl)
void  SetCustomDataType ( Int32 datatype, const CustomDataType &v)

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

◆  GeData() [1/21]

GeData ( void  )

Creates a DA_NIL data with no value.

◆  GeData() [2/21]

GeData ( double  n )

Creates a float data.

参数
[in] n The initial value.

◆  GeData() [3/21]

GeData ( const GeData n )

Copy constructor.

参数
[in] n The data to copy.

◆  GeData() [4/21]

GeData ( Int32   n )

Creates an Int32 data.

参数
[in] n The initial value.

◆  GeData() [5/21]

GeData ( Float32   n )

Creates a Float32 data.

参数
[in] n The initial value.

◆  GeData() [6/21]

GeData ( void *  v ,
VOIDVALUETYPE   xdummy  
)

Creates a void* data.

参数
[in] v The initial void* 值。
[in] xdummy The dummy parameter. Should always be VOIDVALUE .

◆  GeData() [7/21]

GeData ( Int64   v ,
LLONGVALUETYPE   xdummy  
)

Creates a long long (64-bit integer) data.

参数
[in] v The initial value.
[in] xdummy The dummy parameter. Should always be LLONGVALUE .

◆  GeData() [8/21]

GeData ( const 向量 n )

Creates a 向量 data.

参数
[in] n The initial value.

◆  GeData() [9/21]

GeData ( const C4DUuid n )

Creates a C4DUuid data.

参数
[in] n The initial value.

◆  GeData() [10/21]

GeData ( const 矩阵 n )

Creates a Matrix data.

参数
[in] n The initial value.

◆  GeData() [11/21]

GeData ( const Char n )

Creates a String data from a character buffer.

参数
[in] n The initial value.

◆  GeData() [12/21]

GeData ( const maxon::String n )

Creates a String data.

参数
[in] n The initial value.

◆  GeData() [13/21]

GeData ( void *  mem ,
Int   count  
)

Creates a memory buffer data.

参数
[in] mem The initial memory buffer value.
[in] count The number of bytes in the initial buffer.

◆  GeData() [14/21]

GeData ( const Filename n )

Creates a Filename data.

参数
[in] n The initial value.

◆  GeData() [15/21]

GeData ( const BaseTime n )

Creates a BaseTime data.

参数
[in] n The initial value.

◆  GeData() [16/21]

GeData ( const BaseContainer n )

Creates a BaseContainer data.

参数
[in] n The initial value.

◆  GeData() [17/21]

GeData ( const BaseLink n )

Creates a BaseLink data.

参数
[in] n The initial value.

◆  GeData() [18/21]

GeData ( BaseList2D bl )

Creates a BaseList2D data.

参数
[in] bl The initial value.

◆  GeData() [19/21]

GeData ( const maxon::Data n )

Creates a maxon::Data data.

参数
[in] n The initial value.

◆  GeData() [20/21]

GeData ( Int32   type ,
const CustomDataType data  
)

Creates a data with a custom data type.

参数
[in] type The custom data type ID.
[in] data The custom data.

◆  GeData() [21/21]

GeData ( Int32   type ,
DEFAULTVALUETYPE   v  
)

Creates a custom data type with the default value for the type.
The second parameter is simply a typing trick so that the compiler chooses this constructor:

GeData d( DATETIME_DATA , DEFAULTVALUE );
参数
[in] type The custom data type ID.
[in] v The dummy parameter. Should always be DEFAULTVALUE .

◆  ~GeData()

~ GeData ( void  )

Destructor.

成员函数文档编制

◆  Free()

void Free ( void  )

Deletes the internal data and sets the type to DA_NIL .

◆  operator=()

const GeData & operator= ( const GeData n )

Assignment operator.

参数
[in] n The data to assign.
返回
The assigned data.

◆  operator==()

Bool operator== ( const GeData d ) const

Equality operator.

参数
[in] d The data to compare with.
返回
true if the data are equal, otherwise false .

◆  operator!=()

Bool operator!= ( const GeData d ) const

Inequality operator.

参数
[in] d The data to compare with.
返回
true if the data are different, otherwise false .

◆  SetDefault()

Bool SetDefault ( Int32   type )

Sets the default value for the data type.

参数
[in] type The type ID: DA
返回
true if successful, otherwise false .

◆  GetType()

Int32 GetType ( void  ) const

Retrieves the type of the data.

返回
The data type: DA

◆  GetBool()

Bool GetBool ( void  ) const

Retrieves the value of Bool data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetInt32()

Int32 GetInt32 ( void  ) const

Retrieves the value of Int32 data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetInt64()

Int64 GetInt64 ( void  ) const

Retrieves the value of Int64 data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetFloat()

Float GetFloat ( void  ) const

Retrieves the value of Float data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetVoid()

void* GetVoid ( void  ) const

Retrieves the value of void* data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetVector()

const 向量 & GetVector ( void  ) const

Retrieves the value of 向量 data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetMatrix()

const 矩阵 & GetMatrix ( void  ) const

Retrieves the value of 矩阵 data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetString()

const String & GetString ( void  ) const

Retrieves the value of String data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetUuid()

const C4DUuid & GetUuid ( void  ) const

Retrieves the value of C4DUuid data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetFilename()

const Filename & GetFilename ( void  ) const

Retrieves the value of Filename data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetTime()

const BaseTime & GetTime ( void  ) const

Retrieves the value of BaseTime data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetContainer()

BaseContainer * GetContainer ( void  ) const

Retrieves the value of BaseContainer data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetBaseLink()

BaseLink * GetBaseLink ( void  ) const

Retrieves the value of BaseLink data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetData()

const maxon::Data & GetData ( void  ) const

Retrieves the value of maxon::Data data objects. Forbidden for other data.

返回
The value. Only valid as long as the GeData value exists.

◆  GetCustomDataType()

CustomDataType * GetCustomDataType ( Int32   datatype ) const

Retrieves the value of a CustomDataType ,或 nullptr if the wrong data type was specified. Forbidden for other data types.

参数
[in] datatype The data type ID.
返回
The custom data type value, or nullptr if the types do not match. The data owns the pointed value.
Only valid as long as the GeData value exists.

◆  GetLink()

BaseList2D * GetLink ( const BaseDocument doc ,
Int32   instanceof = 0  
) const

Evaluates the link of DA_ALIASLINK data objects. Equivalent to GetBaseLink() -> GetLink() .
instanceof is specified, nullptr is returned if the object is not of this type. Forbidden for other data.

参数
[in] doc The document to evaluate the link in. The caller owns the pointed document.
[in] instanceof Set this to a node type to only return the link if it is of this type.
返回
The evaluated link. Cinema 4D owns the pointed link.
Only valid as long as the GeData value exists.

◆  GetLinkAtom()

C4DAtomGoal * GetLinkAtom ( const BaseDocument doc ,
Int32   instanceof = 0  
) const

Evaluates the atom link of DA_ALIASLINK data objects. Equivalent to GetBaseLink() -> GetLinkAtom() .
instanceof is specified, nullptr is returned if the object is not of this type. Forbidden for other data.

参数
[in] doc The document to evaluate the atom link in. The caller owns the pointed document.
[in] instanceof Set this to a node type to only return the atom link if it is of this type.
返回
The evaluated atom link. Cinema 4D owns the pointed atom link.
Only valid as long as the GeData value exists.

◆  GetMemoryAndRelease()

void* GetMemoryAndRelease ( Int count )

Retrieves the value of memory buffer data objects. Forbidden for other data.

注意
In this version of GetMemory() the caller takes over the ownership of the memory block.
The memory block must be allocated with NewMem() and deallocated with DeleteMem() .
参数
[in] count Assigned the number of bytes in the returned memory buffer.
返回
The memory buffer. The caller takes over the ownership of the memory block.
Only valid as long as the GeData value exists.

◆  GetMemory()

void* GetMemory ( Int count )

Retrieves the value of memory buffer data objects. Forbidden for other data.

注意
The memory block must be allocated with NewMem() and deallocated with DeleteMem() .
参数
[in] count Assigned the number of bytes in the returned memory buffer.
返回
The memory buffer. The data owns the pointed memory block.
Only valid as long as the GeData value exists.

◆  CopyData()

void CopyData ( GeData dest ,
AliasTrans aliastrans  
) const

Copies the data to another with an alias translator for the links.

参数
[in] dest The destination data. The caller owns the pointed data.
[in] aliastrans An alias translator for the operation. Can be nullptr . The caller owns the pointed alias translator.

◆  SetFloat()

void SetFloat ( Float   v )

设置 Float value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetInt32()

void SetInt32 ( Int32   v )

设置 Int32 value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetInt64()

void SetInt64 ( const Int64 v )

设置 Int64 value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetVoid()

void SetVoid ( void *  v )

设置 void* value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetMemory()

void SetMemory ( void *  data ,
Int   count  
)

Sets the memory buffer value and changes the data type accordingly.

参数
[in] data The new memory buffer value.
[in] count The number of bytes in the memory buffer.

◆  SetVector()

void SetVector ( const 向量 v )

设置 向量 value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetMatrix()

void SetMatrix ( const 矩阵 v )

设置 矩阵 value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetString()

void SetString ( const maxon::String v )

设置 String value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetUuid()

void SetUuid ( const C4DUuid v )

设置 C4DUuid value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetTristate()

void SetTristate ( )

Sets data type accordingly (and clears the internal value)

◆  SetData()

void SetData ( const maxon::Data v )

设置 maxon::Data value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetFilename()

void SetFilename ( const Filename v )

设置 Filename value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetBaseTime()

void SetBaseTime ( const BaseTime v )

设置 BaseTime value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetContainer()

void SetContainer ( const BaseContainer v )

设置 BaseContainer value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetBaseLink()

void SetBaseLink ( const BaseLink v )

设置 BaseLink value and changes the data type accordingly.

参数
[in] v The new value.

◆  SetBaseList2D()

void SetBaseList2D ( BaseList2D bl )

设置 BaseList2D value and changes the data type accordingly.

参数
[in] bl The new value.

◆  SetCustomDataType()

void SetCustomDataType ( Int32   datatype ,
const CustomDataType v  
)

Sets the value for custom data type and changes the data type accordingly.

参数
[in] datatype The custom data type ID.
[in] v The new custom data type value.

Member Data Documentation

◆  类型

Int32 类型
private

◆  dummy

Int32 dummy
private

◆  DInteger

Int32 DInteger

◆  DReal

Float DReal

◆  Ddata

void* Ddata

◆  DLLong

Int64 DLLong

◆  @14

union { ... }
GeData
定义: c4d_gedata.h:82
DEFAULTVALUE
@ DEFAULTVALUE
Dummy value for the default value GeData constructor.
定义: c4d_gedata.h:65
DATETIME_DATA
#define DATETIME_DATA
DateTime custom data ID.
定义: customgui_datetime.h:23