#include <c4d_basedocument.h>
This class allows to perform some functions on all of the objects in a hierarchy.
Example:
struct ExampleStruct
{
};
{
public:
virtual void Free(
void *data) { ExampleStruct *es = (ExampleStruct*)data;
DeleteObj(es); }
virtual void CopyTo(
void *
src,
void *dst) { *(
static_cast<ExampleStruct*
>(dst)) = *
static_cast<ExampleStruct*
>(
src); }
};
{
ExampleStruct* dt = (ExampleStruct*)data;
if (controlobject)
return true;
return true;
return true;
}
Definition: c4d_baseobject.h:248
Definition: c4d_basedocument.h:1688
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
PyObject * src
Definition: abstract.h:305
const wchar_t * mode
Definition: fileutils.h:96
maxon::Bool Bool
Definition: ge_sys_math.h:51
maxon::Int32 Int32
Definition: ge_sys_math.h:56
#define MODE_UNDEF
The object is enabled by default, but the state of any parent object is used if it is enabled or disa...
Definition: c4d_baseobject.h:37
#define Opolygon
Polygon - PolygonObject.
Definition: ge_prepass.h:1042
#define DeleteObj(obj)
Definition: newobj.h:159
#define NewObjPtr(T,...)
Deprecated.
Definition: newobj.h:113
PyObject * op
Definition: object.h:520
|
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) |
|
◆ Alloc()
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.
- Returns
- The private data that is allocated.
◆ Free()
virtual void Free |
( |
void * |
data | ) |
|
|
pure virtual |
Override the method so that the private data allocated in Alloc() can be freed.
- Parameters
-
[in,out] | data | The private data to free. |
◆ CopyTo()
virtual void CopyTo |
( |
void * |
src, |
|
|
void * |
dst |
|
) |
| |
|
pure virtual |
Override the method so that the private data can be copied.
- Parameters
-
[in] | src | The source private data to copy from. |
[out] | dst | The destination private data to copy to. |
◆ Do()
Override the method to be called for every object, virtual and non-virtual, in the hierarchy run.
- Parameters
-
[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). |
- Returns
- true if the function was successful and the run through the hierarchy should continue, otherwise false.
◆ Run()
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.
- Parameters
-
[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. |
- Returns
- The success of calling Do() for each object.
◆ doc
◆ bt