#include <c4d_basedocument.h>
This class allows to perform some functions on all of the objects in a hierarchy.
Example:
Public Member Functions | |
virtual void * | Alloc ()=0 |
virtual void | Free (void *data)=0 |
virtual void | CopyTo (void *src, void *dst)=0 |
virtual Bool | Do (void *data, BaseObject *op, const Matrix &mg, Bool controlobject)=0 |
Bool | Run (BaseDocument *doc, Bool spheres, Float lod, Bool uselod, BUILDFLAGS flags, void *startdata, BaseThread *bt) |
Private Attributes | |
BaseDocument * | doc |
BaseThread * | bt |
|
pure virtual |
Override the method to allocate the private data for a single level in the hierarchy.
Cinema 4D itself will pass the parent matrix but all other data that might be needed must be passed down the hierarchy using a private data structure and this is where it is allocated.
|
pure virtual |
Override the method so that the private data allocated in Alloc() can be freed.
[in,out] | data | The private data to free. |
|
pure virtual |
Override the method so that the private data can be copied.
[in] | src | The source private data to copy from. |
[out] | dst | The destination private data to copy to. |
|
pure virtual |
Override the method to be called for every object, virtual and non-virtual, in the hierarchy run.
[in] | data | The private data allocated in Alloc(). |
[in] | op | The object the function is being called for. |
[in] | mg | The global matrix for this object down the hierarchy chain. |
[in] | controlobject | If true then the object has been used by a generator and usually will no longer be used (but the routine goes through all objects in any case). |
Bool Run | ( | BaseDocument * | doc, |
Bool | spheres, | ||
Float | lod, | ||
Bool | uselod, | ||
BUILDFLAGS | flags, | ||
void * | startdata, | ||
BaseThread * | bt | ||
) |
Performs Do() on all objects (virtual and non-virtual) in the hierarchy.
Using this class will build all caches for dirty objects for the entire hierarchy, this can be time intensive and should be used carefully.
If a polygon object is needed it is generally faster to call SendModelingCommand() with MCOMMAND_CURRENTSTATETOOBJECT.
[in] | doc | The document with the objects you want to process. |
[in] | spheres | If true the process will not polygonize perfect spheres. |
[in] | lod | The level of detail to use. |
[in] | uselod | If true the level of detail lod should be evaluated. |
[in] | flags | The build flags are: BUILDFLAGS Note: Either BUILDFLAGS::INTERNALRENDERER or BUILDFLAGS::EXTERNALRENDERER must be set because some generators check for these flags and generate different results. For example the Metaball object has different settings in the edit dialog for internal and external rendering. |
[in] | startdata | The initial private data to pass into the hierarchy. |
[in] | bt | The custom thread, or nullptr if called from the main Cinema 4D thread. |
|
private |
|
private |