CubicMACFieldInterp< Data_T > Class Template Reference

`#include <FieldInterp.h>`

Inheritance diagram for CubicMACFieldInterp< Data_T >:

## Public Types

typedef CubicMACFieldInterp | class_type
typedef boost::intrusive_ptr< CubicMACFieldInterp > | 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

Data_T | sample (const MACField< Data_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< CubicMACFieldInterp< Data_T > > | ms_classType

## Detailed Description

template<class Data_T>
class CubicMACFieldInterp< Data_T >

Definition at line 434 of file FieldInterp.h.

## Member Typedef Documentation

## value_type

template<class Data_T>

typedef Data_T CubicMACFieldInterp< Data_T >::value_type

Definition at line 440 of file FieldInterp.h.

## Ptr

template<class Data_T>

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

Definition at line 441 of file FieldInterp.h.

## class_type

template<class Data_T>

typedef CubicMACFieldInterp CubicMACFieldInterp< Data_T >::class_type

Definition at line 445 of file FieldInterp.h.

## base

template<class Data_T>

typedef RefBase CubicMACFieldInterp< Data_T >::base

private

Convenience typedef for referring to base class.

Definition at line 471 of file FieldInterp.h.

## Member Function Documentation

## staticClassName()

template<class Data_T>

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

inline static

Definition at line 448 of file FieldInterp.h.

{
return "CubicMACFieldInterp";
}

## staticClassType()

template<class Data_T>

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

inline static

Definition at line 453 of file FieldInterp.h.

{
return CubicMACFieldInterp<Data_T>::ms_classType.name();
}
CubicMACFieldInterp
Definition FieldInterp.h:435

References ms_classType.

## sample()

template<class Data_T>

Data_T CubicMACFieldInterp< Data_T >::sample | ( | const MACField< Data_T > & | data,
|  | const V3d & | vsP ) const

Definition at line 1205 of file FieldInterp.h.

{
typedef typename Data_T::BaseType T;
const Box3i &dataWindow = data.dataWindow();
// Pixel centers are at .5 coordinates
// NOTE: Don't use contToDisc for this, we're looking for sample
// point locations, not coordinate shifts.
Data_T ret;
// X component ---
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(vsP.x,
clampedVsP.y - 0.5,
clampedVsP.z - 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)));
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 + 1));
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 + 1));
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 + 1));
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 + 1));
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));
T z11 = monotonicCubicInterpolant(data.u(im_1, jm_1, km_1),
data.u(im_1, jm_1, km),
data.u(im_1, jm_1, km1),
data.u(im_1, jm_1, km2), t.z);
T z12 = monotonicCubicInterpolant(data.u(im_1, jm, km_1),
data.u(im_1, jm, km),
data.u(im_1, jm, km1),
data.u(im_1, jm, km2), t.z);
T z13 = monotonicCubicInterpolant(data.u(im_1, jm1, km_1),
data.u(im_1, jm1, km),
data.u(im_1, jm1, km1),
data.u(im_1, jm1, km2), t.z);
T z14 = monotonicCubicInterpolant(data.u(im_1, jm2, km_1),
data.u(im_1, jm2, km),
data.u(im_1, jm2, km1),
data.u(im_1, jm2, km2), t.z);
T z21 = monotonicCubicInterpolant(data.u(im, jm_1, km_1),
data.u(im, jm_1, km),
data.u(im, jm_1, km1),
data.u(im, jm_1, km2), t.z);
T z22 = monotonicCubicInterpolant(data.u(im, jm, km_1),
data.u(im, jm, km),
data.u(im, jm, km1),
data.u(im, jm, km2), t.z);
T z23 = monotonicCubicInterpolant(data.u(im, jm1, km_1),
data.u(im, jm1, km),
data.u(im, jm1, km1),
data.u(im, jm1, km2), t.z);
T z24 = monotonicCubicInterpolant(data.u(im, jm2, km_1),
data.u(im, jm2, km),
data.u(im, jm2, km1),
data.u(im, jm2, km2), t.z);
T z31 = monotonicCubicInterpolant(data.u(im1, jm_1, km_1),
data.u(im1, jm_1, km),
data.u(im1, jm_1, km1),
data.u(im1, jm_1, km2), t.z);
T z32 = monotonicCubicInterpolant(data.u(im1, jm, km_1),
data.u(im1, jm, km),
data.u(im1, jm, km1),
data.u(im1, jm, km2), t.z);
T z33 = monotonicCubicInterpolant(data.u(im1, jm1, km_1),
data.u(im1, jm1, km),
data.u(im1, jm1, km1),
data.u(im1, jm1, km2), t.z);
T z34 = monotonicCubicInterpolant(data.u(im1, jm2, km_1),
data.u(im1, jm2, km),
data.u(im1, jm2, km1),
data.u(im1, jm2, km2), t.z);
T z41 = monotonicCubicInterpolant(data.u(im2, jm_1, km_1),
data.u(im2, jm_1, km),
data.u(im2, jm_1, km1),
data.u(im2, jm_1, km2), t.z);
T z42 = monotonicCubicInterpolant(data.u(im2, jm, km_1),
data.u(im2, jm, km),
data.u(im2, jm, km1),
data.u(im2, jm, km2), t.z);
T z43 = monotonicCubicInterpolant(data.u(im2, jm1, km_1),
data.u(im2, jm1, km),
data.u(im2, jm1, km1),
data.u(im2, jm1, km2), t.z);
T z44 = monotonicCubicInterpolant(data.u(im2, jm2, km_1),
data.u(im2, jm2, km),
data.u(im2, jm2, km1),
data.u(im2, jm2, km2), t.z);
T y1 = monotonicCubicInterpolant(z11, z12, z13, z14, t.y);
T y2 = monotonicCubicInterpolant(z21, z22, z23, z24, t.y);
T y3 = monotonicCubicInterpolant(z31, z32, z33, z34, t.y);
T y4 = monotonicCubicInterpolant(z41, z42, z43, z44, t.y);
ret.x = monotonicCubicInterpolant(y1, y2, y3, y4, t.x);
}
// Y component ---
p.setValue(clampedVsP.x - 0.5, vsP.y , clampedVsP.z - 0.5);
// Lower left corner
c.x = static_cast<int>(floor(p.x));
c.y = static_cast<int>(floor(p.y));
c.z = static_cast<int>(floor(p.z));
t.setValue(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 + 1));
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 + 1));
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 + 1));
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 + 1));
km2 = std::max(dataWindow.min.z, std::min(km + 2, dataWindow.max.z));
T z11 = monotonicCubicInterpolant(data.v(im_1, jm_1, km_1),
data.v(im_1, jm_1, km),
data.v(im_1, jm_1, km1),
data.v(im_1, jm_1, km2), t.z);
T z12 = monotonicCubicInterpolant(data.v(im_1, jm, km_1),
data.v(im_1, jm, km),
data.v(im_1, jm, km1),
data.v(im_1, jm, km2), t.z);
T z13 = monotonicCubicInterpolant(data.v(im_1, jm1, km_1),
data.v(im_1, jm1, km),
data.v(im_1, jm1, km1),
data.v(im_1, jm1, km2), t.z);
T z14 = monotonicCubicInterpolant(data.v(im_1, jm2, km_1),
data.v(im_1, jm2, km),
data.v(im_1, jm2, km1),
data.v(im_1, jm2, km2), t.z);
T z21 = monotonicCubicInterpolant(data.v(im, jm_1, km_1),
data.v(im, jm_1, km),
data.v(im, jm_1, km1),
data.v(im, jm_1, km2), t.z);
T z22 = monotonicCubicInterpolant(data.v(im, jm, km_1),
data.v(im, jm, km),
data.v(im, jm, km1),
data.v(im, jm, km2), t.z);
T z23 = monotonicCubicInterpolant(data.v(im, jm1, km_1),
data.v(im, jm1, km),
data.v(im, jm1, km1),
data.v(im, jm1, km2), t.z);
T z24 = monotonicCubicInterpolant(data.v(im, jm2, km_1),
data.v(im, jm2, km),
data.v(im, jm2, km1),
data.v(im, jm2, km2), t.z);
T z31 = monotonicCubicInterpolant(data.v(im1, jm_1, km_1),
data.v(im1, jm_1, km),
data.v(im1, jm_1, km1),
data.v(im1, jm_1, km2), t.z);
T z32 = monotonicCubicInterpolant(data.v(im1, jm, km_1),
data.v(im1, jm, km),
data.v(im1, jm, km1),
data.v(im1, jm, km2), t.z);
T z33 = monotonicCubicInterpolant(data.v(im1, jm1, km_1),
data.v(im1, jm1, km),
data.v(im1, jm1, km1),
data.v(im1, jm1, km2), t.z);
T z34 = monotonicCubicInterpolant(data.v(im1, jm2, km_1),
data.v(im1, jm2, km),
data.v(im1, jm2, km1),
data.v(im1, jm2, km2), t.z);
T z41 = monotonicCubicInterpolant(data.v(im2, jm_1, km_1),
data.v(im2, jm_1, km),
data.v(im2, jm_1, km1),
data.v(im2, jm_1, km2), t.z);
T z42 = monotonicCubicInterpolant(data.v(im2, jm, km_1),
data.v(im2, jm, km),
data.v(im2, jm, km1),
data.v(im2, jm, km2), t.z);
T z43 = monotonicCubicInterpolant(data.v(im2, jm1, km_1),
data.v(im2, jm1, km),
data.v(im2, jm1, km1),
data.v(im2, jm1, km2), t.z);
T z44 = monotonicCubicInterpolant(data.v(im2, jm2, km_1),
data.v(im2, jm2, km),
data.v(im2, jm2, km1),
data.v(im2, jm2, km2), t.z);
T y1 = monotonicCubicInterpolant(z11, z12, z13, z14, t.y);
T y2 = monotonicCubicInterpolant(z21, z22, z23, z24, t.y);
T y3 = monotonicCubicInterpolant(z31, z32, z33, z34, t.y);
T y4 = monotonicCubicInterpolant(z41, z42, z43, z44, t.y);
ret.y = monotonicCubicInterpolant(y1, y2, y3, y4, t.x);
}
// Z component ---
p.setValue(clampedVsP.x - 0.5 , clampedVsP.y - 0.5, vsP.z);
// Lower left corner
c.x = static_cast<int>(floor(p.x));
c.y = static_cast<int>(floor(p.y));
c.z = static_cast<int>(floor(p.z));
t.setValue(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 + 1));
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 + 1));
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 + 1));
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 + 1));
T z11 = monotonicCubicInterpolant(data.w(im_1, jm_1, km_1),
data.w(im_1, jm_1, km),
data.w(im_1, jm_1, km1),
data.w(im_1, jm_1, km2), t.z);
T z12 = monotonicCubicInterpolant(data.w(im_1, jm, km_1),
data.w(im_1, jm, km),
data.w(im_1, jm, km1),
data.w(im_1, jm, km2), t.z);
T z13 = monotonicCubicInterpolant(data.w(im_1, jm1, km_1),
data.w(im_1, jm1, km),
data.w(im_1, jm1, km1),
data.w(im_1, jm1, km2), t.z);
T z14 = monotonicCubicInterpolant(data.w(im_1, jm2, km_1),
data.w(im_1, jm2, km),
data.w(im_1, jm2, km1),
data.w(im_1, jm2, km2), t.z);
T z21 = monotonicCubicInterpolant(data.w(im, jm_1, km_1),
data.w(im, jm_1, km),
data.w(im, jm_1, km1),
data.w(im, jm_1, km2), t.z);
T z22 = monotonicCubicInterpolant(data.w(im, jm, km_1),
data.w(im, jm, km),
data.w(im, jm, km1),
data.w(im, jm, km2), t.z);
T z23 = monotonicCubicInterpolant(data.w(im, jm1, km_1),
data.w(im, jm1, km),
data.w(im, jm1, km1),
data.w(im, jm1, km2), t.z);
T z24 = monotonicCubicInterpolant(data.w(im, jm2, km_1),
data.w(im, jm2, km),
data.w(im, jm2, km1),
data.w(im, jm2, km2), t.z);
T z31 = monotonicCubicInterpolant(data.w(im1, jm_1, km_1),
data.w(im1, jm_1, km),
data.w(im1, jm_1, km1),
data.w(im1, jm_1, km2), t.z);
T z32 = monotonicCubicInterpolant(data.w(im1, jm, km_1),
data.w(im1, jm, km),
data.w(im1, jm, km1),
data.w(im1, jm, km2), t.z);
T z33 = monotonicCubicInterpolant(data.w(im1, jm1, km_1),
data.w(im1, jm1, km),
data.w(im1, jm1, km1),
data.w(im1, jm1, km2), t.z);
T z34 = monotonicCubicInterpolant(data.w(im1, jm2, km_1),
data.w(im1, jm2, km),
data.w(im1, jm2, km1),
data.w(im1, jm2, km2), t.z);
T z41 = monotonicCubicInterpolant(data.w(im2, jm_1, km_1),
data.w(im2, jm_1, km),
data.w(im2, jm_1, km1),
data.w(im2, jm_1, km2), t.z);
T z42 = monotonicCubicInterpolant(data.w(im2, jm, km_1),
data.w(im2, jm, km),
data.w(im2, jm, km1),
data.w(im2, jm, km2), t.z);
T z43 = monotonicCubicInterpolant(data.w(im2, jm1, km_1),
data.w(im2, jm1, km),
data.w(im2, jm1, km1),
data.w(im2, jm1, km2), t.z);
T z44 = monotonicCubicInterpolant(data.w(im2, jm2, km_1),
data.w(im2, jm2, km),
data.w(im2, jm2, km1),
data.w(im2, jm2, km2), t.z);
T y1 = monotonicCubicInterpolant(z11, z12, z13, z14, t.y);
T y2 = monotonicCubicInterpolant(z21, z22, z23, z24, t.y);
T y3 = monotonicCubicInterpolant(z31, z32, z33, z34, t.y);
T y4 = monotonicCubicInterpolant(z41, z42, z43, z44, t.y);
ret.z = monotonicCubicInterpolant(y1, y2, y3, y4, t.x);
}
return ret;
}
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...

References FieldRes::dataWindow(), FIELD3D_VEC3_T, monotonicCubicInterpolant(), MACField< Data_T >::u(), MACField< Data_T >::v(), and MACField< Data_T >::w().

## Member Data Documentation

## DEFINE_FIELD_RTTI_CONCRETE_CLASS

template<class Data_T>

CubicMACFieldInterp< Data_T >::DEFINE_FIELD_RTTI_CONCRETE_CLASS

Definition at line 446 of file FieldInterp.h.

## ms_classType

template<class Data_T>

TemplatedFieldType<CubicMACFieldInterp<Data_T> > CubicMACFieldInterp< Data_T >::ms_classType

static private

Definition at line 466 of file FieldInterp.h.

Referenced by staticClassType().

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

- export/FieldInterp.h