BaseList2D Class Reference

#include <c4d_baselist2d.h>

Inheritance diagram for BaseList2D:

Public Types

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

Public Member Functions

virtual Bool IsInstanceOf (melange::Int32 id) const
 
- Public Member Functions inherited from GeListNode
 GeListNode ()
 
 ~GeListNode ()
 
virtual Bool GetNBit (Int32 bit) const
 
virtual Bool ChangeNBit (NBIT bit, NBITCONTROL bitmode)
 
BaseDocumentGetDocument ()
 
virtual Int32 GetInfo ()
 
GeListNodeGetPred ()
 
GeListNodeGetNext ()
 
GeListNodeGetUp ()
 
GeListNodeGetDown ()
 
GeListNodeGetDownLast ()
 
void InsertBefore (GeListNode *op)
 
void InsertAfter (GeListNode *op)
 
void Remove ()
 
void InsertUnder (GeListNode *op)
 
void InsertUnderLast (GeListNode *op)
 
RootList2DGetListHead ()
 
Int32 GetNodeID (Int32 index=0) const
 
- Public Member Functions inherited from PrivateChunk
 PrivateChunk ()
 
Bool ReadChunk (HyperFile *hf, Bool keepin=false, Bool noheader=false)
 
virtual Bool IsListHead ()
 
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)
 
virtual Int32 GetChunkLevel ()
 
- Public Member Functions inherited from GeTempPublicNode2D< PrivateChunk >
PrivateChunkGetNext () const
 
PrivateChunkGetPrev () const
 
void InsertBefore (PrivateChunk *n)
 
void InsertAfter (PrivateChunk *n)
 
void Remove ()
 

Protected Member Functions

void SetID (Int32 id)
 
virtual Bool HandleSubChunk (HyperFile *hf, Int32 id, Int32 level)
 
virtual Bool Write (HyperFile *hf)
 
virtual Bool GetDParameter (const DescID &id, GeData &data)
 
virtual Bool SetDParameter (const DescID &id, const GeData &data)
 
virtual Bool CopyToX (PrivateChunk *dest, COPYFLAGS flags, AliasTrans *trans)
 
virtual Int32 GetInstanceType () const
 

Protected Attributes

Int32 m_id
 
RootShader mp_rootshader
 
RootShader root_shader_repository
 
Int32 l_bitfeld
 
RootCTrack mp_rootctrack
 
RootPluginNode root_override
 
NotifyListnotify_events
 
DescIdStorekeyframestore
 
DescIdStorepropstore
 
BaseContainer m_bc
 
NodeDatam_data
 
- Protected Attributes inherited from GeListNode
GeAliasGoal m_xgoal
 
UInt32 m_bits [4]
 
RootList2Dt_rootlist_parent
 
RootList2Dm_children
 
BaseDocumentparent_doc
 
void * unknownData
 
Int unknownDataSize
 
Int32 unknownDataLevel
 
Int32 pluginID
 

Private Attributes

String m_name
 
BaseLink mp_layer
 
GeMarker m_marker
 
UniqueIDArrayl_uniquearray
 
DynamicDescription dynamicdescription
 

Friends

class RootList2D
 
class RootShader
 
class RootCKey
 
class RootCTrack
 
class RootObject
 
class RootMultipass
 
class RootVideoPost
 
class BaseDocument
 
class RootRenderData
 
class BaseShader
 
class BaseList4D
 
class BaseObject
 
class WeightTagData
 
class RootBaseDraw
 
class RootPluginNode
 
class BaseOverrideData
 
class BaseSceneHook
 
class PluginNode
 

Constructor/Destructor

 BaseList2D ()
 
virtual ~BaseList2D ()
 

Navigation

BaseList2DGetNext ()
 
BaseList2DGetPred ()
 

Node Data

NodeDataGetNodeData ()
 
void SetNodeData (NodeData *data)
 

Bit

void SetBit (Int32 mask)
 
Bool GetBit (Int32 mask)
 
void DelBit (Int32 mask)
 
void ToggleBit (Int32 mask)
 
Int32 GetAllBits ()
 
void SetAllBits (Int32 bits)
 

Data

BaseContainer GetData ()
 
BaseContainerGetDataInstance ()
 
BaseContainerGetDataInstanceRef ()
 

