InstanceObjectData Class Reference

#include <c4d_instanceobjectdata.h>

Inheritance diagram for InstanceObjectData:

Public Types

typedef NodeData SUPER
 
- Public Types inherited from NodeData
typedef PrivateChunk SUPER
 

Public Member Functions

virtual Bool IsInstanceOf (cineware::Int32 id) const
 
- Public Member Functions inherited from NodeData
 NodeData ()
 
BaseList2DGetNode ()
 
void SetNode (BaseList2D *ptr)
 
BaseTagGetTag (Int32 id)
 
BaseTagMakeTag (Int32 id)
 
- Public Member Functions inherited from PrivateChunk
 PrivateChunk ()
 
Bool ReadChunk (HyperFile *hf, Bool keepin=false, Bool noheader=false)
 
virtual Bool IsListHead ()
 
virtual Int32 GetType () const
 
virtual Int32 GetInstanceType () const
 
Bool ReadObject (HyperFile *hf, Bool readheader)
 
Bool WriteObject (HyperFile *hf, Int32 type)
 
Bool CopyTo (PrivateChunk *dest, COPYFLAGS flags, AliasTrans *trans)
 
Bool GetParameter (Int32 id, GeData &data)
 
Bool SetParameter (Int32 id, const GeData &data)
 
Bool GetParameter (const DescID &id, GeData &data)
 
Bool SetParameter (const DescID &id, const GeData &data)
 
- Public Member Functions inherited from GeTempPublicNode2D< PrivateChunk >
PrivateChunkGetNext () const
 
PrivateChunkGetPrev () const
 
void InsertBefore (PrivateChunk *n)
 
void InsertAfter (PrivateChunk *n)
 
void Remove ()
 

Static Protected Member Functions

static NodeDataAlloc ()
 

Private Member Functions

virtual Bool Init ()
 
virtual void Free ()
 
virtual Bool SetDParameter (const DescID &id, const GeData &t_data)
 
virtual Bool GetDParameter (const DescID &id, GeData &t_data)
 
virtual Int32 GetChunkLevel ()
 
virtual Bool Read (HyperFile *hf, Int32 id, Int32 level)
 
virtual Bool Write (HyperFile *hf)
 
virtual Bool CopyToX (PrivateChunk *dest, COPYFLAGS flags, AliasTrans *trn)
 
void FlushArrays ()
 

Private Attributes

BaseArray< MatrixobjectMatrices
 
BaseArray< Color64objectColors
 

Friends

class BaseObject
 

Multi-instance Reference Object

BaseObjectGetReferenceObject (BaseDocument *doc)
 
void SetReferenceObject (BaseObject *refObj)
 

Multi-instance Matrix and Instance Count

Bool IsMultiInstance ()
 
Bool SetInstanceMatrices (const BaseArray< Matrix > &matrices)
 
BaseArray< Matrix > * GetInstanceMatrices ()
 
Matrix GetInstanceMatrix (UInt index) const
 
UInt GetInstanceCount ()
 

Multi-instance Color

Bool SetInstanceColors (const BaseArray< Color64 > &colors)
 
BaseArray< Color64 > * GetInstanceColors ()
 
Color64 GetInstanceColor (UInt index)
 

Additional Inherited Members

- Protected Member Functions inherited from NodeData
virtual Bool Execute ()
 
virtual Int32 GetDiskType () const
 
virtual Bool TranslateDescID (GeListNode *node, const DescID &id, DescID &res_id, GeListNode *&res_at)
 
- Protected Member Functions inherited from PrivateChunk
virtual Bool HandleSubChunk (HyperFile *hf, Int32 id, Int32 level)
 

Detailed Description

Node data class for Cinema 4D's instance object.

Since
R20

Member Typedef Documentation

◆ SUPER

typedef NodeData SUPER

Member Function Documentation

◆ IsInstanceOf()

virtual Bool IsInstanceOf ( cineware::Int32  id) const
virtual

Reimplemented from NodeData.

◆ GetReferenceObject()

BaseObject* GetReferenceObject ( BaseDocument doc)

