-
首页
-
C4D R23.110 C++ SDK
AtomArray Class Reference
#include <c4d_baselist.h>
详细描述
An array of
C4DAtom
对象。
-
注意
-
Has to be created with
Alloc()
and destroyed with
Free()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
构造函数 & 析构函数文档编制
◆
AtomArray()
◆
~AtomArray()
成员函数文档编制
◆
Alloc()
Allocates an atom array. Destroy the allocated atom array with
Free()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
返回
-
The allocated atom array, or
nullptr
if the allocation failed.
◆
Free()
Destructs atom arrays allocated with
Alloc()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
参数
-
[in,out]
|
obj
|
The atom array to destruct. If the pointer is
nullptr
nothing happens. The pointer is assigned
nullptr
afterwards.
|
◆
GetCount()
[1/2]
Gets the number of atoms in the array.
-
返回
-
The atom count.
◆
GetCount()
[2/2]
Checks how many elements in the array match
type
and/or
instance
.
-
参数
-
-
返回
-
The number of matches.
◆
GetIndex()
Gets the atom at the position
idx
in the array.
-
参数
-
[in]
|
idx
|
The index. Must be between
0
and
GetCount()
.
|
-
返回
-
The
idx
-th atom in the array. The atom array owns the pointed object.
◆
Append()
[1/2]
Appends
obj
to the array.
-
参数
-
[in]
|
obj
|
The atom to append to the array. Only the pointer is stored; the actual ownership remains with the caller.
|
-
返回
-
true
if the atom was appended, otherwise
false
.
◆
Flush()
Clears the atom array.
◆
Remove()
Removes
obj
from the array.
-
参数
-
[in]
|
obj
|
The atom to remove from the array. Only the pointer is removed; the object is not freed.
|
-
返回
-
true
if successful, otherwise
false
.
◆
CopyTo()
Copies all atoms in
*this
to
*dest
.
-
参数
-
[out]
|
dest
|
The destination array. The caller owns the pointed object.
|
-
返回
-
true
if the atom array was copied, otherwise
false
.
◆
CopyToFilter()
Copies all atoms in
*this
to
*dest
filtered by
type
and/or
instance
.
-
参数
-
[out]
|
dest
|
The destination array. The caller owns the pointed object.
|
[in]
|
type
|
Checked against
C4DAtom::GetType()
. Pass
NOTOK
to ignore this test.
|
[in]
|
instance
|
Checked against
C4DAtom::IsInstanceOf()
. Pass
NOTOK
to ignore this test.
|
[in]
|
generators
|
Used to filter generators.
|
-
返回
-
true
if the atom array was copied, otherwise
false
.
◆
GetUserID()
Int32
GetUserID
|
(
|
|
)
|
const
|
Gets the user ID of the array.
-
返回
-
This array's user ID.
◆
SetUserID()
void SetUserID
|
(
|
Int32
|
t_userid
|
)
|
|
Sets the user ID of the array to
t_userid
.
-
参数
-
[in]
|
t_userid
|
The new user ID.
|
◆
GetUserData()
void* GetUserData
|
(
|
|
)
|
const
|
Gets the user data pointer stored with the array.
-
返回
-
The user data pointer. Not managed by the atom array.
◆
SetUserData()
void SetUserData
|
(
|
void *
|
t_userdata
|
)
|
|
Store a user data pointer with the array.
-
参数
-
[in]
|
t_userdata
|
The new user data pointer. Not manager by the atom array.
|
◆
GetPreferred()
The preferred object is the one to use for operations that require a single object.
For example, if the user drags many objects to a link field this is used.
-
注意
-
This is not always set. In that case for example use the first object.
-
返回
-
The preferred object to use for single object actions. The array owns the pointed object..
◆
SetPreferred()
void SetPreferred
|
(
|
C4DAtom
*
|
t_preferred
|
)
|
|
Sets the preferred object.
-
另请参阅
-
GetPreferred()
-
参数
-
[in]
|
t_preferred
|
The new preferred object. Must already be in the array.
|
◆
FilterObject()
void FilterObject
|
(
|
Int32
|
type
,
|
|
|
Int32
|
instance
,
|
|
|
Bool
|
generators
=
false
|
|
)
|
|
|
Removes objects that do not match the filter given by
type
and
instance
.
-
参数
-
◆
FilterObjectChildren()
void FilterObjectChildren
|
(
|
|
)
|
|
Removes all objects that has a parent (or ancestor) in the array.
◆
Append()
[2/2]
Appends all objects in
src
to the array.
-
参数
-
[in]
|
src
|
The source array to append. The caller owns the pointed object.
|
-
返回
-
true
if successful, otherwise
false
.
◆
Find()
Finds the index of
obj
in the array.
-
参数
-
[in]
|
obj
|
The atom to search for.
|
-
返回
-
The index, or
NOTOK
if not found.
◆
Compare()
Compares the array with
cmp
.
-
参数
-
[in]
|
cmp
|
The atom array to compare with. The caller owns the pointed object.
|
-
返回
-
true
if both arrays are identical, otherwise
false
.