C4DObjectList Class Reference Library » Editor Tools

#include <lib_editortools.h>

详细描述

A class representing a set of objects in the editor.
Most often allocate a copy of this object and then let SelectionListCreate() fill it.

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

私有成员函数

  C4DObjectList ()
  ~C4DObjectList ()

Alloc/Free

static C4DObjectList Alloc ()
static void  Free ( C4DObjectList *&ptr)

对象列表

Int32   GetCount ()
BaseObject GetObject ( Int32 num)
Float   GetZ ( Int32 num)
Int32   GetPolyIdx ( Int32 num)
Bool   AddObject ( BaseObject *op, Float z, Int32 polynum)
void  Flush ()

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

◆  C4DObjectList()

C4DObjectList () private

◆  ~C4DObjectList()

~ C4DObjectList () private

成员函数文档编制

◆  Alloc()

static C4DObjectList * Alloc ( )
static

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

返回
The allocated object list, or nullptr if the allocation failed.

◆  Free()

static void Free ( C4DObjectList *&  ptr )
static

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

参数
[in,out] ptr The object list to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  GetCount()

Int32 GetCount ( )

Get the number of objects stored in the list.

返回
The number of objects.

◆  GetObject()

BaseObject * GetObject ( Int32   num )

Gets a stored object pointer by index.

参数
[in] num An object index: 0 <= num < GetCount()
返回
The object at index num . Cinema 4D owns the pointed object.

◆  GetZ()

Float GetZ ( Int32   num )

Gets the Z distance to a stored object by index.

参数
[in] num An object index: 0 <= num < GetCount()
返回
The Z distance to the object at index num .

◆  GetPolyIdx()

Int32 GetPolyIdx ( Int32   num )

Gets the polygon index of a stored object by index.

参数
[in] num An object index: 0 <= num < GetCount()
返回
The polygon index.

◆  AddObject()

Bool AddObject ( BaseObject op ,
Float   z ,
Int32   polynum  
)

Adds an object to the list at a certain Z distance.

参数
[in] op The object to add. The caller owns the pointed object.
[in] z The Z distance to op .
[in] polynum The number of polygons.
返回
true if successful, otherwise false .

◆  Flush()

void Flush ( )

Clears the object list.