Return the instanciated object.

Note
Same as accessing the INSTANCEOBJECT_LINK element in the object's data container.
Parameters
[in]docThe document the instance object belongs to.
Returns
The reference object. Null if the instance object is unassigned.

◆ SetReferenceObject()

void SetReferenceObject ( BaseObject refObj)

Sets the instanciated object used for the multiple instances.

Parameters
[in]refObjThe reference object to set.

◆ IsMultiInstance()

Bool IsMultiInstance ( )

Checks if the instance object is in multi-instance mode.

Returns
true if in multi-instance mode, otherwise false.

◆ SetInstanceMatrices()

Bool SetInstanceMatrices ( const BaseArray< Matrix > &  matrices)

Sets the instance matrices.

Note
The size of matrices determines the instance count.
Parameters
[in]matricesThe instance matrix array.
Returns
true if successful, otherwise false.

◆ GetInstanceMatrices()

BaseArray<Matrix>* GetInstanceMatrices ( )

Returns the instance matrices.

Returns
The pointer to the matrix array. Owned by the instance object.

◆ GetInstanceMatrix()

Matrix GetInstanceMatrix ( UInt  index) const

Returns the global matrix of the instance at the specified index.

Parameters
[in]indexThe instance index.
Returns
The instance matrix.

◆ GetInstanceCount()

UInt GetInstanceCount ( )

Returns the instance count (number of instances and matrices).

Returns
The instance count.

◆ SetInstanceColors()

Bool SetInstanceColors ( const BaseArray< Color64 > &  colors)

Sets the instance colors.

Parameters
[in]colorsThe array of instance colors to set.
Returns
true if successful, otherwise false.

◆ GetInstanceColors()

BaseArray<Color64>* GetInstanceColors ( )

Returns the instance colors.

Note
If the array is null or empty, the default color is used.
Returns
The pointer to the color array. Owned by the instance object.

◆ GetInstanceColor()

Color64 GetInstanceColor ( UInt  index)

Returns the color of the instance at the specified index.

Note
If no color is found or index is invalid, the default color is returned.
Parameters
[in]indexThe instance index.
Returns
The instance color.

◆ Alloc()

static NodeData* Alloc ( )
staticprotected

◆ Init()

virtual Bool Init ( )
privatevirtual

Called when an instance of a derived node data class needs to be initialized.

Returns
true if successful, otherwise false.

Reimplemented from NodeData.

◆ Free()

virtual void Free ( )
privatevirtual

Reimplemented from NodeData.

◆ SetDParameter()

virtual Bool SetDParameter ( const DescID id,
const GeData t_data 
)
privatevirtual

Reimplemented from PrivateChunk.

◆ GetDParameter()

virtual Bool GetDParameter ( const DescID id,
GeData t_data 
)
privatevirtual

Reimplemented from PrivateChunk.

◆ GetChunkLevel()

virtual Int32 GetChunkLevel ( )
privatevirtual

Reimplemented from PrivateChunk.

◆ Read()

virtual Bool Read ( HyperFile hf,
Int32  id,
Int32  level 
)
privatevirtual

Reads the node from a hyper file.

Parameters
[in]hfThe hyper file to read from. Cineware SDK owns the pointed hyper file.
[in]idThe ID of the node to read.
[in]levelThe disklevel of the node to read.
Returns
true if successful, otherwise false.

Reimplemented from NodeData.

◆ Write()

virtual Bool Write ( HyperFile hf)
privatevirtual

Reimplemented from PrivateChunk.

◆ CopyToX()

virtual Bool CopyToX ( PrivateChunk dst,
COPYFLAGS  flags,
AliasTrans trans 
)
privatevirtual

Private.

Reimplemented from NodeData.

◆ FlushArrays()

void FlushArrays ( )
private

Friends And Related Function Documentation

◆ BaseObject

friend class BaseObject
friend

Member Data Documentation

◆ objectMatrices

BaseArray<Matrix> objectMatrices
private

◆ objectColors

BaseArray<Color64> objectColors
private