AliasTrans Class Reference

#include <c4d_baselist.h>

详细描述

An alias translator class.

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

The alias translator takes care about reconnecting BaseLink links when cloning, copying, reading or writing objects.
Normally Cinema 4D will provide an alias translator when needed, for example in NodeData::CopyTo() . However, to copy objects manually use:

AutoAlloc<AliasTrans> aliastrans; if (!aliastrans || !aliastrans-> Init (document)) return false ; dup = op-> GetClone ( COPYFLAGS::NONE , aliastrans); if (!dup) return false ; aliastrans-> Translate ( true );

私有成员函数

  AliasTrans ()
  ~AliasTrans ()

Alloc/Free

static AliasTrans Alloc ()
static void  Free ( AliasTrans *&link)

Init and Translate

Bool   Init ( BaseDocument *doc)
void  Translate ( Bool connect_oldgoals)

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

◆  AliasTrans()

AliasTrans () private

◆  ~AliasTrans()

~ AliasTrans () private

成员函数文档编制

◆  Alloc()

static AliasTrans * Alloc ( )
static

Allocates an alias translator. Destroy the allocated alias translator with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

返回
The allocated alias translator, or nullptr if the allocation failed.

◆  Free()

static void Free ( AliasTrans *&  link )
static

Destructs alias translators allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] link The alias translator to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  Init()

Bool Init ( BaseDocument doc )

Initializes the alias translator in the specified document doc .

参数
[in] doc The document. The caller owns the pointed object.
返回
true if the alias translator was initialized, otherwise false .

◆  Translate()

void Translate ( Bool   connect_oldgoals )

Translates the links in all objects that the translator has come across.

参数
[in] connect_oldgoals Connect old goals.
For example: Take a cube with an instance linked to this cube, select both and duplicate them in one action.
The new cube is linked to the new instance if connect_oldgoals is true . If it is false the new instance is linked to the old cube.
C4DAtom::GetClone
C4DAtom * GetClone(COPYFLAGS flags, AliasTrans *trn)
定义: c4d_baselist.h:1417
AliasTrans::Init
Bool Init(BaseDocument *doc)
定义: c4d_baselist.h:3010
AliasTrans::Translate
void Translate(Bool connect_oldgoals)
定义: c4d_baselist.h:3018
AutoAlloc
定义: ge_autoptr.h:36
COPYFLAGS::NONE
@ NONE
None.