Index : Reference :

BaseList2D

A bidirectional linked list class.

Note: Only the additions made in CINEMA 4D R11 are listed here. Please refer to the C.O.F.F.E.E. CINEMA 4D R9.520 documentation for additional information of this class.

Example:
  
  // Inserts a newly created tag after another
  var tag = obj->GetFirstTag();
  var newTag = new(SmoothingTag);
  newTag->InsertAfter(tag);
  
  // Selects a key in the time line
  var key = obj->GetFirstTrack()->GetFirstSequence()->GetFirstKey();
  key->ToggleBit(BIT_AAMAN, TRUE);
  GeEventAdd(TIMELINE_CHANGED);
  

Definition

class BaseList2D
{
public:
  BaseList2D();

  CTrack GetFirstCTrack();
  bool InsertTrackSorted(CTrack track, CTrack track);

  int GetType();
  int GetDiskType();

  GeMarker GetMarker();

  BaseList2D GetNext();
  BaseList2D GetPrev();
  BaseList2D GetUp();
  BaseList2D GetDown();

  bool InsertBefore(BaseList2D bl);
  bool InsertAfter(BaseList2D bl);
  bool InsertUnder(BaseList2D parent);

  bool Remove();

  bool SetBit(int bit);
  bool GetBit(int bit);
  bool DelBit(int bit);
  bool ToggleBit(int bit);

  int GetAllBits(, );
  bool SetAllBits(int bits);

  int GetColor();
  bool SetColor(int col);

  bool Message(int type, anytype data  =  NULL);

  bool SetDirty(int flags);
  int GetDirty(int flags);
};

Inheritance

BaseList2D
  BaseDocument
  BaseMaterial
  BaseObject
    PointObject
      PolygonObject
      SplineObject
  BaseShader
  BaseTag
    PluginTag
      ExpressionPluginTag
    PointSelectionTag
    PolygonSelectionTag
    TextureTag
    VariableTag
  CCurve
  CKey
  CTrack
  RenderData

Members

BaseList2D()

Class Constructor

CTrack GetFirstCTrack()

Get the first track of this object.

Return
CTrack

First track, or class="silent">NULL if there are no tracks.

bool InsertTrackSorted(CTrack track, CTrack track)

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

Return
bool

TRUE if successful, otherwise FALSE.

Parameters
CTrack track

The track to insert.

int GetType()

Returns the type id of the object. This can be used to make sure that a variable really is of the right type before trying to access its members:

if (obj->GetType() != OBJECT_SPLINE) return;

For a list of the possible ids, please see the derived classes. Some objects have the same type id. For example, both position keys and position tracks have the id TRACK_POSITION. If one wants to distinguish between such objects, one can use the instanceof() command:

if (!instanceof(key, PositionKey)) return;

int GetDiskType()

Returns the object's unique disk type id. Normally this is the same as GetType(), but unlike the normal type id the disk type id is always unique. The disk type is used when saving objects to disk.

GeMarker GetMarker()

Returns a unique marker that can be used to locate the object during runtime. Markers are only only valid while the program is running.

BaseList2D GetNext()

Returns the next object in the linked list, or NULL if this is the last object.

BaseList2D GetPrev()

Returns the previous object in the linked list, or NULL if this is the first object.

BaseList2D GetUp()

Returns the parent of the object, or NULL if this is the topmost hierarchy level.

BaseList2D GetDown()

Returns the first children of the object, or NULL if there are no children.

bool InsertBefore(BaseList2D bl)

Inserts the object before bl in the list that bl is an element in. One must make sure that bl is already attached to a list and that the insertion is sane, i.e. one cannot insert a key into the object list. It is also necessary to use Remove() first if the object is already inserted into another list.

Return
bool

TRUE if successful, otherwise FALSE.

bool InsertAfter(BaseList2D bl)

Inserts the object after bl in the list bl bl is an element in. One must make sure that bl is already attached to a list and that the insertion is sane, i.e. one cannot insert a key into the object list. It is also necessary to use Remove() first if the object is already inserted into another list.

Return
bool

TRUE if successful, otherwise FALSE.

bool InsertUnder(BaseList2D parent)

Inserts the object as the first children of parent in the hierarchy that parent is an element in. One must make sure that parent is already attached to a hierarchy and that the insertion is sane, i.e. one cannot insert a parent under one of its children. It is also necessary to use Remove() first if the object is already inserted into another hierarchy.

Return
bool

TRUE if successful, otherwise FALSE.

bool Remove()

Removes the object from the list that it's currently attached to.

Return
bool

TRUE if successful, otherwise FALSE.

bool SetBit(int bit)

Each object contains a number of flags called bits. This function sets one of the bits, i.e. sets the flag to TRUE.

Return
bool

TRUE if successful, otherwise FALSE.

