CubicFieldInterp< Data_T > Class Template Reference

`#include <FieldInterp.h>`

Inheritance diagram for CubicFieldInterp< Data_T >:

## Public Types

typedef CubicFieldInterp | class_type
typedef boost::intrusive_ptr< CubicFieldInterp > | Ptr
typedef Data_T | value_type
Public Types inherited from FieldInterp< Data_T >
typedef FieldInterp | class_type
typedef boost::intrusive_ptr< FieldInterp > | Ptr
typedef Data_T | value_type
Public Types inherited from RefBase
typedef boost::intrusive_ptr< RefBase > | Ptr
typedef boost::weak_ptr< RefBase > | WeakPtr

## Public Member Functions

virtual Data_T | sample (const Field< Data_T > &data, const V3d &vsP) const
Public Member Functions inherited from FieldInterp< Data_T >
virtual | ~FieldInterp ()
Public Member Functions inherited from RefBase
void | ref () const
| Used by boost::intrusive_pointer.
size_t | refcnt ()
| Used by boost::intrusive_pointer.
void | unref () const
| Used by boost::intrusive_pointer.
WeakPtr | weakPtr () const
| RefBase ()
| RefBase (const RefBase &)
| Copy constructor.
RefBase & | operator= (const RefBase &)
| Assignment operator.
virtual | ~RefBase ()
| Destructor.
virtual bool | checkRTTI (const char *typenameStr)=0
| This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();.
bool | matchRTTI (const char *typenameStr)
| Performs a check to see if the given typename string matches this class' This needs to be implemented in -all- subclasses, even abstract ones.

## Static Public Member Functions

static const char * | staticClassName ()
static const char * | staticClassType ()
Static Public Member Functions inherited from FieldInterp< Data_T >
static const char * | staticClassName ()
static const char * | staticClassType ()
static const char * | staticClassType ()

## Public Attributes

| DEFINE_FIELD_RTTI_CONCRETE_CLASS
Public Attributes inherited from FieldInterp< Data_T >
| DEFINE_FIELD_RTTI_ABSTRACT_CLASS

## Private Types

typedef FieldInterp< Data_T > | base
| Convenience typedef for referring to base class.

## Static Private Attributes

static TemplatedFieldType< CubicFieldInterp< Data_T > > | ms_classType

## Detailed Description

template<class Data_T>
class CubicFieldInterp< Data_T >

Definition at line 195 of file FieldInterp.h.

## Member Typedef Documentation

## value_type

template<class Data_T>

typedef Data_T CubicFieldInterp< Data_T >::value_type

Definition at line 201 of file FieldInterp.h.

## Ptr

template<class Data_T>

typedef boost::intrusive_ptr<CubicFieldInterp> CubicFieldInterp< Data_T >::Ptr

Definition at line 202 of file FieldInterp.h.

## class_type

template<class Data_T>

typedef CubicFieldInterp CubicFieldInterp< Data_T >::class_type

Definition at line 206 of file FieldInterp.h.

## base

template<class Data_T>

typedef FieldInterp<Data_T> CubicFieldInterp< Data_T >::base

private

Convenience typedef for referring to base class.

Definition at line 232 of file FieldInterp.h.

## Member Function Documentation

## staticClassName()

template<class Data_T>

const char * CubicFieldInterp< Data_T >::staticClassName | ( |  | ) |

inline static

Definition at line 209 of file FieldInterp.h.

{
return "CubicFieldInterp";
}

## staticClassType()

template<class Data_T>

const char * CubicFieldInterp< Data_T >::staticClassType | ( |  | ) |

inline static

Definition at line 214 of file FieldInterp.h.

{
return ms_classType.name();
}
CubicFieldInterp::ms_classType
static TemplatedFieldType< CubicFieldInterp< Data_T > > ms_classType
Definition FieldInterp.h:227

References ms_classType.

## sample()

template<class Data_T>

Data_T CubicFieldInterp< Data_T >::sample | ( | const Field< Data_T > & | data,
|  | const V3d & | vsP ) const

virtual

Implements FieldInterp< Data_T >.

Definition at line 651 of file FieldInterp.h.

