#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 objects.
Private Attributes | |
Int32 | Type |
Int32 | dummy |
union { | |
Int32 DInteger | |
Float DReal | |
void * Ddata | |
Int64 DLLong | |
}; | |
Constructor/Destructor | |
GeData () | |
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 Vector &n) | |
GeData (const C4DUuid &n) | |
GeData (const Matrix &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 () |
~GeData () | |
Operator | |
const GeData & | operator= (const GeData &n) |
Bool | operator== (const GeData &d) const |
Bool | operator!= (const GeData &d) const |
Type | |
Bool | SetDefault (Int32 type) |
Int32 | GetType () const |
Get Data | |
Bool | GetBool () const |
Int32 | GetInt32 () const |
Int64 | GetInt64 () const |
Float | GetFloat () const |
void * | GetVoid () const |
const Vector & | GetVector () const |
const Matrix & | GetMatrix () const |
const String & | GetString () const |
const C4DUuid & | GetUuid () const |
const Filename & | GetFilename () const |
const BaseTime & | GetTime () const |
BaseContainer * | GetContainer () const |
BaseLink * | GetBaseLink () const |
const maxon::Data & | GetData () 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 Vector &v) |
void | SetMatrix (const Matrix &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 | ( | double | n | ) |
Creates a float
data.
[in] | n | The initial value. |
GeData | ( | void * | v, |
VOIDVALUETYPE | xdummy | ||
) |
Creates a void*
data.
[in] | v | The initial void* value. |
[in] | xdummy | The dummy parameter. Should always be VOIDVALUE. |
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. |
Creates a String data from a character buffer.
[in] | n | The initial value. |
GeData | ( | const maxon::String & | n | ) |
Creates a String data.
[in] | n | The initial value. |
Creates a memory buffer data.
[in] | mem | The initial memory buffer value. |
[in] | count | The number of bytes in the initial buffer. |
GeData | ( | const BaseContainer & | n | ) |
Creates a BaseContainer data.
[in] | n | The initial value. |
GeData | ( | BaseList2D * | bl | ) |
Creates a BaseList2D data.
[in] | bl | The initial value. |
GeData | ( | const maxon::Data & | n | ) |
Creates a maxon::Data data.
[in] | n | The initial value. |
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 | ( | 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:
[in] | type | The custom data type ID. |
[in] | v | The dummy parameter. Should always be DEFAULTVALUE. |
~GeData | ( | ) |
Destructor.
void Free | ( | ) |
Deletes the internal data and sets the type to DA_NIL.
Assignment operator.
[in] | n | The data to assign. |
Equality operator.
[in] | d | The data to compare with. |
Inequality operator.
[in] | d | The data to compare with. |
Sets the default value for the data type.
[in] | type | The type ID: DA |
Bool GetBool | ( | ) | const |
Int32 GetInt32 | ( | ) | const |
Int64 GetInt64 | ( | ) | const |
Float GetFloat | ( | ) | const |
void* GetVoid | ( | ) | const |
Retrieves the value of void*
data objects. Forbidden for other data.
const Vector& GetVector | ( | ) | const |
const Matrix& GetMatrix | ( | ) | const |
const String& GetString | ( | ) | const |
const C4DUuid& GetUuid | ( | ) | const |
const Filename& GetFilename | ( | ) | const |
const BaseTime& GetTime | ( | ) | const |
BaseContainer* GetContainer | ( | ) | const |
Retrieves the value of BaseContainer data objects. Forbidden for other data.
BaseLink* GetBaseLink | ( | ) | const |
const maxon::Data& GetData | ( | ) | const |
Retrieves the value of maxon::Data data objects. Forbidden for other data.
CustomDataType* GetCustomDataType | ( | Int32 | datatype | ) | const |
Retrieves the value of a CustomDataType, or nullptr if the wrong data type was specified. Forbidden for other data types.
[in] | datatype | The data type ID. |
BaseList2D* GetLink | ( | const BaseDocument * | doc, |
Int32 | instanceof = 0 |
||
) | const |
Evaluates the link of DA_ALIASLINK data objects. Equivalent to GetBaseLink()->GetLink().
If 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. |
C4DAtomGoal* GetLinkAtom | ( | const BaseDocument * | doc, |
Int32 | instanceof = 0 |
||
) | const |
Evaluates the atom link of DA_ALIASLINK data objects. Equivalent to GetBaseLink()->GetLinkAtom().
If 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. |
void* GetMemoryAndRelease | ( | Int & | count | ) |
Retrieves the value of memory buffer data objects. Forbidden for other data.
[in] | count | Assigned the number of bytes in the returned memory buffer. |
void* GetMemory | ( | Int & | count | ) |
Retrieves the value of memory buffer data objects. Forbidden for other data.
[in] | count | Assigned the number of bytes in the returned memory buffer. |
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. |
void SetFloat | ( | Float | v | ) |
Sets the Float value and changes the data type accordingly.
[in] | v | The new value. |
void SetInt32 | ( | Int32 | v | ) |
Sets the Int32 value and changes the data type accordingly.
[in] | v | The new value. |
void SetInt64 | ( | const Int64 & | v | ) |
Sets the Int64 value and changes the data type accordingly.
[in] | v | The new value. |
void SetVoid | ( | void * | v | ) |
Sets the void*
value and changes the data type accordingly.
[in] | v | The new value. |
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. |
void SetVector | ( | const Vector & | v | ) |
Sets the Vector value and changes the data type accordingly.
[in] | v | The new value. |
void SetMatrix | ( | const Matrix & | v | ) |
Sets the Matrix value and changes the data type accordingly.
[in] | v | The new value. |
void SetString | ( | const maxon::String & | v | ) |
Sets the String value and changes the data type accordingly.
[in] | v | The new value. |
void SetUuid | ( | const C4DUuid & | v | ) |
Sets the C4DUuid value and changes the data type accordingly.
[in] | v | The new value. |
void SetTristate | ( | ) |
Sets data type accordingly (and clears the internal value)
void SetData | ( | const maxon::Data & | v | ) |
Sets the maxon::Data value and changes the data type accordingly.
[in] | v | The new value. |
void SetFilename | ( | const Filename & | v | ) |
Sets the Filename value and changes the data type accordingly.
[in] | v | The new value. |
void SetBaseTime | ( | const BaseTime & | v | ) |
Sets the BaseTime value and changes the data type accordingly.
[in] | v | The new value. |
void SetContainer | ( | const BaseContainer & | v | ) |
Sets the BaseContainer value and changes the data type accordingly.
[in] | v | The new value. |
void SetBaseLink | ( | const BaseLink & | v | ) |
Sets the BaseLink value and changes the data type accordingly.
[in] | v | The new value. |
void SetBaseList2D | ( | BaseList2D * | bl | ) |
Sets the BaseList2D value and changes the data type accordingly.
[in] | bl | The new value. |
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. |
|
private |
|
private |
Int32 DInteger |
Float DReal |
void* Ddata |
Int64 DLLong |
union { ... } |