HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_ScalarFieldSampler Class Reference

#include <SIM_FieldSampler.h>

+ Inheritance diagram for SIM_ScalarFieldSampler:

Public Member Functions

 SIM_ScalarFieldSampler ()
 
 SIM_ScalarFieldSampler (const SIM_RawField *target, const SIM_RawField *source)
 These constructors also initialize the sampler for immediate use. More...
 
 SIM_ScalarFieldSampler (const SIM_RawField *target, const SIM_ScalarField *source)
 
 SIM_ScalarFieldSampler (const SIM_RawIndexField *target, const SIM_RawField *source)
 
 SIM_ScalarFieldSampler (const SIM_RawIndexField *target, const SIM_ScalarField *source)
 
 ~SIM_ScalarFieldSampler ()
 The destructor. More...
 
void init (const SIM_RawField *target, const SIM_RawField *source)
 
void init (const SIM_RawIndexField *target, const SIM_RawField *source)
 
SYS_FORCE_INLINE float getValue (int x, int y, int z)
 
SYS_FORCE_INLINE float getValue (const UT_VoxelArrayIteratorF &iter)
 Returns value of the source field at the current voxel of the iterator. More...
 
SYS_FORCE_INLINE float getValue (float x, float y, float z)
 
SYS_FORCE_INLINE float getValue (const UT_Vector3 &p)
 
SYS_FORCE_INLINE bool isTileConstant (const UT_VoxelArrayIteratorF &iter, float &val)
 

Protected Attributes

UT_UniquePtr
< SIM_SFSImplementation
mySampler
 

Detailed Description

This class is an efficient relative scalar field sampler. It samples the source field, given coordinates in index space of the target (or an iterator running over the target field).

Examples:
SIM/SIM_GasAdd.C.

Definition at line 87 of file SIM_FieldSampler.h.

Constructor & Destructor Documentation

SIM_ScalarFieldSampler::SIM_ScalarFieldSampler ( )
inline

Default constructor; init() method must be called before the sampler is usable.

Definition at line 92 of file SIM_FieldSampler.h.

SIM_ScalarFieldSampler::SIM_ScalarFieldSampler ( const SIM_RawField target,
const SIM_RawField source 
)
inline

These constructors also initialize the sampler for immediate use.

Definition at line 97 of file SIM_FieldSampler.h.

SIM_ScalarFieldSampler::SIM_ScalarFieldSampler ( const SIM_RawField target,
const SIM_ScalarField source 
)
inline

Definition at line 102 of file SIM_FieldSampler.h.

SIM_ScalarFieldSampler::SIM_ScalarFieldSampler ( const SIM_RawIndexField target,
const SIM_RawField source 
)
inline

Definition at line 107 of file SIM_FieldSampler.h.

SIM_ScalarFieldSampler::SIM_ScalarFieldSampler ( const SIM_RawIndexField target,
const SIM_ScalarField source 
)
inline

Definition at line 112 of file SIM_FieldSampler.h.

SIM_ScalarFieldSampler::~SIM_ScalarFieldSampler ( )
inline

The destructor.

Definition at line 119 of file SIM_FieldSampler.h.

Member Function Documentation

SYS_FORCE_INLINE float SIM_ScalarFieldSampler::getValue ( int  x,
int  y,
int  z 
)
inline

Returns value of the source field at the given (exact) coordinates of the target field.

Definition at line 137 of file SIM_FieldSampler.h.

SYS_FORCE_INLINE float SIM_ScalarFieldSampler::getValue ( const UT_VoxelArrayIteratorF iter)
inline

Returns value of the source field at the current voxel of the iterator.

Definition at line 143 of file SIM_FieldSampler.h.

SYS_FORCE_INLINE float SIM_ScalarFieldSampler::getValue ( float  x,
float  y,
float  z 
)
inline

Returns value of the source field at the given coordinates of the target field.

Definition at line 150 of file SIM_FieldSampler.h.

SYS_FORCE_INLINE float SIM_ScalarFieldSampler::getValue ( const UT_Vector3 p)
inline

Returns value of the source field at the given coordinates of the target field.

Definition at line 157 of file SIM_FieldSampler.h.

void SIM_ScalarFieldSampler::init ( const SIM_RawField target,
const SIM_RawField source 
)
inline

Initialization routines that must be called before the sampler can be used. Note that constructors that accept field pointers call init() to ensure that the object is ready for use.

Definition at line 126 of file SIM_FieldSampler.h.

void SIM_ScalarFieldSampler::init ( const SIM_RawIndexField target,
const SIM_RawField source 
)
inline

Definition at line 130 of file SIM_FieldSampler.h.

SYS_FORCE_INLINE bool SIM_ScalarFieldSampler::isTileConstant ( const UT_VoxelArrayIteratorF iter,
float val 
)
inline

Returns true if the source field is constant within the current tile of the target iterator. If it's constant, the constant value is stored in val. Note that this method doesn't exhaustively look into voxels, but only checks for compressed ones.

Definition at line 166 of file SIM_FieldSampler.h.

Member Data Documentation

UT_UniquePtr<SIM_SFSImplementation> SIM_ScalarFieldSampler::mySampler
protected

Definition at line 176 of file SIM_FieldSampler.h.


The documentation for this class was generated from the following file: