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 (const SIM_VectorField *target, const SIM_RawField *source, SIM_FieldSample target_sample)
 
 SIM_ScalarFieldSampler (const SIM_VectorField *target, const SIM_ScalarField *source, SIM_FieldSample target_sample)
 
 ~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)
 
void init (const SIM_VectorField *target, const SIM_RawField *source, SIM_FieldSample target_sample)
 
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 95 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 100 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 105 of file SIM_FieldSampler.h.

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

Definition at line 110 of file SIM_FieldSampler.h.

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

Definition at line 115 of file SIM_FieldSampler.h.

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

Definition at line 120 of file SIM_FieldSampler.h.

SIM_ScalarFieldSampler::SIM_ScalarFieldSampler ( const SIM_VectorField target,
const SIM_RawField source,
SIM_FieldSample  target_sample 
)
inline

These constructors initialize the sampler for immediate use, when iterating over the target vector field with sampling given by target_sample.

Definition at line 128 of file SIM_FieldSampler.h.

SIM_ScalarFieldSampler::SIM_ScalarFieldSampler ( const SIM_VectorField target,
const SIM_ScalarField source,
SIM_FieldSample  target_sample 
)
inline

Definition at line 134 of file SIM_FieldSampler.h.

SIM_ScalarFieldSampler::~SIM_ScalarFieldSampler ( )
inline

The destructor.

Definition at line 142 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 168 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 174 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 181 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 188 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 149 of file SIM_FieldSampler.h.

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

Definition at line 153 of file SIM_FieldSampler.h.

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

This version of initialization is for sampling source with respect to cells of target at locations given by target_sample.

Definition at line 159 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 197 of file SIM_FieldSampler.h.

Member Data Documentation

UT_UniquePtr<SIM_SFSImplementation> SIM_ScalarFieldSampler::mySampler
protected

Definition at line 207 of file SIM_FieldSampler.h.


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