CubicGenericFieldInterp< Field_T > Class Template Reference

`#include <FieldInterp.h>`

Inheritance diagram for CubicGenericFieldInterp< Field_T >:

## Public Types

typedef CubicGenericFieldInterp | class_type
typedef boost::intrusive_ptr< CubicGenericFieldInterp > | Ptr
typedef Field_T::value_type | value_type
Public Types inherited from RefBase
typedef boost::intrusive_ptr< RefBase > | Ptr
typedef boost::weak_ptr< RefBase > | WeakPtr

## Public Member Functions

value_type | sample (const Field_T &data, const V3d &vsP) const
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 const char * | staticClassType ()

## Public Attributes

| DEFINE_FIELD_RTTI_CONCRETE_CLASS

## Private Types

typedef RefBase | base
| Convenience typedef for referring to base class.

## Static Private Attributes

static TemplatedFieldType< CubicGenericFieldInterp< Field_T > > | ms_classType

## Detailed Description

template<class Field_T>
class CubicGenericFieldInterp< Field_T >

Definition at line 375 of file FieldInterp.h.

## Member Typedef Documentation

## value_type

template<class Field_T>

typedef Field_T::value_type CubicGenericFieldInterp< Field_T >::value_type

Definition at line 381 of file FieldInterp.h.

## Ptr

template<class Field_T>

typedef boost::intrusive_ptr<CubicGenericFieldInterp> CubicGenericFieldInterp< Field_T >::Ptr

Definition at line 382 of file FieldInterp.h.

## class_type

template<class Field_T>

typedef CubicGenericFieldInterp CubicGenericFieldInterp< Field_T >::class_type

Definition at line 386 of file FieldInterp.h.

## base

template<class Field_T>

typedef RefBase CubicGenericFieldInterp< Field_T >::base

private

Convenience typedef for referring to base class.

Definition at line 413 of file FieldInterp.h.

## Member Function Documentation

## staticClassName()

template<class Field_T>

const char * CubicGenericFieldInterp< Field_T >::staticClassName | ( |  | ) |

inline static

Definition at line 389 of file FieldInterp.h.

{
return "CubicGenericFieldInterp";
}

## staticClassType()

template<class Field_T>

const char * CubicGenericFieldInterp< Field_T >::staticClassType | ( |  | ) |

inline static

Definition at line 394 of file FieldInterp.h.

{
return ms_classType.name();
}
CubicGenericFieldInterp::ms_classType
static TemplatedFieldType< CubicGenericFieldInterp< Field_T > > ms_classType
Definition FieldInterp.h:408

## sample()

template<class Field_T>

Field_T::value_type CubicGenericFieldInterp< Field_T >::sample | ( | const Field_T & | data,
|  | const V3d & | vsP ) const

Definition at line 1083 of file FieldInterp.h.

{
typedef typename Field_T::value_type Data_T;
// Pixel 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));
const Box3i &dataWindow = data.dataWindow();
// 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));
// 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));
Data_T z11 = monotonicCubicInterpolant(data.fastValue(im_1, jm_1, km_1),
data.fastValue(im_1, jm_1, km),
data.fastValue(im_1, jm_1, km1),
data.fastValue(im_1, jm_1, km2), t.z);
Data_T z12 = monotonicCubicInterpolant(data.fastValue(im_1, jm, km_1),
data.fastValue(im_1, jm, km),
data.fastValue(im_1, jm, km1),
data.fastValue(im_1, jm, km2), t.z);
Data_T z13 = monotonicCubicInterpolant(data.fastValue(im_1, jm1, km_1),
data.fastValue(im_1, jm1, km),
data.fastValue(im_1, jm1, km1),
data.fastValue(im_1, jm1, km2), t.z);
Data_T z14 = monotonicCubicInterpolant(data.fastValue(im_1, jm2, km_1),
data.fastValue(im_1, jm2, km),
data.fastValue(im_1, jm2, km1),
data.fastValue(im_1, jm2, km2), t.z);
Data_T z21 = monotonicCubicInterpolant(data.fastValue(im, jm_1, km_1),
data.fastValue(im, jm_1, km),
data.fastValue(im, jm_1, km1),
data.fastValue(im, jm_1, km2), t.z);
Data_T z22 = monotonicCubicInterpolant(data.fastValue(im, jm, km_1),
data.fastValue(im, jm, km),
data.fastValue(im, jm, km1),
data.fastValue(im, jm, km2), t.z);
Data_T z23 = monotonicCubicInterpolant(data.fastValue(im, jm1, km_1),
data.fastValue(im, jm1, km),
data.fastValue(im, jm1, km1),
data.fastValue(im, jm1, km2), t.z);
Data_T z24 = monotonicCubicInterpolant(data.fastValue(im, jm2, km_1),
data.fastValue(im, jm2, km),
data.fastValue(im, jm2, km1),
data.fastValue(im, jm2, km2), t.z);
Data_T z31 = monotonicCubicInterpolant(data.fastValue(im1, jm_1, km_1),
data.fastValue(im1, jm_1, km),
data.fastValue(im1, jm_1, km1),
data.fastValue(im1, jm_1, km2), t.z);
Data_T z32 = monotonicCubicInterpolant(data.fastValue(im1, jm, km_1),
data.fastValue(im1, jm, km),
data.fastValue(im1, jm, km1),
data.fastValue(im1, jm, km2), t.z);
Data_T z33 = monotonicCubicInterpolant(data.fastValue(im1, jm1, km_1),
data.fastValue(im1, jm1, km),
data.fastValue(im1, jm1, km1),
data.fastValue(im1, jm1, km2), t.z);
Data_T z34 = monotonicCubicInterpolant(data.fastValue(im1, jm2, km_1),
data.fastValue(im1, jm2, km),
data.fastValue(im1, jm2, km1),
data.fastValue(im1, jm2, km2), t.z);
Data_T z41 = monotonicCubicInterpolant(data.fastValue(im2, jm_1, km_1),
data.fastValue(im2, jm_1, km),
data.fastValue(im2, jm_1, km1),
data.fastValue(im2, jm_1, km2), t.z);
Data_T z42 = monotonicCubicInterpolant(data.fastValue(im2, jm, km_1),
data.fastValue(im2, jm, km),
data.fastValue(im2, jm, km1),
data.fastValue(im2, jm, km2), t.z);
Data_T z43 = monotonicCubicInterpolant(data.fastValue(im2, jm1, km_1),
data.fastValue(im2, jm1, km),
data.fastValue(im2, jm1, km1),
data.fastValue(im2, jm1, km2), t.z);
Data_T z44 = monotonicCubicInterpolant(data.fastValue(im2, jm2, km_1),
data.fastValue(im2, jm2, km),
data.fastValue(im2, jm2, km1),
data.fastValue(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...
CubicGenericFieldInterp
Definition FieldInterp.h:376

References FIELD3D_VEC3_T, and monotonicCubicInterpolant().

## Member Data Documentation

## DEFINE_FIELD_RTTI_CONCRETE_CLASS

template<class Field_T>

CubicGenericFieldInterp< Field_T >::DEFINE_FIELD_RTTI_CONCRETE_CLASS

Definition at line 387 of file FieldInterp.h.

## ms_classType

template<class Field_T>

TemplatedFieldType<CubicGenericFieldInterp<Field_T> > CubicGenericFieldInterp< Field_T >::ms_classType

static private

Definition at line 408 of file FieldInterp.h.

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

- export/DenseField.h
- export/FieldInterp.h