Field3D
CubicGenericFieldInterp< Field_T > Class Template Reference

#include <FieldInterp.h>

Inheritance diagram for CubicGenericFieldInterp< Field_T >:
RefBase

Public Types

typedef CubicGenericFieldInterp class_type
 
typedef boost::intrusive_ptr< CubicGenericFieldInterpPtr
 
typedef Field_T::value_type value_type
 
- Public Types inherited from RefBase
typedef boost::intrusive_ptr< RefBasePtr
 
typedef boost::weak_ptr< RefBaseWeakPtr
 

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.
 
RefBaseoperator= (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>
static const char * CubicGenericFieldInterp< Field_T >::staticClassName ( )
inlinestatic

Definition at line 389 of file FieldInterp.h.

390 {
391 return "CubicGenericFieldInterp";
392 }

◆ staticClassType()

template<class Field_T>
static const char * CubicGenericFieldInterp< Field_T >::staticClassType ( )
inlinestatic

Definition at line 394 of file FieldInterp.h.

395 {
396 return ms_classType.name();
397 }
static TemplatedFieldType< CubicGenericFieldInterp< Field_T > > ms_classType

◆ 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.

1085{
1086 typedef typename Field_T::value_type Data_T;
1087
1088 // Pixel centers are at .5 coordinates
1089 // NOTE: Don't use contToDisc for this, we're looking for sample
1090 // point locations, not coordinate shifts.
1091 V3d clampedVsP(std::max(0.5, vsP.x),
1092 std::max(0.5, vsP.y),
1093 std::max(0.5, vsP.z));
1095
1096 const Box3i &dataWindow = data.dataWindow();
1097
1098 // Lower left corner
1099 V3i c(static_cast<int>(floor(p.x)),
1100 static_cast<int>(floor(p.y)),
1101 static_cast<int>(floor(p.z)));
1102
1103 // Fractions
1105
1106 // Clamp the coordinates
1107 int im, jm, km;
1108 im = std::max(dataWindow.min.x, std::min(c.x, dataWindow.max.x));
1109 jm = std::max(dataWindow.min.y, std::min(c.y, dataWindow.max.y));
1110 km = std::max(dataWindow.min.z, std::min(c.z, dataWindow.max.z));
1111 int im_1, jm_1, km_1;
1112 im_1 = std::max(dataWindow.min.x, std::min(im - 1, dataWindow.max.x));
1113 jm_1 = std::max(dataWindow.min.y, std::min(jm - 1, dataWindow.max.y));
1114 km_1 = std::max(dataWindow.min.z, std::min(km - 1, dataWindow.max.z));
1115 int im1, jm1, km1;
1116 im1 = std::max(dataWindow.min.x, std::min(im + 1, dataWindow.max.x));
1117 jm1 = std::max(dataWindow.min.y, std::min(jm + 1, dataWindow.max.y));
1118 km1 = std::max(dataWindow.min.z, std::min(km + 1, dataWindow.max.z));
1119 int im2, jm2, km2;
1120 im2 = std::max(dataWindow.min.x, std::min(im + 2, dataWindow.max.x));
1121 jm2 = std::max(dataWindow.min.y, std::min(jm + 2, dataWindow.max.y));
1122 km2 = std::max(dataWindow.min.z, std::min(km + 2, dataWindow.max.z));
1123
1125 data.fastValue(im_1, jm_1, km),
1126 data.fastValue(im_1, jm_1, km1),
1127 data.fastValue(im_1, jm_1, km2), t.z);
1129 data.fastValue(im_1, jm, km),
1130 data.fastValue(im_1, jm, km1),
1131 data.fastValue(im_1, jm, km2), t.z);
1133 data.fastValue(im_1, jm1, km),
1134 data.fastValue(im_1, jm1, km1),
1135 data.fastValue(im_1, jm1, km2), t.z);
1137 data.fastValue(im_1, jm2, km),
1138 data.fastValue(im_1, jm2, km1),
1139 data.fastValue(im_1, jm2, km2), t.z);
1140
1142 data.fastValue(im, jm_1, km),
1143 data.fastValue(im, jm_1, km1),
1144 data.fastValue(im, jm_1, km2), t.z);
1146 data.fastValue(im, jm, km),
1147 data.fastValue(im, jm, km1),
1148 data.fastValue(im, jm, km2), t.z);
1150 data.fastValue(im, jm1, km),
1151 data.fastValue(im, jm1, km1),
1152 data.fastValue(im, jm1, km2), t.z);
1154 data.fastValue(im, jm2, km),
1155 data.fastValue(im, jm2, km1),
1156 data.fastValue(im, jm2, km2), t.z);
1157
1159 data.fastValue(im1, jm_1, km),
1160 data.fastValue(im1, jm_1, km1),
1161 data.fastValue(im1, jm_1, km2), t.z);
1163 data.fastValue(im1, jm, km),
1164 data.fastValue(im1, jm, km1),
1165 data.fastValue(im1, jm, km2), t.z);
1167 data.fastValue(im1, jm1, km),
1168 data.fastValue(im1, jm1, km1),
1169 data.fastValue(im1, jm1, km2), t.z);
1171 data.fastValue(im1, jm2, km),
1172 data.fastValue(im1, jm2, km1),
1173 data.fastValue(im1, jm2, km2), t.z);
1174
1176 data.fastValue(im2, jm_1, km),
1177 data.fastValue(im2, jm_1, km1),
1178 data.fastValue(im2, jm_1, km2), t.z);
1180 data.fastValue(im2, jm, km),
1181 data.fastValue(im2, jm, km1),
1182 data.fastValue(im2, jm, km2), t.z);
1184 data.fastValue(im2, jm1, km),
1185 data.fastValue(im2, jm1, km1),
1186 data.fastValue(im2, jm1, km2), t.z);
1188 data.fastValue(im2, jm2, km),
1189 data.fastValue(im2, jm2, km1),
1190 data.fastValue(im2, jm2, km2), t.z);
1191
1196
1198
1199 return z0;
1200}
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 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
staticprivate

Definition at line 408 of file FieldInterp.h.


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