3#ifndef __F3DUTIL_FIELDWRAPPER_H__
4#define __F3DUTIL_FIELDWRAPPER_H__
9#include <OpenEXR/ImathMatrixAlgo.h>
45 typedef boost::shared_ptr<ValueRemapOp>
Ptr;
50 virtual float remap(
const float value)
const = 0;
62template <
typename Field_T>
66 typedef std::vector<FieldWrapper>
Vec;
85 if (!Imath::extractScaling(
osToWs, ws,
false)) {
86 Msg::print(
"WARNING: FieldGroup/FieldWrapper: "
87 "Couldn't extract world scale from object-to-world "
88 "transform. Defaulting to 1.0.");
90 worldScale = std::max(std::max(ws.x, ws.y), ws.z);
102 if (!doWsBoundsOptimization_)
108 const float time = 0;
112 vsToWs =
wsToVs.inverse();
115 vsToWs =
wsToVs.inverse();
117 const Imath::Box3d wsBounds_d = Imath::transform(
vsBounds,
119 wsBounds = Imath::Box3f(wsBounds_d.min, wsBounds_d.max);
156template <
typename Field_T>
160 typedef std::vector<MIPFieldWrapper>
Vec;
182 if (!Imath::extractScaling(
osToWs, ws,
false)) {
183 Msg::print(
"WARNING: FieldGroup/FieldWrapper: "
184 "Couldn't extract world scale from object-to-world "
185 "transform. Defaulting to 1.0.");
187 worldScale = std::max(std::max(ws.x, ws.y), ws.z);
199 if (!doWsBoundsOptimization_)
205 const float time = 0;
209 vsToWs =
wsToVs.inverse();
212 vsToWs =
wsToVs.inverse();
214 const Imath::Box3d wsBounds_d = Imath::transform(
vsBounds,
216 wsBounds = Imath::Box3f(wsBounds_d.min, wsBounds_d.max);
Contains the DenseField class.
Contains the Field3DFile classes.
Contains the FieldInterp base class and some standard interpolation classes.
Contains the FieldMapping base class and the NullFieldMapping and MatrixFieldMapping subclasses.
Box3d continuousBounds(const Box3i &bbox)
Contains the initIO function.
Contains the MIPField class.
Contains MIP-related utility functions.
Contains the SparseField class.
Represents the mapping of a field by a matrix transform.
const M44d & worldToVoxel() const
Returns a reference to the world to voxel space transform.
The ValueRemapOp class is used when shader-like calculations need to be applied to individual fields ...
virtual V3f remap(const V3f &value) const =0
Remaps a V3f value.
boost::shared_ptr< ValueRemapOp > Ptr
virtual float remap(const float value) const =0
Remaps a float value.
FIELD3D_API void print(Severity severity, const std::string &message)
Sends the string to the assigned output, prefixing the message with the severity.
#define FIELD3D_NAMESPACE_HEADER_CLOSE
This class wraps up a single field to make its interpolator and its mapping easily accessible....
bool doWsBoundsOptimization
ValueRemapOp::Ptr valueRemapOpPtr
Optionally, set a ValueRemapOp to remap values.
M44d osToWs
Optionally, enable doOsToWs to apply a world to object transform before lookups.
FieldWrapper(const typename Field_T::Ptr f)
void setOsToWs(const M44d &i_osToWs)
const ValueRemapOp * valueRemapOp
std::vector< FieldWrapper > Vec
M44d wsToVs
Optionally, enable wsBounds optimization to use a world axis aligned bounding box in lookups.
Field_T::LinearInterp interp
void setValueRemapOp(ValueRemapOp::Ptr op)
void setWsBoundsOptimization(const bool doWsBoundsOptimization_)
const Field3D::FieldMapping * mapping
This class wraps up a single MIP field to make its interpolator and its mapping easily accessible....
MIPFieldWrapper(const typename Field_T::Ptr f)
void setWsBoundsOptimization(const bool doWsBoundsOptimization_)
boost::shared_ptr< LinearInterp > interpPtr
void setValueRemapOp(ValueRemapOp::Ptr op)
void setOsToWs(const M44d &i_osToWs)
std::vector< MIPFieldWrapper > Vec
ValueRemapOp::Ptr valueRemapOpPtr
Optionally, set a ValueRemapOp to remap values.
M44d osToWs
Optionally, enable doOsToWs to apply a world to object transform before lookups.
Field_T::LinearInterp LinearInterp
M44d wsToVs
Optionally, enable wsBounds optimization to use a world axis aligned bounding box in lookups.
bool doWsBoundsOptimization
const Field3D::FieldMapping * mapping
const ValueRemapOp * valueRemapOp