About
A maxon::VolumeInterface is used to store and handle volume data. It is typically obtained from a VolumeObject, see VolumeObject Manual.
VolumeInterface
Volume information can be stored in a file:
if (volumeObj == nullptr)
The grid settings are accessed with:
const maxon::Volume volume = volumeObject->
GetVolume();
if (volume.HasGrid())
{
const GRIDCLASS gridClass = volume.GetGridClass();
}
Iterator
The data stored in a volume is accessed with the maxon::GridIteratorInterface iterator:
const maxon::Volume volume = volumeObject->
GetVolume();
for (; iterator.IsNotAtEnd(); iterator.StepNext())
{
const Float32 value = iterator.GetValue();
pos = transform * pos;
}
Accessor
The grid accessor can be used to both retrieve and set the volume data:
Volume data is accessed with:
if (volumeObj == nullptr)
volume.SetGridName("Example Grid"_s);
const
Vector scaleFactor { 10.0 };
const
Float scale = 100.0;
const
Float scaleY = 10.0;
while (offset < 50.0)
{
offset = offset + 0.01;
}
Further Reading