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 ...
boost::shared_ptr< ValueRemapOp > Ptr
virtual V3f remap(const V3f &value) const =0
Remaps a V3f value.
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
bool doWsBoundsOptimization
Field3D::DenseField< T > field_type
ValueRemapOp::Ptr valueRemapOpPtr
FieldWrapper(const typename Field_T::Ptr f)
void setOsToWs(const M44d &i_osToWs)
const ValueRemapOp * valueRemapOp
Field3D::DenseField< T >::Ptr fieldPtr
std::vector< FieldWrapper > Vec
Field3D::DenseField< T >::LinearInterp interp
void setValueRemapOp(ValueRemapOp::Ptr op)
void setWsBoundsOptimization(const bool doWsBoundsOptimization_)
const Field3D::DenseField< T > * field
const Field3D::FieldMapping * mapping
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)
Field3D::MIPField< Field3D::DenseField< T > >::Ptr fieldPtr
std::vector< MIPFieldWrapper > Vec
ValueRemapOp::Ptr valueRemapOpPtr
Field3D::MIPField< Field3D::DenseField< T > >::LinearInterp LinearInterp
Field3D::MIPField< Field3D::DenseField< T > > field_type
const Field3D::MIPField< Field3D::DenseField< T > > * field
bool doWsBoundsOptimization
const Field3D::FieldMapping * mapping
const ValueRemapOp * valueRemapOp