TakeData Class Reference

#include <lib_takesystem.h>

Detailed Description

Stores the Take System related data of a BaseDocument.

See also
The TakeData Manual overview article.

Private Member Functions

 TakeData ()
 
 ~TakeData ()
 

Miscellaneous

Bool Set (BaseDocument *doc)
 
BaseDocumentGetDocument ()
 
BaseTakeGetMainTake ()
 
TAKE_MODE GetTakeMode ()
 
BaseOverrideFindOverrideCounterPart (BaseOverride *overrideNode, const DescID &descID, BaseTake *&resultTake)
 
void SendNodeToRepository (BaseList2D *parent, BaseList2D *node)
 
BaseList2DGetNodeFromRepository (BaseList2D *parent, BaseList2D *node)
 
void ResetSystem ()
 

Override Enabling

OVERRIDEENABLING GetOverrideEnabling ()
 
Bool CheckOverrideEnabling (OVERRIDEENABLING mask)
 

Take

void GetTakeSelection (AtomArray &selection, Bool children)
 
BaseTakeGetCurrentTake ()
 
Bool SetCurrentTake (BaseTake *take)
 
BaseDocumentTakeToDocument (BaseTake *take)
 
Bool SaveTakesWithAssets (Bool selected)
 
BaseTakeAddTake (const String &name, BaseTake *parent, BaseTake *cloneFrom)
 
void DeleteTake (BaseTake *take)
 
void InsertTake (BaseTake *takeToMove, BaseTake *destTake, Int32 insertMode)
 

Undo

Bool GetUndoState ()
 
void SetUndoState (Bool state)
 

Constructor & Destructor Documentation

◆ TakeData()

TakeData ( )
private

◆ ~TakeData()

~TakeData ( )
private

Member Function Documentation

◆ Set()

Bool Set ( BaseDocument doc)

Sets the internal document link for the TakeData. Private.

Parameters
[in]docThe document to attach to the TakeData. The caller owns the pointed BaseDocument.
Returns
true if successful, otherwise false.

◆ GetDocument()

BaseDocument* GetDocument ( )

Retrieves the document for the TakeData.

Returns
The document, or nullptr if TakeData is not initialized. Cinema 4D owns the pointed BaseDocument.

◆ GetMainTake()

BaseTake* GetMainTake ( )

Retrieves the Main Take.

Note
Main Take is always the first under the header.
Returns
The Main Take. Must be !nullptr.

◆ GetTakeMode()

TAKE_MODE GetTakeMode ( )

Retrieves the Take System global mode, can be TAKE_MODE::MANUAL or TAKE_MODE::AUTO.

Note
This mode affects how the user has to interact with GUI to override parameters.
Returns
The Take System mode: TAKE_MODE

◆ GetOverrideEnabling()

OVERRIDEENABLING GetOverrideEnabling ( )

Retrieves the ability for the Take System to override a specific kind of node based on global switch.

Returns
The Take System override enabling: OVERRIDEENABLING

◆ CheckOverrideEnabling()

Bool CheckOverrideEnabling ( OVERRIDEENABLING  mask)

Checks for a specific OVERRIDEENABLING.

Parameters
[in]maskThe Take System override enabling mask: OVERRIDEENABLING
Returns
true if the OVERRIDEENABLING is set otherwise false.

◆ GetTakeSelection()

void GetTakeSelection ( AtomArray selection,
Bool  children 
)

Retrieves all the selected Takes.

Parameters
[in]selectionAn AtomArray to be filled with the selected Takes.
[in]childrenIf true also selected Take children are collected.

◆ GetCurrentTake()

BaseTake* GetCurrentTake ( )

Retrieves a pointer to the current Take.

Returns
The current Take, or nullptr if any error. Cinema 4D owns the pointed BaseTake.

◆ SetCurrentTake()

Bool SetCurrentTake ( BaseTake take)

Sets the current Take.

Note
An undo step is added automatically if the call is added from the main (GUI) thread and global undo is allowed (see TakeData::GetUndoState/ TakeData::SetUndoState).
Parameters
[in]takeThe Take to set. If nullptr is passed the Main Take will be set. The caller owns the pointed BaseTake.
Returns
true if successful, otherwise false.

◆ TakeToDocument()