Parameters
int bit

Valid bits are:

Constant Description

BIT_ADOC

Active document

BIT_AMAT

Active material

BIT_ARDATA

Active render setting

BIT_ATAG

Active tag

BIT_AOBJ

Active object

BIT_ADIA

Active dia in the browser

BIT_AAMAN

Active element in the time line

BIT_MATMARK

Material used

BIT_OFOLD

Object folded in the object manager

BIT_AFOLD

Object folded in the time line

BIT_TFOLD

Track folded in the time line

BIT_AAMAN_PX

Point selected in space/time curve

BIT_AAMAN_PY

Point selected in space/time curve

BIT_AAMAN_PZ

Point selected in space/time curve

BIT_AAMAN_LX

Left tangent selected in space/time curve

BIT_AAMAN_LY

Left tangent selected in space/time curve

BIT_AAMAN_LZ

Left tangent selected in space/time curve

BIT_AAMAN_RX

Right tangent selected in space/time curve

BIT_AAMAN_RY

Right tangent selected in space/time curve

BIT_AAMAN_RZ

Right tangent selected in space/time curve


bool GetBit(int bit)

Returns the state of one of the object's bits.

Return
bool

TRUE if successful, otherwise FALSE.

Parameters
int bit

Valid bits are:

Constant Description

BIT_ADOC

Active document

BIT_AMAT

Active material

BIT_ARDATA

Active render setting

BIT_ATAG

Active tag

BIT_AOBJ

Active object

BIT_ADIA

Active dia in the browser

BIT_AAMAN

Active element in the time line

BIT_MATMARK

Material used

BIT_OFOLD

Object folded in the object manager

BIT_AFOLD

Object folded in the time line

BIT_TFOLD

Track folded in the time line

BIT_AAMAN_PX

Point selected in space/time curve

BIT_AAMAN_PY

Point selected in space/time curve

BIT_AAMAN_PZ

Point selected in space/time curve

BIT_AAMAN_LX

Left tangent selected in space/time curve

BIT_AAMAN_LY

Left tangent selected in space/time curve

BIT_AAMAN_LZ

Left tangent selected in space/time curve

BIT_AAMAN_RX

Right tangent selected in space/time curve

BIT_AAMAN_RY

Right tangent selected in space/time curve

BIT_AAMAN_RZ

Right tangent selected in space/time curve


bool DelBit(int bit)

Deletes one of the object's bits, i.e. sets the corresponding flag to class="silent" href="../BaseSound/enum_SOUND_stereo209.html#FALSE1">FALSE.

Return
bool

TRUE if successful, otherwise FALSE.

Parameters
int bit

Valid bits are:

Constant Description

BIT_ADOC

Active document

BIT_AMAT

Active material

BIT_ARDATA

Active render setting

BIT_ATAG

Active tag

BIT_AOBJ

Active object

BIT_ADIA

Active dia in the browser

BIT_AAMAN

Active element in the time line

BIT_MATMARK

Material used

BIT_OFOLD

Object folded in the object manager

BIT_AFOLD

Object folded in the time line

BIT_TFOLD

Track folded in the time line

BIT_AAMAN_PX

Point selected in space/time curve

BIT_AAMAN_PY

Point selected in space/time curve

BIT_AAMAN_PZ

Point selected in space/time curve

BIT_AAMAN_LX

Left tangent selected in space/time curve

BIT_AAMAN_LY

Left tangent selected in space/time curve

BIT_AAMAN_LZ

Left tangent selected in space/time curve

BIT_AAMAN_RX

Right tangent selected in space/time curve

BIT_AAMAN_RY

Right tangent selected in space/time curve

BIT_AAMAN_RZ

Right tangent selected in space/time curve


bool ToggleBit(int bit)

Toggles the state of one of the object's bits.

Return
bool

TRUE if successful, otherwise FALSE.

Parameters
int bit

Valid bits are:

Constant Description

BIT_ADOC

Active document

BIT_AMAT

Active material

BIT_ARDATA

Active render setting

BIT_ATAG

Active tag

BIT_AOBJ

Active object

BIT_ADIA

Active dia in the browser

BIT_AAMAN

Active element in the time line

BIT_MATMARK

Material used

BIT_OFOLD

Object folded in the object manager

BIT_AFOLD

Object folded in the time line

BIT_TFOLD

Track folded in the time line

BIT_AAMAN_PX

Point selected in space/time curve

BIT_AAMAN_PY

Point selected in space/time curve

BIT_AAMAN_PZ

Point selected in space/time curve

BIT_AAMAN_LX

Left tangent selected in space/time curve

BIT_AAMAN_LY

Left tangent selected in space/time curve

BIT_AAMAN_LZ

Left tangent selected in space/time curve

BIT_AAMAN_RX

Right tangent selected in space/time curve

