20 #ifndef __SIM_FieldSampler__
21 #define __SIM_FieldSampler__
46 template <
typename FIELD_TYPE>
58 virtual float getValue(
float x,
float y,
float z) = 0;
77 template <
typename FIELD_TYPE>
108 init(target, source);
118 init(target, source);
132 init(target, source, target_sample);
138 init(target, source->
getField(), target_sample);
170 return mySampler->getValue(x, y, z);
176 return mySampler->getValue(iter.
x(), iter.
y(), iter.
z());
183 return mySampler->getValue(x, y, z);
190 return mySampler->getValue(p.
x(), p.
y(), p.
z());
228 init(target, source);
233 init(target, source);
257 return mySampler->getValue(x, y, z);
263 return mySampler->getValue(iter.
x(), iter.
y(), iter.
z());
270 return mySampler->getValue(x, y, z);
277 return mySampler->getValue(p.
x(), p.
y(), p.
z());
int x() const
Retrieve the current location of the iterator.
~SIM_VectorFieldSampler()
The destructor.
SYS_FORCE_INLINE bool isTileConstant(const UT_VoxelArrayIteratorF &iter, float &val)
UT_VoxelTile< T > * getTile() const
Returns the VoxelTile we are currently processing.
virtual ~SIM_VFSImplementation()
SIM_VectorFieldSampler(const SIM_RawIndexField *target, const SIM_VectorField *source)
SYS_FORCE_INLINE UT_Vector3 getValue(const UT_VoxelArrayIteratorF &iter)
Returns value of the source field at the current voxel of the iterator.
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
SYS_FORCE_INLINE float getValue(int x, int y, int z)
GLdouble GLdouble GLdouble z
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE float getValue(const UT_VoxelArrayIteratorF &iter)
Returns value of the source field at the current voxel of the iterator.
int myTilePos[3]
Which tile we are as per tx,ty,tz rather than linear index.
SIM_ScalarFieldSampler(const SIM_VectorField *target, const SIM_RawField *source, SIM_FieldSample target_sample)
static SIM_API UT_UniquePtr< SIM_VFSImplementation > createSampler(const FIELD_TYPE *target, const SIM_VectorField *source)
~SIM_ScalarFieldSampler()
The destructor.
void init(const SIM_RawField *target, const SIM_VectorField *source)
virtual float getValue(int x, int y, int z)=0
void init(const SIM_RawIndexField *target, const SIM_VectorField *source)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
SIM_ScalarFieldSampler(const SIM_RawField *target, const SIM_RawField *source)
These constructors also initialize the sampler for immediate use.
SYS_FORCE_INLINE UT_Vector3 getValue(int x, int y, int z)
SIM_ScalarFieldSampler(const SIM_RawIndexField *target, const SIM_ScalarField *source)
void init(const SIM_RawField *target, const SIM_RawField *source)
GLsizei GLsizei GLchar * source
SIM_ScalarFieldSampler(const SIM_VectorField *target, const SIM_ScalarField *source, SIM_FieldSample target_sample)
virtual bool isTileConstant(int tx, int ty, int tz, const UT_VoxelTile< float > *tile, UT_Vector3 &val)=0
SYS_FORCE_INLINE bool isTileConstant(const UT_VoxelArrayIteratorF &iter, UT_Vector3 &val)
SYS_DECLARE_LEGACY_TR(GU_Detail)
UT_UniquePtr< SIM_VFSImplementation > mySampler
void init(const SIM_VectorField *target, const SIM_RawField *source, SIM_FieldSample target_sample)
UT_UniquePtr< SIM_SFSImplementation > mySampler
const SIM_RawField * getField() const
Retrieve raw field.
SYS_FORCE_INLINE float getValue(const UT_Vector3 &p)
SIM_ScalarFieldSampler(const SIM_RawIndexField *target, const SIM_RawField *source)
const UT_VoxelArrayF * mySourceArrays[3]
SIM_ScalarFieldSampler(const SIM_RawField *target, const SIM_ScalarField *source)
virtual UT_Vector3 getValue(int x, int y, int z)=0
This class holds a three dimensional scalar field.
void init(const SIM_RawIndexField *target, const SIM_RawField *source)
SYS_FORCE_INLINE float getValue(float x, float y, float z)
SIM_VectorFieldSampler(const SIM_RawField *target, const SIM_VectorField *source)
These constructors also initialize the sampler for immediate use.
SYS_FORCE_INLINE UT_Vector3 getValue(const UT_Vector3 &p)
virtual ~SIM_SFSImplementation()
constexpr SYS_FORCE_INLINE T & y() noexcept
const UT_VoxelArrayF * mySourceArray
This class holds a three dimensional vector field.
SYS_FORCE_INLINE UT_Vector3 getValue(float x, float y, float z)
static SIM_API UT_UniquePtr< SIM_SFSImplementation > createSampler(const FIELD_TYPE *target, const SIM_RawField *source)
This static method creates an appropriate sampler for the given fields.
virtual bool isTileConstant(int tx, int ty, int tz, const UT_VoxelTile< float > *tile, float &val)=0
constexpr SYS_FORCE_INLINE T & x() noexcept