About
Volumes can be created and edited with specific commands and functions provided in the maxon::VolumeToolsInterface.
Commands
These commands can be used to handle volume data (see Commands Manual):
The maxon::VolumeCommandData structure has these members:
{
maxon::LegacyCommandDataRef context = maxon::LegacyCommandDataClasses::VOLUMEDATA().Create()
iferr_return;
data.
op = &sourceObjects;
const auto command = maxon::CommandClasses::MESHTOVOLUME();
if (result.
result.GetCount() == 2)
{
}
}
{
maxon::LegacyCommandDataRef context = maxon::LegacyCommandDataClasses::VOLUMEDATA().Create()
iferr_return;
data.
op = &sourceObjects;
const auto command = maxon::CommandClasses::BOOLE();
if (result.
result.GetCount() == 1)
{
}
}
{
maxon::LegacyCommandDataRef context = maxon::LegacyCommandDataClasses::VOLUMEDATA().Create()
iferr_return;
data.
op = &sourceObjects;
const auto command = maxon::CommandClasses::VOLUMETOMESH();
if (result.
result.GetCount() == 1)
{
}
}
Tools
The maxon::VolumeToolsInterface provides multiple functions to handle volumes.
Load volumes from files:
See also maxon::VolumeInterface::CreateFromFile() (VolumeInterface Manual).
Volume operations:
Volume creation:
Volume conversion:
{
const Vector*
const points = poly->GetPointR();
const CPolygon*
const polys = poly->GetPolygonR();
if (noPoints || noPolys)
const Int32 pointCount = poly->GetPointCount();
const Int32 polyCount = poly->GetPolygonCount();
const Matrix objectMatrix = poly->GetMg();
for (
Int32 pointIndex = 0; pointIndex < pointCount; ++pointIndex)
volPoints[pointIndex] = objectMatrix * points[pointIndex];
for (
Int32 polyIndex = 0; polyIndex < polyCount; polyIndex++)
{
if (polys[polyIndex].IsTriangle())
volPolys[polyIndex].SetTriangle();
}
if (thread == nullptr)
};
const maxon::Volume volumeA = PolyToVolume(polyObjectA)
iferr_return;
const maxon::Volume volumeB = PolyToVolume(polyObjectB)
iferr_return;
if (mesh == nullptr)
doc->InsertObject(mesh, nullptr, nullptr);
if (volumeObject == nullptr)
doc->InsertObject(volumeObject, nullptr, nullptr);
volumeObject->SetVolume(volume);
Further Reading
Definition: lib_volumeobject.h:40
BaseArray<::BaseObject * > * op
Definition: volumecommands.h:36
void InsertObject(BaseObject *op, BaseObject *parent, BaseObject *pred, Bool checknames=false)
Definition: c4d_baseobject.h:224
The maxon namespace contains all declarations of the MAXON API.
Definition: c4d_basedocument.h:15
@ OK
The command was executed properly.
Represents a polygon that can be either a triangle or a quadrangle.
Definition: c4d_baseobject.h:43
Matrix GetMg() const
Definition: c4d_baseobject.h:482
return OK
Definition: apibase.h:2546
@ BOOLETYPE
Int32 The Boole type (union, difference, intersection).
ResultMem Resize(Int newCnt, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::DEFAULT)
Definition: basearray.h:1077
static StrongRef< const ThreadInterface > GetCurrentThread()
Definition: thread.h:356
bool Bool
boolean type, possible values are only false/true, 8 bit
Definition: apibase.h:179
COMMANDRESULT
Defines the result of the command after execution.
Definition: commandbase.h:34
FIELDLAYER_FLAG flags
Definition: volumetools.h:142
#define iferr_return
Definition: resultbase.h:1465
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:66
Float64 Float
Definition: apibase.h:195
::FieldList * fieldList
Definition: volumetools.h:143
Matrix extraTransform
Definition: volumetools.h:141
@ GRIDSIZE
Float Grid voxel cube size.
@ ON_GROW_UNINITIALIZED
Do not initialize added elements (usually PODs) when resizing the array (is supported by all collecti...
Definition: apibase.h:316
COLLECTION_RESIZE_FLAGS
Flags for Resize(). Depending on the type of collection the flags might be ignored (except for ON_GRO...
Definition: collection.h:125
MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< T > Append()
Definition: basearray.h:569
BaseArray<::BaseObject * > result
Definition: volumecommands.h:41
Definition: volumetools.h:138
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:186
#define iferr_scope
Definition: resultbase.h:1374
maxon::Int32 Int32
Definition: ge_sys_math.h:60
static void Free(VolumeObject *&p)
Definition: lib_volumeobject.h:66
T _minValue
The inclusive minimum boundary of this range.
Definition: range.h:256
Definition: volumecommands.h:19
Definition: c4d_baseobject.h:1618
::BaseDocument * doc
Definition: volumetools.h:145
::BaseList2D * fieldOwner
Definition: volumetools.h:144
T _maxValue
The inclusive maximum boundary of this range. If the minimum boundary is not less than or equal to th...
Definition: range.h:257
#define MAXON_SCOPE
Definition: apibase.h:2659
Definition: volumetools.h:153