Name

const StringGetName ()
 
void SetName (const String &new_name)
 

Marker

const GeMarkerGetMarker () const
 
void SetMarker (const GeMarker &m)
 

Unique ID

Bool AddUniqueID (Int32 appid, const Char *const mem, Int bytes)
 
Bool FindUniqueID (Int32 appid, const Char *&mem, Int &bytes) const
 
Int32 GetUniqueIDCount () const
 
Bool GetUniqueIDIndex (Int32 idx, Int32 &id, const Char *&mem, Int &bytes) const
 

Shader

BaseShaderGetFirstShader ()
 
Bool InsertShader (BaseShader *shader, BaseShader *pred=nullptr)
 
Bool InsertShaderLast (BaseShader *shader)
 

CTrack

RootCTrackGetCTrackRoot ()
 
CTrackGetFirstCTrack ()
 
CTrackFindCTrack (const DescID &id)
 
Bool AppendCTrack (CTrack *t)
 
void InsertTrackSorted (CTrack *track)
 

Type

virtual Int32 GetType () const
 
virtual Int32 GetDiskType () const
 

Layer

LayerObjectGetLayerObject ()
 
void SetLayerObject (LayerObject *layer)
 
const LayerDataGetLayerData (BaseDocument *doc, Bool rawdata=false)
 
Bool SetLayerData (BaseDocument *doc, const LayerData &data)
 

Miscellaneous

virtual BaseList2DGetClone (COPYFLAGS flags, AliasTrans *trans)
 
DynamicDescriptionGetDynamicDescription ()
 
virtual Bool IsBaseList ()
 
virtual void Remove ()
 
Bool SetDescIDState (const DescID &id, DESCIDSTATE descidstate)
 
DESCIDSTATE GetDescIDState (const DescID &id, Bool tolerant) const
 
RootPluginNodeGetOverrideRoot ()
 
BaseOverrideGetFirstOverride ()
 
virtual Bool TranslateDescID (const DescID &id, DescID &res_id, GeListNode *&res_at)
 

Detailed Description

Represents a node in a 2D list.

Member Typedef Documentation

◆ SUPER

typedef GeListNode SUPER

Constructor & Destructor Documentation

◆ BaseList2D()

Default constructor.

◆ ~BaseList2D()

virtual ~BaseList2D ( )
virtual

Default destructor.

Member Function Documentation

◆ IsInstanceOf()

◆ SetID()

void SetID ( Int32  id)
protected

◆ HandleSubChunk()

◆ Write()

◆ GetDParameter()

virtual Bool GetDParameter ( const DescID id,
GeData data 
)
protectedvirtual

◆ SetDParameter()

virtual Bool SetDParameter ( const DescID id,
const GeData data 
)
protectedvirtual

◆ CopyToX()

◆ GetInstanceType()

virtual Int32 GetInstanceType ( ) const
protectedvirtual

Reimplemented from PrivateChunk.

Reimplemented in BaseObject, BaseTag, BaseVideoPost, BaseMaterial, and BaseShader.

◆ GetNext()

BaseList2D* GetNext ( )

Gets the next base list in the list.

Returns
The next node, or nullptr if there is none. Melange owns the pointed BaseList2D.

◆ GetPred()

BaseList2D* GetPred ( )

Gets the previous base list in the list.

Returns
The previous node, or nullptr if there is none. Melange owns the pointed BaseList2D.

◆ GetNodeData()

NodeData* GetNodeData ( )

Gets the node data of the object.

Returns
The node data, or nullptr. The object owns the pointed node data.

◆ SetNodeData()

void SetNodeData ( NodeData data)

Sets the node data of the object.

Parameters
[in]dataThe node data to set. The object takes over the ownership of the pointed node data.

◆ SetBit()

void SetBit ( Int32  mask)

Sets the base list bit flags denoted by mask to true.

Parameters
[in]maskBit mask of the flags.

◆ GetBit()

Bool GetBit ( Int32  mask)

Gets the state of the base list bit flags denoted by mask.

Parameters
[in]maskBit mask of the flags.
Returns
true if the flags denoted by mask are set, otherwise false.

◆ DelBit()

void DelBit ( Int32  mask)

Deletes the base list bit flags denoted by mask, i.e. sets the corresponding bit to false.