BaseDocument* TakeToDocument ( BaseTake take)

Isolates a Take in a new document.The new document will be allocated and filled by the function.

Note
The caller has to insert the document if necessary.
Parameters
[in]takeThe Take to isolate. The caller owns the pointed BaseTake.
Returns
The allocated BaseDocument.

◆ SaveTakesWithAssets()

Bool SaveTakesWithAssets ( Bool  selected)

Executes a "Save Project With Assets" for Takes in document with each saved file representing a Take.

Parameters
[in]selectedIf true only selected Takes are exported otherwise all.
Returns
true if successful, otherwise false.

◆ AddTake()

BaseTake* AddTake ( const String name,
BaseTake parent,
BaseTake cloneFrom 
)

Creates and inserts a new Take.

Note
An undo step is added automatically if the call is added from the main (GUI) thread and global undo is allowed (see TakeData::GetUndoState/ TakeData::SetUndoState).
Warning
Selections have to be handled manually.
Parameters
[in]nameThe name of the Take to add. If an empty string is passed default Take name will be used.
[in]parentOptionally pass a parent Take otherwise new Take will be added at the end of the list under the Main Take. The caller owns the pointed BaseTake.
[in]cloneFromOptionally pass a Take the new Take will be cloned from. The caller owns the pointed BaseTake.
Returns
The new Take. Must be !nullptr.

◆ DeleteTake()

void DeleteTake ( BaseTake take)

Deletes a Take and all connected overrides. If Take is the current the Main Take will be set as current.

Note
An undo step is added automatically if the call is added from the main (GUI) thread and global undo is allowed (see TakeData::GetUndoState/ TakeData::SetUndoState).
Parameters
[in]takeThe Take to delete. The caller owns the pointed BaseTake.

◆ InsertTake()

void InsertTake ( BaseTake takeToMove,
BaseTake destTake,
Int32  insertMode 
)

Moves a Take in the hierarchy in a safe way.
The Take system has several hierarchy dependencies.
If a Take is moved while it is current or while it is a child of the Current Take then this would need to manually take care of all data sorting and handling.
This function do all this work for you.

Note
An undo step is added automatically if the call is added from the main (GUI) thread and global undo is allowed (see TakeData::GetUndoState/ TakeData::SetUndoState).
Parameters
[in]takeToMoveThe Take to move. The caller owns the pointed BaseTake.
[in]destTakeThe parent destination Take. If nullptr the Main Take will be used. In this case NOTOK can be used as the insert mode to add the take as the last child of the main take. The caller owns the pointed BaseTake.
[in]insertModeThe insertion mode. Can be INSERT_BEFORE or INSERT_AFTER or INSERT_UNDER.

◆ FindOverrideCounterPart()

BaseOverride* FindOverrideCounterPart ( BaseOverride overrideNode,
const DescID descID,
BaseTake *&  resultTake 
)

Finds the backup node that fits with an Override (for example the backup node in the Main Take).

Parameters
[in]overrideNodeThe original Override node. The caller owns the pointed BaseOverride.
[in]descIDThe description ID to check.
[out]resultTakeThe Take that owns the returned node, or nullptr if no counterpart found. Cinema 4D owns the pointed BaseOverride.
Returns
The counterpart node, or nullptr if any error.

◆ SendNodeToRepository()

void SendNodeToRepository ( BaseList2D parent,
BaseList2D node 
)

Private.

◆ GetNodeFromRepository()

BaseList2D* GetNodeFromRepository ( BaseList2D parent,
BaseList2D node 
)

Private.

◆ GetUndoState()

Bool GetUndoState ( )

Gets the state of automatic Take undo.

Note
It is useful to deactivate undo when working on document clones in several situation like import/export operations where undo is not important.
Returns
true if the automatic undo is active, otherwise false.

◆ SetUndoState()

void SetUndoState ( Bool  state)

Activates or deactivates the state of automatic Take undo.

Note
It is useful to deactivate undo when working on document clones in several situation like import/export operations where undo is not important.
Parameters
[in]statetrue if the automatic undo has to be used, otherwise false.

◆ ResetSystem()

void ResetSystem ( )

Resets completely the Take System. Usually not needed.

Warning
All data not in the current state of the document are deleted.