LinearFieldInterp< Data_T > Class Template Reference

`#include <FieldInterp.h>`

Inheritance diagram for LinearFieldInterp< Data_T >:

## Public Types

typedef LinearFieldInterp | class_type
typedef boost::intrusive_ptr< LinearFieldInterp > | 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< LinearFieldInterp< Data_T > > | ms_classType

## Detailed Description

template<class Data_T>
class LinearFieldInterp< Data_T >

Definition at line 136 of file FieldInterp.h.

## Member Typedef Documentation

## value_type

template<class Data_T>

typedef Data_T LinearFieldInterp< Data_T >::value_type

Definition at line 142 of file FieldInterp.h.

## Ptr

template<class Data_T>

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

Definition at line 143 of file FieldInterp.h.

## class_type

template<class Data_T>

typedef LinearFieldInterp LinearFieldInterp< Data_T >::class_type

Definition at line 147 of file FieldInterp.h.

## base

template<class Data_T>

typedef FieldInterp<Data_T> LinearFieldInterp< Data_T >::base

private

Convenience typedef for referring to base class.

Definition at line 173 of file FieldInterp.h.

## Member Function Documentation

## staticClassName()

template<class Data_T>

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

inline static

Definition at line 150 of file FieldInterp.h.

{
return "LinearFieldInterp";
}

## staticClassType()

template<class Data_T>

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

inline static

Definition at line 155 of file FieldInterp.h.

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

References ms_classType.

## sample()

template<class Data_T>

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

virtual

Implements FieldInterp< Data_T >.

Definition at line 606 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.
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);
// Clamp the indexing coordinates
if (true) {
const Box3i &dataWindow = data.dataWindow();
c1.x = std::max(dataWindow.min.x, std::min(c1.x, dataWindow.max.x));
c2.x = std::max(dataWindow.min.x, std::min(c2.x, dataWindow.max.x));
c1.y = std::max(dataWindow.min.y, std::min(c1.y, dataWindow.max.y));
c2.y = std::max(dataWindow.min.y, std::min(c2.y, dataWindow.max.y));
c1.z = std::max(dataWindow.min.z, std::min(c1.z, dataWindow.max.z));
c2.z = std::max(dataWindow.min.z, std::min(c2.z, dataWindow.max.z));
}
return static_cast<Data_T>
(f1.x * (f1.y * (f1.z * data.value(c1.x, c1.y, c1.z) +
f2.z * data.value(c1.x, c1.y, c2.z)) +
f2.y * (f1.z * data.value(c1.x, c2.y, c1.z) +
f2.z * data.value(c1.x, c2.y, c2.z))) +
f2.x * (f1.y * (f1.z * data.value(c2.x, c1.y, c1.z) +
f2.z * data.value(c2.x, c1.y, c2.z)) +
f2.y * (f1.z * data.value(c2.x, c2.y, c1.z) +
f2.z * data.value(c2.x, c2.y, c2.z))));
}
V3i
Imath::V3i V3i
Definition SpiMathLib.h:71
LinearFieldInterp
Definition FieldInterp.h:137

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

## Member Data Documentation

## DEFINE_FIELD_RTTI_CONCRETE_CLASS

template<class Data_T>

LinearFieldInterp< Data_T >::DEFINE_FIELD_RTTI_CONCRETE_CLASS

Definition at line 148 of file FieldInterp.h.

## ms_classType

template<class Data_T>

TemplatedFieldType<LinearFieldInterp<Data_T> > LinearFieldInterp< Data_T >::ms_classType

static private

Definition at line 168 of file FieldInterp.h.

Referenced by staticClassType().

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

- export/FieldInterp.h