Parameters
[in]maskBit mask of the flags.

◆ ToggleBit()

void ToggleBit ( Int32  mask)

Toggles the state of the base list bit flags denoted by mask.

Parameters
[in]maskBit mask of the flags.

◆ GetAllBits()

Int32 GetAllBits ( )

Gets all of the base list's bit flags.

Returns
The flags.

◆ SetAllBits()

void SetAllBits ( Int32  bits)

Sets all of the base list's bit flags at once.

Parameters
[in]bitsNew flags.

◆ GetData()

BaseContainer GetData ( )

Gets a copy of the base list's container.

Returns
The base list's container.

◆ GetDataInstance()

BaseContainer* GetDataInstance ( )

Gets a pointer to the base list's container that can be changed directly.

Returns
A pointer to the internal base list's container. The base list owns the pointed container.

◆ GetDataInstanceRef()

BaseContainer& GetDataInstanceRef ( )

Retrieves a reference to the object container that can be changed directly.

See also
GetData()
Since
R20
Returns
A reference to the internal container. The node owns the referenced container.

◆ GetName()

const String& GetName ( )

Gets the name of the base list.

Returns
The name.

◆ SetName()

void SetName ( const String new_name)

Sets the name of the object.

Parameters
[in]new_nameThe new name.

◆ GetMarker()

const GeMarker& GetMarker ( ) const

Gets the object's marker.

Returns
The object's marker.

◆ SetMarker()

void SetMarker ( const GeMarker m)

Sets the object's marker.

Since
18.002
Parameters
[in]mThe new object's marker.

◆ AddUniqueID()

Bool AddUniqueID ( Int32  appid,
const Char *const  mem,
Int  bytes 
)

Adds unique ID data to the base list.

Note
A unique ID can be used for instance to identify scenes written by external applications.
Parameters
[in]appidUnique application ID. Has to be registered at MAXON and obtained from http://www.plugincafe.com.
[in]memPointer to a block of memory. Used for instance to store the name of a software vendor.
[in]bytesLength of mem memory block.
Returns
true if the unique ID was added, otherwise false.

◆ FindUniqueID()

Bool FindUniqueID ( Int32  appid,
const Char *&  mem,
Int bytes 
) const

Checks for a specific unique application ID data.

Note
A unique ID can be used for instance to identify scenes written by external applications.
Parameters
[in]appidUnique application ID. Has to be registered at MAXON and obtained from http://www.plugincafe.com.
[in]memAssigned a pointer to a block of memory. Used for instance to read the name of a software vendor.
[in]bytesAssigned the length of mem block.
Returns
true if the unique ID could be found, otherwise false.

◆ GetUniqueIDCount()

Int32 GetUniqueIDCount ( ) const

Gets the number of unique IDs.

Note
A unique ID can be used for instance to identify scenes written by external applications.
Returns
The number of unique IDs.

◆ GetUniqueIDIndex()

Bool GetUniqueIDIndex ( Int32  idx,
Int32 id,
const Char *&  mem,
Int bytes 
) const

Gets the idx-th unique ID data.

Note
A unique ID can be used for instance to identify scenes written by external applications.
Parameters
[in]idxUnique ID index.
[in]idAssigned the unique ID.
[in]memAssigned a pointer to a block of memory. Used for instance to read the name of a software vendor.
[in]bytesAssigned the length of mem block.
Returns
true if the unique ID index could be found, otherwise false.

◆ GetFirstShader()

BaseShader* GetFirstShader ( )

Gets the first shader of the base list.

Note
Normally you do not have to deal with the shader list. But if you want to create or modify shader trees you need to read the following lines:
If you are programming shader links you need to make sure that every shader is referenced only once; it is not allowed that a shader is referenced multiple times.
If the referencing object is a shader, the referenced shader must be child of it, otherwise it must be inserted via InsertShader().

Example 1: A tag references a shader. The shader must be inserted into the tag using InsertShader();. Example 2: A Shader (A) references another shader (B): the shader B must be child of the shader A.

Returns
The first shader of the base list, or nullptr if there are none. The object owns the pointed shader.

◆ InsertShader()

Bool InsertShader ( BaseShader shader,
BaseShader pred = nullptr 
)

Inserts a shader in the base list's shader list.