BIT_AAMAN_RY

Right tangent selected in space/time curve

BIT_AAMAN_RZ

Right tangent selected in space/time curve


int GetAllBits(, )

Returns all of the object's bits as an integer.

Return
int
Constant Description

BIT_ADOC

Active document

BIT_AMAT

Active material

BIT_ARDATA

Active render setting

BIT_ATAG

Active tag

BIT_AOBJ

Active object

BIT_ADIA

Active dia in the browser

BIT_AAMAN

Active element in the time line

BIT_MATMARK

Material used

BIT_OFOLD

Object folded in the object manager

BIT_AFOLD

Object folded in the time line

BIT_TFOLD

Track folded in the time line

BIT_AAMAN_PX

Point selected in space/time curve

BIT_AAMAN_PY

Point selected in space/time curve

BIT_AAMAN_PZ

Point selected in space/time curve

BIT_AAMAN_LX

Left tangent selected in space/time curve

BIT_AAMAN_LY

Left tangent selected in space/time curve

BIT_AAMAN_LZ

Left tangent selected in space/time curve

BIT_AAMAN_RX

Right tangent selected in space/time curve

BIT_AAMAN_RY

Right tangent selected in space/time curve

BIT_AAMAN_RZ

Right tangent selected in space/time curve


bool SetAllBits(int bits)

Sets all of the object's bits at once to the state indicated by bits.

Return
bool

TRUE if successful, otherwise FALSE.

Parameters
int bits

Valid bits are:

Constant Description

BIT_ADOC

Active document

BIT_AMAT

Active material

BIT_ARDATA

Active render setting

BIT_ATAG

Active tag

BIT_AOBJ

Active object

BIT_ADIA

Active dia in the browser

BIT_AAMAN

Active element in the time line

BIT_MATMARK

Material used

BIT_OFOLD

Object folded in the object manager

BIT_AFOLD

Object folded in the time line

BIT_TFOLD

Track folded in the time line

BIT_AAMAN_PX

Point selected in space/time curve

BIT_AAMAN_PY

Point selected in space/time curve

BIT_AAMAN_PZ

Point selected in space/time curve

BIT_AAMAN_LX

Left tangent selected in space/time curve

BIT_AAMAN_LY

Left tangent selected in space/time curve

BIT_AAMAN_LZ

Left tangent selected in space/time curve

BIT_AAMAN_RX

Right tangent selected in space/time curve

BIT_AAMAN_RY

Right tangent selected in space/time curve

BIT_AAMAN_RZ

Right tangent selected in space/time curve


int GetColor()

Returns the color of the object. This is a palette number between 0 and 7, corresponding to one of the eight layers in the timeline.

bool SetColor(int col)

Sets the color of the object to col. The parameter should be a palette number between 0 and 7, corresponding to one of the eight layers in the timeline.

bool Message(int type, anytype data = NULL)

Sends a message to the object.

NOTCOLON() To send a message to all objects that are attached to the lists of a BaseDocument or a BaseObject, one can use the function MultiMessage() of each class.

Return
bool

TRUE if successful, otherwise FALSE.

Parameters
int type

Valid message types are:

Constant Description

MSG_POINTS_CHANGED

The number of points has changed or the points have been reordered. Include a VariableChanged object as data.

MSG_POLYGONS_CHANGED

The number of polygons has changed or the polygons have been reordered. Include a VariableChanged object as data.

MSG_SEGMENTS_CHANGED

The number of segments has changed or the segments have been reordered. Include a VariableChanged object as data.

MSG_BASECONTAINER

Used for custom messages. Include a BaseContainer object as data.

MSG_UPDATE

Notify object that something has changed, for example the position of a point.


anytype data = NULL

Additional data passed along with the message.
The type depends on the message type.

bool SetDirty(int flags)

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

Return
bool

TRUE if successful, otherwise FALSE.

Parameters
int flags

Flags (where applicable):

Constant Description

DIRTY_MATRIX

Matrix changed.

DIRTY_DATA

Container changed.

DIRTY_SELECT

Checks all valid selections of the object, e.g. points, edge, polys.

DIRTY_CACHE

Checks if the cache of an object has been changed (rebuilt).

DIRTY_CHILDREN

Checks if the children are dirty.


int GetDirty(int flags)

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

Return
int

The checksum.

Parameters
int flags

Flags (where applicable):

Constant Description

DIRTY_MATRIX

Matrix changed.

DIRTY_DATA

Container changed.

DIRTY_SELECT

Checks all valid selections of the object, e.g. points, edge, polys.

DIRTY_CACHE

Checks if the cache of an object has been changed (rebuilt).

DIRTY_CHILDREN

Checks if the children are dirty.




Copyright 2014 MAXON. See Plugin Cafe for the latest version. Last modified: 2014-10-03