TakeData Class Reference Library » Take System Library

#include <lib_takesystem.h>

详细描述

Stores the Take System related data of a BaseDocument .

另请参阅
The TakeData Manual overview article.

私有成员函数

  TakeData ()
  ~TakeData ()

杂项

Bool   Set ( BaseDocument *doc)
BaseDocument GetDocument ()
BaseTake GetMainTake ()
TAKE_MODE   GetTakeMode ()
BaseOverride FindOverrideCounterPart ( BaseOverride *overrideNode, const DescID &descID, BaseTake *&resultTake)
void  SendNodeToRepository ( BaseList2D *parent, BaseList2D *node)
BaseList2D GetNodeFromRepository ( BaseList2D *parent, BaseList2D *node)
void  ResetSystem ()

Override Enabling

OVERRIDEENABLING   GetOverrideEnabling ()
Bool   CheckOverrideEnabling ( OVERRIDEENABLING mask)

Take

void  GetTakeSelection ( AtomArray &selection, Bool children)
BaseTake GetCurrentTake ()
Bool   SetCurrentTake ( BaseTake *take)
BaseDocument TakeToDocument ( BaseTake *take)
Bool   SaveTakesWithAssets ( Bool selected)
BaseTake AddTake (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)

构造函数 & 析构函数文档编制

◆  TakeData()

TakeData () private

◆  ~TakeData()

~ TakeData () private

成员函数文档编制

◆  Set()

Bool Set ( BaseDocument doc )

Sets the internal document link for the TakeData . Private .

参数
[in] doc The document to attach to the TakeData . The caller owns the pointed BaseDocument .
返回
true if successful, otherwise false .

◆  GetDocument()

BaseDocument * GetDocument ( )

Retrieves the document for the TakeData .

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

◆  GetMainTake()

BaseTake * GetMainTake ( )

Retrieves the Main Take.

注意
Main Take is always the first under the header.
返回
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 .

注意
This mode affects how the user has to interact with GUI to override parameters.
返回
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.

返回
The Take System override enabling: OVERRIDEENABLING

◆  CheckOverrideEnabling()

Bool CheckOverrideEnabling ( OVERRIDEENABLING   mask )

Checks for a specific OVERRIDEENABLING .

参数
[in] mask The Take System override enabling mask: OVERRIDEENABLING
返回
true OVERRIDEENABLING is set otherwise false .

◆  GetTakeSelection()

void GetTakeSelection ( AtomArray selection ,
Bool   children  
)

Retrieves all the selected Takes.

参数
[in] selection An AtomArray to be filled with the selected Takes.
[in] children true also selected Take children are collected.

◆  GetCurrentTake()

BaseTake * GetCurrentTake ( )

Retrieves a pointer to the current Take.

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

◆  SetCurrentTake()

Bool SetCurrentTake ( BaseTake take )

Sets the current Take.

注意
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 ).
参数
[in] take The Take to set. If nullptr is passed the Main Take will be set. The caller owns the pointed BaseTake .
返回
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.

注意
The caller has to insert the document if necessary.
参数
[in] take The Take to isolate. The caller owns the pointed BaseTake .
返回
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.

参数
[in] selected true only selected Takes are exported otherwise all.
返回
true if successful, otherwise false .

◆  AddTake()

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

Creates and inserts a new Take.

注意
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 ).
警告
Selections have to be handled manually.
参数
[in] name The name of the Take to add. If an empty string is passed default Take name will be used.
[in] parent Optionally 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] cloneFrom Optionally pass a Take the new Take will be cloned from. The caller owns the pointed BaseTake .
返回
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.

注意
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 ).
参数
[in] take The 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.

注意
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 ).
参数
[in] takeToMove The Take to move. The caller owns the pointed BaseTake .
[in] destTake The 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] insertMode The 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).

参数
[in] overrideNode The original Override node. The caller owns the pointed BaseOverride .
[in] descID The description ID to check.
[out] resultTake The Take that owns the returned node, or nullptr if no counterpart found. Cinema 4D owns the pointed BaseOverride .
返回
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.

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

◆  SetUndoState()

void SetUndoState ( Bool   state )

Activates or deactivates the state of automatic Take undo.

注意
It is useful to deactivate undo when working on document clones in several situation like import/export operations where undo is not important.
参数
[in] state true if the automatic undo has to be used, otherwise false .

◆  ResetSystem()

void ResetSystem ( )

Resets completely the Take System. Usually not needed.

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