{
// Voxel centers are at .5 coordinates
// NOTE: Don't use contToDisc for this, we're looking for sample
// point locations, not coordinate shifts.
V3d clampedVsP(std::max(0.5, vsP.x),
std::max(0.5, vsP.y),
std::max(0.5, vsP.z));
FIELD3D_VEC3_T<double> p(clampedVsP - FIELD3D_VEC3_T<double>(0.5));
// Lower left corner
V3i c(static_cast<int>(floor(p.x)),
static_cast<int>(floor(p.y)),
static_cast<int>(floor(p.z)));
// Fractions
FIELD3D_VEC3_T<double> t(p - static_cast<FIELD3D_VEC3_T<double> >(c));
const Box3i &dataWindow = data.dataWindow();
// Clamp the coordinates
int im, jm, km;
im = std::max(dataWindow.min.x, std::min(c.x, dataWindow.max.x));
jm = std::max(dataWindow.min.y, std::min(c.y, dataWindow.max.y));
km = std::max(dataWindow.min.z, std::min(c.z, dataWindow.max.z));
int im_1, jm_1, km_1;
im_1 = std::max(dataWindow.min.x, std::min(im - 1, dataWindow.max.x));
jm_1 = std::max(dataWindow.min.y, std::min(jm - 1, dataWindow.max.y));
km_1 = std::max(dataWindow.min.z, std::min(km - 1, dataWindow.max.z));
int im1, jm1, km1;
im1 = std::max(dataWindow.min.x, std::min(im + 1, dataWindow.max.x));
jm1 = std::max(dataWindow.min.y, std::min(jm + 1, dataWindow.max.y));
km1 = std::max(dataWindow.min.z, std::min(km + 1, dataWindow.max.z));
int im2, jm2, km2;
im2 = std::max(dataWindow.min.x, std::min(im + 2, dataWindow.max.x));
jm2 = std::max(dataWindow.min.y, std::min(jm + 2, dataWindow.max.y));
km2 = std::max(dataWindow.min.z, std::min(km + 2, dataWindow.max.z));
// interpolate 16 lines in z:
Data_T z11 = monotonicCubicInterpolant(data.value(im_1, jm_1, km_1),
data.value(im_1, jm_1, km),
data.value(im_1, jm_1, km1),
data.value(im_1, jm_1, km2), t.z);
Data_T z12 = monotonicCubicInterpolant(data.value(im_1, jm, km_1),
data.value(im_1, jm, km),
data.value(im_1, jm, km1),
data.value(im_1, jm, km2), t.z);
Data_T z13 = monotonicCubicInterpolant(data.value(im_1, jm1, km_1),
data.value(im_1, jm1, km),
data.value(im_1, jm1, km1),
data.value(im_1, jm1, km2), t.z);
Data_T z14 = monotonicCubicInterpolant(data.value(im_1, jm2, km_1),
data.value(im_1, jm2, km),
data.value(im_1, jm2, km1),
data.value(im_1, jm2, km2), t.z);
Data_T z21 = monotonicCubicInterpolant(data.value(im, jm_1, km_1),
data.value(im, jm_1, km),
data.value(im, jm_1, km1),
data.value(im, jm_1, km2), t.z);
Data_T z22 = monotonicCubicInterpolant(data.value(im, jm, km_1),
data.value(im, jm, km),
data.value(im, jm, km1),
data.value(im, jm, km2), t.z);
Data_T z23 = monotonicCubicInterpolant(data.value(im, jm1, km_1),
data.value(im, jm1, km),
data.value(im, jm1, km1),
data.value(im, jm1, km2), t.z);
Data_T z24 = monotonicCubicInterpolant(data.value(im, jm2, km_1),
data.value(im, jm2, km),
data.value(im, jm2, km1),
data.value(im, jm2, km2), t.z);
Data_T z31 = monotonicCubicInterpolant(data.value(im1, jm_1, km_1),
data.value(im1, jm_1, km),
data.value(im1, jm_1, km1),
data.value(im1, jm_1, km2), t.z);
Data_T z32 = monotonicCubicInterpolant(data.value(im1, jm, km_1),
data.value(im1, jm, km),
data.value(im1, jm, km1),
data.value(im1, jm, km2), t.z);
Data_T z33 = monotonicCubicInterpolant(data.value(im1, jm1, km_1),
data.value(im1, jm1, km),
data.value(im1, jm1, km1),
data.value(im1, jm1, km2), t.z);
Data_T z34 = monotonicCubicInterpolant(data.value(im1, jm2, km_1),
data.value(im1, jm2, km),
data.value(im1, jm2, km1),
data.value(im1, jm2, km2), t.z);
Data_T z41 = monotonicCubicInterpolant(data.value(im2, jm_1, km_1),
data.value(im2, jm_1, km),
data.value(im2, jm_1, km1),
data.value(im2, jm_1, km2), t.z);
Data_T z42 = monotonicCubicInterpolant(data.value(im2, jm, km_1),
data.value(im2, jm, km),
data.value(im2, jm, km1),
data.value(im2, jm, km2), t.z);
Data_T z43 = monotonicCubicInterpolant(data.value(im2, jm1, km_1),
data.value(im2, jm1, km),
data.value(im2, jm1, km1),
data.value(im2, jm1, km2), t.z);
Data_T z44 = monotonicCubicInterpolant(data.value(im2, jm2, km_1),
data.value(im2, jm2, km),
data.value(im2, jm2, km1),
data.value(im2, jm2, km2), t.z);
Data_T y1 = monotonicCubicInterpolant(z11, z12, z13, z14, t.y);
Data_T y2 = monotonicCubicInterpolant(z21, z22, z23, z24, t.y);
Data_T y3 = monotonicCubicInterpolant(z31, z32, z33, z34, t.y);
Data_T y4 = monotonicCubicInterpolant(z41, z42, z43, z44, t.y);
Data_T z0 = monotonicCubicInterpolant(y1, y2, y3, y4, t.x);
return z0;
}
monotonicCubicInterpolant
Data_T monotonicCubicInterpolant(const Data_T &f1, const Data_T &f2, const Data_T &f3, const Data_T &f4, double t)
Monotonic cubic interpolation References: http://en.wikipedia.org/wiki/Monotone_cubic_interpolation h...
CubicFieldInterp
Definition FieldInterp.h:196

References FieldRes::dataWindow(), FIELD3D_VEC3_T, monotonicCubicInterpolant(), and Field< Data_T >::value().

## Member Data Documentation

## DEFINE_FIELD_RTTI_CONCRETE_CLASS

template<class Data_T>

CubicFieldInterp< Data_T >::DEFINE_FIELD_RTTI_CONCRETE_CLASS

Definition at line 207 of file FieldInterp.h.

## ms_classType

template<class Data_T>

TemplatedFieldType<CubicFieldInterp<Data_T> > CubicFieldInterp< Data_T >::ms_classType

static private

Definition at line 227 of file FieldInterp.h.

Referenced by staticClassType().

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

- export/FieldInterp.h