GridAccessorInterface< TYPE > Class Template Reference

#include <volumeaccessors.h>

详细描述

template<typename TYPE>
class maxon::GridAccessorInterface< TYPE >

GridAccessorInterface allows to access volume data.

公共成员函数

MAXON_METHOD Result < void >  Init (const Volume &volumeObject, VOLUMESAMPLER sampler= VOLUMESAMPLER::NEAREST )
MAXON_METHOD Result < void >  InitWithWriteAccess (Volume &volumeObject, VOLUMESAMPLER sampler= VOLUMESAMPLER::NEAREST )
MAXON_METHOD Result < void >  SetSampler ( VOLUMESAMPLER sampler)
MAXON_METHOD TYPE  GetValue (const IntVector32 &coords) const
MAXON_METHOD TYPE  GetValue (const 向量 &position) const
MAXON_METHOD 向量   GetCoords (const 向量 &position) const
MAXON_METHOD Result < void >  SetValue (const IntVector32 &coords, const TYPE val)
MAXON_METHOD Result < void >  SetValueOnly (const IntVector32 &coords, const TYPE val)
MAXON_METHOD Result < void >  SetActiveState (const IntVector32 &coords, Bool state)
MAXON_METHOD Bool   GetActiveState (const IntVector32 &coords) const

静态公共成员函数

static MAXON_FUNCTION Result < GridAccessorRef < TYPE > >  创建 ()

私有成员函数

  MAXON_INTERFACE_SIMPLE_VIRTUAL ( GridAccessorInterface , MAXON_REFERENCE_NORMAL )

成员函数文档编制

◆  MAXON_INTERFACE_SIMPLE_VIRTUAL()

MAXON_INTERFACE_SIMPLE_VIRTUAL ( GridAccessorInterface < TYPE >  ,
MAXON_REFERENCE_NORMAL    
)
private

◆  Create()

static MAXON_FUNCTION Result < GridAccessorRef <TYPE> > Create ( )
static

◆  Init()

MAXON_METHOD Result <void> Init ( const Volume &  volumeObject ,
VOLUMESAMPLER   sampler = VOLUMESAMPLER::NEAREST  
)

Initialize the accessor with a volume object in a read only state.

注意
if GetValue at a world position wants to be used a VOLUMESAMPLER needs to be passed or SetSampler needs to be called.
参数
[in] volumeObject The volume object to initialize this accessor for.
[in] sampler The used sampler for position sampling.
返回
True if the accessor was initialized with a volume, false otherwise.

◆  InitWithWriteAccess()

MAXON_METHOD Result <void> InitWithWriteAccess ( Volume &  volumeObject ,
VOLUMESAMPLER   sampler = VOLUMESAMPLER::NEAREST  
)

Initialize the accessor with a volume object with both read and write access.

注意
if GetValue() at a world position is needed, a VOLUMESAMPLER must be passed or SetSampler needs to be called.
参数
[in] volumeObject The volume object to initialize this accessor for.
[in] sampler The sampler to use for position sampling.
返回
True if the accessor was initialized with a volume, false otherwise.

◆  SetSampler()

MAXON_METHOD Result <void> SetSampler ( VOLUMESAMPLER   sampler )

Changes the sampler Type.

参数
[in] sampler The used sampler for position sampling.

◆  GetValue() [1/2]

MAXON_METHOD TYPE GetValue ( const IntVector32 coords ) const

Retrieve the value of the volume at the given voxel index.

参数
[in] coords The voxel index at which the data should be retrieved.
返回
The voxel value at the voxel index.

◆  GetValue() [2/2]

MAXON_METHOD TYPE GetValue ( const 向量 position ) const

Retrieve the value of the volume at the given world position.

注意
the returned value depends on the VOLUMESAMPLER that was set.
参数
[in] position The world position at which the data should be retrieved.
返回
The voxel value at the world position.

◆  GetCoords()

MAXON_METHOD 向量 GetCoords ( const 向量 position ) const

Retrieve the sub voxel index position of the volume at the given world position.

注意
this value depends on the VOLUMESAMPLER that was set.
参数
[in] position The world position at which the sub voxel index position should be retrieved.
返回
The sub voxel index position at the passed position.

◆  SetValue()

MAXON_METHOD Result <void> SetValue ( const IntVector32 coords ,
const TYPE  val  
)

Sets a voxel value at a voxel index.

注意
this will activate a voxel
参数
[in] coords The voxel index at which the value will be set.
[in] val The value to set.

◆  SetValueOnly()

MAXON_METHOD Result <void> SetValueOnly ( const IntVector32 coords ,
const TYPE  val  
)

Sets a voxel value at a voxel index.

注意
same as SetValue, but this will not activate a voxel
参数
[in] coords The voxel index at which the value will be set.
[in] val The value to set.

◆  SetActiveState()

MAXON_METHOD Result <void> SetActiveState ( const IntVector32 coords ,
Bool   state  
)

Sets the active state of a voxel at a voxel index.

参数
[in] coords The voxel index at which the active state will be set.
[in] state The state to set, true means active, false inactive.

◆  GetActiveState()

MAXON_METHOD Bool GetActiveState ( const IntVector32 coords ) const

Retrieve the active state of a voxel at a voxel index.

参数
[in] coords The voxel index at which the active state will be checked.
返回
The active state of the voxel at that voxel index.