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:
  
  
 
 
  
  VolumeObject* const volumeObj = VolumeObject::Alloc();
  if (volumeObj == nullptr)
 
  doc->InsertObject(volumeObj, 
nullptr, 
nullptr);
 
 
  
  volumeObj->SetVolume(volume);
static MAXON_METHOD Result< Volume > CreateFromFile(const Url &url, Float scale, Int gridIndex)
 
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:187
 
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
 
const char * doc
Definition: pyerrors.h:226
 
#define iferr_return
Definition: resultbase.h:1531
 
 The grid settings are accessed with:
  
 
  
  const maxon::Volume volume = volumeObject->GetVolume();
 
  
  if (volume.HasGrid())
  {
 
  }
Definition: string.h:1287
 
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:170
 
GRIDCLASS
Volume Classes.
Definition: volume.h:33
 
  
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())
 
  {
    
    
 
 
    
 
  }
PyObject * value
Definition: abstract.h:715
 
Definition: volumeiterators.h:28
 
void Py_ssize_t * pos
Definition: dictobject.h:50
 
for(i=0;i< length;i++)
Definition: unicodeobject.h:61
 
static auto Create(ARGS &&... args)
Definition: apibase.h:2823
 
maxon::Float32 Float32
Definition: ge_sys_math.h:59
 
maxon::Vec3< maxon::Float64, 1 > Vector
Definition: ge_math.h:140
 
A vector consisting of three components X, Y and Z.
Definition: vec.h:21
 
  
Accessor
The grid accessor can be used to both retrieve and set the volume data:
Volume data is accessed with:
  
  
 
  
  VolumeObject* const volumeObj = VolumeObject::Alloc();
  if (volumeObj == nullptr)
 
  doc->InsertObject(volumeObj, 
nullptr, 
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;
  }
 
  
  volumeObj->SetVolume(volume);
Definition: volumeaccessors.h:24
 
FOG
Definition: ge_prepass.h:2
 
Float64 Float
Definition: apibase.h:196
 
int32_t Int32
32 bit signed integer datatype.
Definition: apibase.h:175
 
double Float64
64 bit floating point value (double)
Definition: apibase.h:182
 
MAXON_ATTRIBUTE_FORCE_INLINE void SinCos(Float32 val, Float32 &sn, Float32 &cs)
Calculates both sine and cosine of a value.
Definition: apibasemath.h:474
 
GRIDCLASS
Volume Classes.
Definition: ge_prepass.h:1931
 
The maxon namespace contains all declarations of the Maxon API.
Definition: autoweight.h:21
 
VOLUMESAMPLER
Definition: volumeaccessors.h:16
 
  
Further Reading