BaseMaterial *mat = nullptr;
mat = doc->GetFirstMaterial();
if (!mat) return true;
BaseContainer *data = mat->GetDataInstance();
if (!data) return true;
if (!shd) return false;
data->SetLink(MATERIAL_COLOR_SHADER, shd);
mat->InsertShader(shd);
mat->Message(MSG_UPDATE);
mat->Update(true, true);
EventAdd();
Parameters
[in]shaderThe shader to insert. The object takes over the ownership of the pointed shader.
[in]predThe shader to insert the new shader after, or nullptr (default) to insert the new shader first. The pointed shader must already be inserted into the list.
Returns
true if successful, otherwise false.

◆ InsertShaderLast()

Bool InsertShaderLast ( BaseShader shader)

Inserts a shader in the base list's shader list as last shader.

See also
InsertShader()
Parameters
[in]shaderThe shader to insert. The object takes over the ownership of the pointed shader.
Returns
true if successful, otherwise false.

◆ GetCTrackRoot()

RootCTrack* GetCTrackRoot ( )

Gets the track root of the base list.

Returns
The track root.

◆ GetFirstCTrack()

CTrack* GetFirstCTrack ( )

Gets the first track of the base list.

Returns
The first track, or nullptr if there are no tracks.

◆ FindCTrack()

CTrack* FindCTrack ( const DescID id)

Finds the track for the specified description id.

Parameters
[in]idThe description ID for the searched track.
Returns
The found track, or nullptr if there was no match.

◆ AppendCTrack()

Bool AppendCTrack ( CTrack t)

Appends a track and automatically places it at the right place (so that Y comes after X for example).

Parameters
[in]tThe track to append.
Returns
true if successful, otherwise false.

◆ InsertTrackSorted()

void InsertTrackSorted ( CTrack track)

Inserts a track and automatically places it at the right place (so that Y comes after X for example).

Since
18.002
Parameters
[in]trackThe track to insert.

◆ GetType()

virtual Int32 GetType ( ) const
virtual

Gets the type of the base list.

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

Reimplemented from PrivateChunk.

Reimplemented in CTrack, BaseDocument, BaseShader, BaseTag, BaseVideoPost, BaseMaterial, SplineObject, PolygonObject, RenderData, PointObject, PluginNode, BaseSceneHook, and ViewPanel.

◆ GetDiskType()

virtual Int32 GetDiskType ( ) const
virtual

Gets the unique disk type of the base list.

Note
Normally this is the same as GetType() but there are exceptions.
Returns
The disk type, for example Ocube.

Reimplemented from GeListNode.

Reimplemented in CTrack, BaseShader, BaseTag, BaseMaterial, BaseVideoPost, BaseObject, FieldLayer, PluginNode, BaseSceneHook, SplineObject, PointObject, and PolygonObject.

◆ GetLayerObject()

LayerObject* GetLayerObject ( )

Gets the layer for the base list.

Returns
The layer, or nullptr. Melange owns the pointed layer.

◆ SetLayerObject()

void SetLayerObject ( LayerObject layer)

Sets the layer for the base list.

Parameters
[in]layerThe layer to set. The object takes over the ownership of the pointed layer.

◆ GetLayerData()

const LayerData* GetLayerData ( BaseDocument doc,
Bool  rawdata = false 
)

Gets the layer data for the object.

Since
17.008
Parameters
[in]docThe document for the operation.
[in]rawdataUsually GetLayerData() takes special global modes like SOLO layer automatically into account.
To get the original layer values without any additional global changes set rawdata to true.
Returns
The layer data, or nullptr.

◆ SetLayerData()

Bool SetLayerData ( BaseDocument doc,
const LayerData data 
)

Sets the layer data for the object.

Since
17.008
Parameters
[in]docThe document for the operation.
[in]dataThe new layer data.
Returns
true if the layer data was successfully set, otherwise false.

◆ GetClone()

virtual BaseList2D* GetClone ( COPYFLAGS  flags,
AliasTrans trans 
)
virtual

Gets a copy of the base list.

Parameters
[in]flagsFlags for the clone.
[in]transAn alias translator for the operation. Can be nullptr. The caller owns the pointed object.
Returns
The cloned base list. The caller owns the pointed object.

Reimplemented from GeListNode.

