LinearGenericFieldInterp< Field_T > Class Template Reference

`#include <FieldInterp.h>`

Inheritance diagram for LinearGenericFieldInterp< Field_T >:

## Public Types

typedef LinearGenericFieldInterp | class_type
typedef boost::intrusive_ptr< LinearGenericFieldInterp > | 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< LinearGenericFieldInterp< Field_T > > | ms_classType

## Detailed Description

template<class Field_T>
class LinearGenericFieldInterp< Field_T >

Definition at line 253 of file FieldInterp.h.

## Member Typedef Documentation

## value_type

template<class Field_T>

typedef Field_T::value_type LinearGenericFieldInterp< Field_T >::value_type

Definition at line 259 of file FieldInterp.h.

## Ptr

template<class Field_T>

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

Definition at line 260 of file FieldInterp.h.

## class_type

template<class Field_T>

typedef LinearGenericFieldInterp LinearGenericFieldInterp< Field_T >::class_type

Definition at line 264 of file FieldInterp.h.

## base

template<class Field_T>

typedef RefBase LinearGenericFieldInterp< Field_T >::base

private

Convenience typedef for referring to base class.

Definition at line 290 of file FieldInterp.h.

## Member Function Documentation

## staticClassName()

template<class Field_T>

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

inline static

Definition at line 267 of file FieldInterp.h.

{
return "LinearGenericFieldInterp";
}

## staticClassType()

template<class Field_T>

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

inline static

Definition at line 272 of file FieldInterp.h.

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

## sample()

template<class Field_T>

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

Definition at line 773 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.
FIELD3D_VEC3_T<double> p(vsP - FIELD3D_VEC3_T<double>(0.5));
// Lower left corner
V3i c1(static_cast<int>(floor(p.x)),
static_cast<int>(floor(p.y)),
static_cast<int>(floor(p.z)));
// Upper right corner
V3i c2(c1 + V3i(1));
// C1 fractions
FIELD3D_VEC3_T<double> f1(static_cast<FIELD3D_VEC3_T<double> >(c2) - p);
// C2 fraction
FIELD3D_VEC3_T<double> f2(static_cast<FIELD3D_VEC3_T<double> >(1.0) - f1);
const Box3i &dataWindow = data.dataWindow();
// Clamp the coordinates
c1.x = std::min(dataWindow.max.x, std::max(dataWindow.min.x, c1.x));
c1.y = std::min(dataWindow.max.y, std::max(dataWindow.min.y, c1.y));
c1.z = std::min(dataWindow.max.z, std::max(dataWindow.min.z, c1.z));
c2.x = std::min(dataWindow.max.x, std::max(dataWindow.min.x, c2.x));
c2.y = std::min(dataWindow.max.y, std::max(dataWindow.min.y, c2.y));
c2.z = std::min(dataWindow.max.z, std::max(dataWindow.min.z, c2.z));
return static_cast<Data_T>
(f1.x * (f1.y * (f1.z * data.fastValue(c1.x, c1.y, c1.z) +
f2.z * data.fastValue(c1.x, c1.y, c2.z)) +
f2.y * (f1.z * data.fastValue(c1.x, c2.y, c1.z) +
f2.z * data.fastValue(c1.x, c2.y, c2.z))) +
f2.x * (f1.y * (f1.z * data.fastValue(c2.x, c1.y, c1.z) +
f2.z * data.fastValue(c2.x, c1.y, c2.z)) +
f2.y * (f1.z * data.fastValue(c2.x, c2.y, c1.z) +
f2.z * data.fastValue(c2.x, c2.y, c2.z))));
}
V3i
Imath::V3i V3i
Definition SpiMathLib.h:71
LinearGenericFieldInterp
Definition FieldInterp.h:254

References FIELD3D_VEC3_T.

## Member Data Documentation

## DEFINE_FIELD_RTTI_CONCRETE_CLASS

template<class Field_T>

LinearGenericFieldInterp< Field_T >::DEFINE_FIELD_RTTI_CONCRETE_CLASS

Definition at line 265 of file FieldInterp.h.

## ms_classType

template<class Field_T>

TemplatedFieldType<LinearGenericFieldInterp<Field_T> > LinearGenericFieldInterp< Field_T >::ms_classType

static private

Definition at line 285 of file FieldInterp.h.

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

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