#include <c4d_baselist.h>
An array of C4DAtom objects.
- Note
- Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
◆ AtomArray()
◆ ~AtomArray()
◆ Alloc()
Allocates an atom array. Destroy the allocated atom array with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Returns
- The allocated atom array, or nullptr if the allocation failed.
◆ Free()
Destructs atom arrays allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Parameters
-
[in,out] | obj | The atom array to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
◆ GetCount() [1/2]
Int32 GetCount |
( |
void |
| ) |
const |
Gets the number of atoms in the array.
- Returns
- The atom count.
◆ GetCount() [2/2]
Checks how many elements in the array match type and/or instance.
- Parameters
-
- Returns
- The number of matches.
◆ GetIndex()
Gets the atom at the position idx in the array.
- Parameters
-
[in] | idx | The index. Must be between 0 and GetCount(). |
- Returns
- The idx-th atom in the array. The atom array owns the pointed object.
◆ Append() [1/2]
Appends obj to the array.
- Parameters
-
[in] | obj | The atom to append to the array. Only the pointer is stored; the actual ownership remains with the caller. |
- Returns
- true if the atom was appended, otherwise false.
◆ Flush()
◆ Remove()
Removes obj from the array.
- Parameters
-
[in] | obj | The atom to remove from the array. Only the pointer is removed; the object is not freed. |
- Returns
- true if successful, otherwise false.
◆ CopyTo()
Copies all atoms in *this
to *dest.
- Parameters
-
[out] | dest | The destination array. The caller owns the pointed object. |
- Returns
- true if the atom array was copied, otherwise false.
◆ CopyToFilter()
Copies all atoms in *this
to *dest filtered by type and/or instance.
- Parameters
-
[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. |
- Returns
- true if the atom array was copied, otherwise false.
◆ GetUserID()
Int32 GetUserID |
( |
void |
| ) |
const |
Gets the user ID of the array.
- Returns
- This array's user ID.
◆ SetUserID()
void SetUserID |
( |
Int32 |
t_userid | ) |
|
Sets the user ID of the array to t_userid.
- Parameters
-
[in] | t_userid | The new user ID. |
◆ GetUserData()
void* GetUserData |
( |
| ) |
const |
Gets the user data pointer stored with the array.
- Returns
- The user data pointer. Not managed by the atom array.
◆ SetUserData()
void SetUserData |
( |
void * |
t_userdata | ) |
|
Store a user data pointer with the array.
- Parameters
-
[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.
- Note
- This is not always set. In that case for example use the first object.
- Returns
- 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.
- See also
- GetPreferred()
- Parameters
-
[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.
- Parameters
-
◆ 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.
- Parameters
-
[in] | src | The source array to append. The caller owns the pointed object. |
- Returns
- true if successful, otherwise false.
◆ Find()
Finds the index of obj in the array.
- Parameters
-
[in] | obj | The atom to search for. |
- Returns
- The index, or NOTOK if not found.
◆ Compare()
Compares the array with cmp.
- Parameters
-
[in] | cmp | The atom array to compare with. The caller owns the pointed object. |
- Returns
- true if both arrays are identical, otherwise false.