Reimplemented in CTrack, RenderData, CKey, BaseDocument, BaseObject, BaseDraw, BaseShader, BaseTag, BaseVideoPost, FieldLayer, LayerObject, MultipassObject, BaseMaterial, PluginNode, BaseSceneHook, and ViewPanel.

◆ GetDynamicDescription()

DynamicDescription* GetDynamicDescription ( )

Gets the dynamic description of the base list. Also known as the User Data part of the Attribute Manager.

Returns
The dynamic description. The base list owns the pointed dynamic description.

◆ IsBaseList()

virtual Bool IsBaseList ( )
virtual

Checks if it is a base list.

Returns
true if a base list, otherwise false.

Reimplemented from GeListNode.

◆ Remove()

virtual void Remove ( )
virtual

Removes the node from its list.

Warning
When a base list is removed the owner become responsible for freeing it or passing its ownership to another list.

Reimplemented in CTrack, CCurve, and BaseList4D.

◆ SetDescIDState()

Bool SetDescIDState ( const DescID id,
DESCIDSTATE  descidstate 
)

Sets the state for the description id.

Since
17.008
Parameters
[in]idThe description ID.
[in]descidstateThe new description ID state: DESCIDSTATE
Returns
true if the description ID state was successfully set, otherwise false.

◆ GetDescIDState()

DESCIDSTATE GetDescIDState ( const DescID id,
Bool  tolerant 
) const

Gets the state of a description id.

Since
17.008
Parameters
[in]idThe description ID.
[in]tolerantIf set to true a valid state is returned even though the description ID do not match-completly.
This can be useful for descriptions with several levels. Take this description ID for example:
DescID(DescLevel(1000, DTYPE_VECTOR, 0), DescLevel(1, DTYPE_REAL, 0))
If tolerant is true a valid state is returned even though only the following description ID is passed:
DescID(DescLevel(1000, DTYPE_VECTOR, 0))
Returns
The description ID state: DESCIDSTATE

◆ GetOverrideRoot()

RootPluginNode* GetOverrideRoot ( )

Private.

◆ GetFirstOverride()

BaseOverride* GetFirstOverride ( )

Private.

◆ TranslateDescID()

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

Private.

Reimplemented from GeListNode.

Friends And Related Function Documentation

◆ RootList2D

friend class RootList2D
friend

◆ RootShader

friend class RootShader
friend

◆ RootCKey

friend class RootCKey
friend

◆ RootCTrack

friend class RootCTrack
friend

◆ RootObject

friend class RootObject
friend

◆ RootMultipass

friend class RootMultipass
friend

◆ RootVideoPost

friend class RootVideoPost
friend

◆ BaseDocument

friend class BaseDocument
friend

◆ RootRenderData

friend class RootRenderData
friend

◆ BaseShader

friend class BaseShader
friend

◆ BaseList4D

friend class BaseList4D
friend

◆ BaseObject

friend class BaseObject
friend

◆ WeightTagData

friend class WeightTagData
friend

◆ RootBaseDraw

friend class RootBaseDraw
friend

◆ RootPluginNode

friend class RootPluginNode
friend

◆ BaseOverrideData

friend class BaseOverrideData
friend

◆ BaseSceneHook

friend class BaseSceneHook
friend

◆ PluginNode

friend class PluginNode
friend

Member Data Documentation

◆ m_name

String m_name
private

◆ mp_layer

BaseLink mp_layer
private

◆ m_marker

GeMarker m_marker
private

◆ l_uniquearray

UniqueIDArray* l_uniquearray
private

◆ dynamicdescription

DynamicDescription dynamicdescription
private

◆ m_id

Int32 m_id
protected

◆ mp_rootshader

RootShader mp_rootshader
protected

◆ root_shader_repository

RootShader root_shader_repository
protected

◆ l_bitfeld

Int32 l_bitfeld
protected

◆ mp_rootctrack

RootCTrack mp_rootctrack
protected

◆ root_override

RootPluginNode root_override
protected

◆ notify_events

NotifyList* notify_events
protected

◆ keyframestore

DescIdStore* keyframestore
protected

◆ propstore

DescIdStore* propstore
protected

◆ m_bc

BaseContainer m_bc
protected

◆ m_data

NodeData* m_data
protected