FieldMapping.h
Go to the documentation of this file.
//----------------------------------------------------------------------------//
/*
* Copyright (c) 2009 Sony Pictures Imageworks Inc
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution. Neither the name of Sony Pictures Imageworks nor the
* names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
#ifndef _INCLUDED_Field3D_FieldMapping_H_
#define _INCLUDED_Field3D_FieldMapping_H_
#include <vector>
#include <algorithm>
#include "Curve.h"
#include "Exception.h"
#include "RefCount.h"
#include "Types.h"
//----------------------------------------------------------------------------//
#include "ns.h"
FIELD3D_NAMESPACE_OPEN
//----------------------------------------------------------------------------//
// FieldMapping
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
class FIELD3D_API FieldMapping : public RefBase
{
public:
// Typedefs ------------------------------------------------------------------
typedef boost::intrusive_ptr<FieldMapping> Ptr;
// RTTI replacement ----------------------------------------------------------
typedef FieldMapping class_type;
DEFINE_FIELD_RTTI_ABSTRACT_CLASS;
static const char* staticClassType()
{
return "FieldMapping";
}
// Ctors, dtor ---------------------------------------------------------------
FieldMapping();
FieldMapping(const Box3i &extents);
virtual ~FieldMapping();
// Main methods --------------------------------------------------------------
void setExtents(const Box3i &extents);
const V3d& origin() const
{ return m_origin; }
const V3d& resolution() const
{ return m_res; }
// To be implemented by subclasses -------------------------------------------
virtual Ptr clone() const = 0;
virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const = 0;
virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const = 0;
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const = 0;
virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float time) const = 0;
virtual void worldToLocal(const V3d &wsP, V3d &lsP) const = 0;
virtual void worldToLocal(const V3d &wsP, V3d &lsP, float time) const = 0;
virtual void localToWorld(const V3d &lsP, V3d &wsP) const = 0;
virtual void localToWorld(const V3d &lsP, V3d &wsP, float time) const = 0;
virtual V3d wsVoxelSize(int i, int j, int k) const = 0;
virtual void extentsChanged()
{ /* Empty */ }
virtual std::string className() const = 0;
virtual bool isIdentical(FieldMapping::Ptr other,
double tolerance = 0.0) const = 0;
// Transform calls -----------------------------------------------------------
void localToVoxel(const V3d &lsP, V3d &vsP) const;
void voxelToLocal(const V3d &vsP, V3d &lsP) const;
protected:
V3d m_origin;
V3d m_res;
private:
// Typedefs ------------------------------------------------------------------
typedef RefBase base;
};
//----------------------------------------------------------------------------//
// Utilities
//----------------------------------------------------------------------------//
void worldToVoxel(const Field3D::FieldMapping* mapping,
const Box3d &wsBounds,
Box3d &vsBounds);
void transformBounds(const M44d &mtx,
const Box3d &fromBounds,
Box3d &toBounds);
//----------------------------------------------------------------------------//
// NullFieldMapping
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
class FIELD3D_API NullFieldMapping : public FieldMapping
{
public:
// Typedefs ------------------------------------------------------------------
typedef boost::intrusive_ptr<NullFieldMapping> Ptr;
// RTTI replacement ----------------------------------------------------------
typedef NullFieldMapping class_type;
DEFINE_FIELD_RTTI_CONCRETE_CLASS;
static const char* staticClassType()
{
return "NullFieldMapping";
}
// Ctors, dtor ---------------------------------------------------------------
NullFieldMapping()
: FieldMapping()
{ /* Empty */ }
NullFieldMapping(const Box3i &extents)
: FieldMapping(extents)
{ /* Empty */ }
// From FieldMapping ---------------------------------------------------------
virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const
{ localToVoxel(wsP, vsP); }
virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float /*time*/) const
{ localToVoxel(wsP, vsP); }
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const
{ voxelToLocal(vsP, wsP); }
virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float /*time*/) const
{ voxelToLocal(vsP, wsP); }
virtual void worldToLocal(const V3d &wsP, V3d &lsP) const
{ lsP = wsP; }
virtual void worldToLocal(const V3d &wsP, V3d &lsP, float /*time*/) const
{ lsP = wsP; }
virtual void localToWorld(const V3d &lsP, V3d &wsP) const
{ wsP = lsP; }
virtual void localToWorld(const V3d &lsP, V3d &wsP, float /*time*/) const
{ wsP = lsP; }
virtual std::string className() const;
virtual bool isIdentical(FieldMapping::Ptr other,
double tolerance = 0.0) const;
virtual V3d wsVoxelSize(int /*i*/, int /*j*/, int /*k*/) const
{ return V3d(1.0 / m_res.x, 1.0 / m_res.y, 1.0 / m_res.z); }
virtual FieldMapping::Ptr clone() const;
private:
// Typedefs ------------------------------------------------------------------
typedef FieldMapping base;
};
//----------------------------------------------------------------------------//
// MatrixFieldMapping
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
class FIELD3D_API MatrixFieldMapping : public FieldMapping
{
public:
// Typedefs ------------------------------------------------------------------
typedef boost::intrusive_ptr<MatrixFieldMapping> Ptr;
typedef Curve<Imath::M44d> MatrixCurve;
// RTTI replacement ----------------------------------------------------------
typedef MatrixFieldMapping class_type;
DEFINE_FIELD_RTTI_CONCRETE_CLASS;
static const char* staticClassType()
{
return "MatrixFieldMapping";
}
// Ctors, dtor ---------------------------------------------------------------
MatrixFieldMapping();
MatrixFieldMapping(const Box3i &extents);
// Main methods --------------------------------------------------------------
void setLocalToWorld(const M44d &lsToWs);
void setLocalToWorld(float t, const M44d &lsToWs);
const M44d& localToWorld() const
{ return m_lsToWs; }
const M44d& worldToVoxel() const
{ return m_wsToVs; }
M44d worldToVoxel(float time) const
{
if (!m_isTimeVarying) {
return m_wsToVs;
} else {
return m_vsToWsCurve.linear(time).inverse();
}
}
const M44d& voxelToWorld() const
{ return m_vsToWs; }
const MatrixCurve::SampleVec& localToWorldSamples() const
{ return m_lsToWsCurve.samples(); }
void makeIdentity();
// From FieldMapping ---------------------------------------------------------
virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const
{ m_wsToVs.multVecMatrix(wsP, vsP); }
virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const
{
if (!m_isTimeVarying) {
m_wsToVs.multVecMatrix(wsP, vsP);
} else {
M44d wsToVs = m_vsToWsCurve.linear(time).inverse();
wsToVs.multVecMatrix(wsP, vsP);
}
}
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const
{ m_vsToWs.multVecMatrix(vsP, wsP); }
virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float time) const
{
if (!m_isTimeVarying) {
m_vsToWs.multVecMatrix(vsP, wsP);
} else {
M44d vsToWs = m_vsToWsCurve.linear(time);
vsToWs.multVecMatrix(vsP, wsP);
}
}
virtual void worldToLocal(const V3d &wsP, V3d &lsP) const
{ m_wsToLs.multVecMatrix(wsP, lsP); }
virtual void worldToLocal(const V3d &wsP, V3d &lsP,
float time) const
{
if (!m_isTimeVarying) {
m_wsToLs.multVecMatrix(wsP, lsP);
} else {
M44d wsToLs = m_lsToWsCurve.linear(time).inverse();
wsToLs.multVecMatrix(wsP, lsP);
}
}
virtual void localToWorld(const V3d &lsP, V3d &wsP) const
{ m_lsToWs.multVecMatrix(lsP, wsP); }
virtual void localToWorld(const V3d &lsP, V3d &wsP, float time) const
{
if (!m_isTimeVarying) {
m_lsToWs.multVecMatrix(lsP, wsP);
} else {
M44d lsToWs = m_lsToWsCurve.linear(time);
lsToWs.multVecMatrix(lsP, wsP);
}
}
void worldToVoxelDir(const V3d &wsV, V3d &vsV) const
{ m_wsToVs.multDirMatrix(wsV, vsV); }
void voxelToWorldDir(const V3d &vsV, V3d &wsV) const
{ m_vsToWs.multDirMatrix(vsV, wsV); }
void worldToLocalDir(const V3d &wsV, V3d &lsV) const
{ m_wsToLs.multDirMatrix(wsV, lsV); }
void localToWorldDir(const V3d &lsV, V3d &wsV) const
{ m_lsToWs.multDirMatrix(lsV, wsV); }
virtual void extentsChanged();
virtual std::string className() const;
virtual bool isIdentical(FieldMapping::Ptr other,
double tolerance = 0.0) const;
virtual V3d wsVoxelSize(int /*i*/, int /*j*/, int /*k*/) const
{ return m_wsVoxelSize; }
virtual FieldMapping::Ptr clone() const;
private:
void updateTransform();
void getLocalToVoxelMatrix(M44d &result);
// Data members -------------------------------------------------------------
M44d m_lsToWs;
M44d m_wsToLs;
M44d m_vsToWs;
M44d m_wsToVs;
MatrixCurve m_lsToWsCurve;
MatrixCurve m_vsToWsCurve;
bool m_isTimeVarying;
V3d m_wsVoxelSize;
// Typedefs ------------------------------------------------------------------
typedef FieldMapping base;
};
//----------------------------------------------------------------------------//
// FrustumFieldMapping
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
class FIELD3D_API FrustumFieldMapping : public FieldMapping
{
public:
// Typedefs ------------------------------------------------------------------
typedef boost::intrusive_ptr<FrustumFieldMapping> Ptr;
typedef Curve<Imath::M44d> MatrixCurve;
typedef Curve<double> FloatCurve;
// Exceptions ----------------------------------------------------------------
DECLARE_FIELD3D_GENERIC_EXCEPTION(BadPerspectiveMatrix, Exc::Exception)
// Enums ---------------------------------------------------------------------
enum ZDistribution {
PerspectiveDistribution,
UniformDistribution
};
// RTTI replacement ----------------------------------------------------------
typedef FrustumFieldMapping class_type;
DEFINE_FIELD_RTTI_CONCRETE_CLASS;
static const char* staticClassType()
{
return "FrustumFieldMapping";
}
// Ctors, dtor ---------------------------------------------------------------
FrustumFieldMapping();
FrustumFieldMapping(const Box3i &extents);
// Main methods --------------------------------------------------------------
void setTransforms(const M44d &ssToWs, const M44d &csToWs);
void setTransforms(float t, const M44d &ssToWs, const M44d &csToWs);
void setZDistribution(ZDistribution dist)
{ m_zDistribution = dist; }
ZDistribution zDistribution() const
{ return m_zDistribution; }
const M44d screenToWorld() const
{ return m_ssToWsCurve.linear(0.0); }
const M44d cameraToWorld() const
{ return m_csToWsCurve.linear(0.0); }
const MatrixCurve::SampleVec& screenToWorldSamples() const
{ return m_ssToWsCurve.samples(); }
const MatrixCurve::SampleVec& cameraToWorldSamples() const
{ return m_csToWsCurve.samples(); }
const FloatCurve::SampleVec& nearPlaneSamples() const
{ return m_nearCurve.samples(); }
const FloatCurve::SampleVec& farPlaneSamples() const
{ return m_farCurve.samples(); }
double nearPlane() const
{ return m_nearCurve.linear(0.0); }
double farPlane() const
{ return m_farCurve.linear(0.0); }
void reset();
// From FieldMapping ---------------------------------------------------------
virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const;
virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const;
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const;
virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float time) const;
virtual void worldToLocal(const V3d &wsP, V3d &lsP) const;
virtual void worldToLocal(const V3d &wsP, V3d &lsP, float time) const;
virtual void localToWorld(const V3d &lsP, V3d &wsP) const;
virtual void localToWorld(const V3d &lsP, V3d &wsP, float time) const;
virtual void extentsChanged();
virtual std::string className() const;
virtual bool isIdentical(FieldMapping::Ptr other,
double tolerance = 0.0) const;
virtual V3d wsVoxelSize(int i, int j, int k) const;
virtual FieldMapping::Ptr clone() const;
private:
void computeVoxelSize();
void getLocalToVoxelMatrix(M44d &result);
void clearCurves();
// Data members -------------------------------------------------------------
ZDistribution m_zDistribution;
MatrixCurve m_ssToWsCurve;
MatrixCurve m_csToWsCurve;
MatrixCurve m_lpsToWsCurve;
FloatCurve m_nearCurve;
FloatCurve m_farCurve;
std::vector<V3d> m_wsVoxelSize;
bool m_defaultState;
// Typedefs ------------------------------------------------------------------
typedef FieldMapping base;
};
//----------------------------------------------------------------------------//
FIELD3D_NAMESPACE_HEADER_CLOSE
//----------------------------------------------------------------------------//
#endif // Include guard
Curve.h
Contains the Curve class which is used to interpolate attributes in time.
Exception.h
Contains Exception base class.
DECLARE_FIELD3D_GENERIC_EXCEPTION
#define DECLARE_FIELD3D_GENERIC_EXCEPTION(name, base_class)
Used to declare a generic but named exception.
Definition Exception.h:107
worldToVoxel
void worldToVoxel(const Field3D::FieldMapping *mapping, const Box3d &wsBounds, Box3d &vsBounds)
Computes a voxel space bounds given a bounding box in world space. This is done by transforming each ...
Definition FieldMapping.cpp:173
transformBounds
void transformBounds(const M44d &mtx, const Box3d &fromBounds, Box3d &toBounds)
Transforms a bounding box by a 4x4 matrix This is done by transforming each corner vertex from world ...
Definition FieldMapping.cpp:200
isIdentical
bool isIdentical(typename Field< Data_T >::Ptr a, typename Field< Data_T >::Ptr b)
Checks whether the span and data in two different fields are identical.
Definition Field.h:1037
RefCount.h
Contains base class for reference counting with Mutex.
Box3d
Imath::Box3d Box3d
Definition SpiMathLib.h:79
V3d
Imath::V3d V3d
Definition SpiMathLib.h:74
Box3i
Imath::Box3i Box3i
Definition SpiMathLib.h:77
M44d
Imath::M44d M44d
Definition SpiMathLib.h:82
Types.h
Contains typedefs for the commonly used types in Field3D.
Curve
Implements a simple function curve where samples of type T can be added along a 1D axis....
Definition Curve.h:96
Curve< Imath::M44d >::SampleVec
std::vector< Sample > SampleVec
Definition Curve.h:102
Exc::Exception
Definition Exception.h:74
FieldMapping
Base class for mapping between world-, local- and voxel coordinates.
Definition FieldMapping.h:87
FieldMapping::class_type
FieldMapping class_type
Definition FieldMapping.h:96
FieldMapping::m_origin
V3d m_origin
The integer voxel-space origin of the underlying Field object. Is equal to field.extents....
Definition FieldMapping.h:190
FieldMapping::resolution
const V3d & resolution() const
Returns the resolution.
Definition FieldMapping.h:131
FieldMapping::base
RefBase base
Convenience typedef for referring to base class.
Definition FieldMapping.h:200
FieldMapping::DEFINE_FIELD_RTTI_ABSTRACT_CLASS
DEFINE_FIELD_RTTI_ABSTRACT_CLASS
Definition FieldMapping.h:97
FieldMapping::wsVoxelSize
virtual V3d wsVoxelSize(int i, int j, int k) const =0
Returns world-space size of a voxel at the specified coordinate.
FieldMapping::voxelToWorld
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const =0
Transform from voxel space position into world space.
FieldMapping::FieldMapping
FieldMapping()
Constructor.
Definition FieldMapping.cpp:113
FieldMapping::localToWorld
virtual void localToWorld(const V3d &lsP, V3d &wsP, float time) const =0
FieldMapping::extentsChanged
virtual void extentsChanged()
Implement this if the subclass needs to update itself when the resolution changes.
Definition FieldMapping.h:161
FieldMapping::m_res
V3d m_res
The integer voxel-space resolution of the underlying Field object. Is equal to field....
Definition FieldMapping.h:193
FieldMapping::clone
virtual Ptr clone() const =0
Returns a pointer to a copy of the mapping, pure virtual so ensure derived classes properly implement...
FieldMapping::worldToLocal
virtual void worldToLocal(const V3d &wsP, V3d &lsP) const =0
Transform from world space position into local space.
FieldMapping::origin
const V3d & origin() const
Returns the origin.
Definition FieldMapping.h:128
FieldMapping::worldToVoxel
virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const =0
Transform from world space position into voxel space.
FieldMapping::voxelToLocal
void voxelToLocal(const V3d &vsP, V3d &lsP) const
Inverse of localToVoxel.
Definition FieldMapping.cpp:162
FieldMapping::localToVoxel
void localToVoxel(const V3d &lsP, V3d &vsP) const
Transform from local space to voxel space. This is just a multiplication by the resolution of the Fie...
Definition FieldMapping.cpp:155
FieldMapping::localToWorld
virtual void localToWorld(const V3d &lsP, V3d &wsP) const =0
Transform from local space position into world space.
FieldMapping::isIdentical
virtual bool isIdentical(FieldMapping::Ptr other, double tolerance=0.0) const =0
Whether the mapping is identical to another mapping.
FieldMapping::voxelToWorld
virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float time) const =0
FieldMapping::worldToLocal
virtual void worldToLocal(const V3d &wsP, V3d &lsP, float time) const =0
FieldMapping::staticClassType
static const char * staticClassType()
Definition FieldMapping.h:99
FieldMapping::Ptr
boost::intrusive_ptr< FieldMapping > Ptr
Definition FieldMapping.h:92
FieldMapping::worldToVoxel
virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const =0
FrustumFieldMapping
Represents the mapping of a field by a perspective transform.
Definition FieldMapping.h:565
FrustumFieldMapping::ZDistribution
ZDistribution
Enumerates the Z slice distribution. .f3d files will store values as an int, so be very careful not t...
Definition FieldMapping.h:585
FrustumFieldMapping::PerspectiveDistribution
@ PerspectiveDistribution
Definition FieldMapping.h:586
FrustumFieldMapping::UniformDistribution
@ UniformDistribution
Definition FieldMapping.h:587
FrustumFieldMapping::m_lpsToWsCurve
MatrixCurve m_lpsToWsCurve
Time-varying local perspective to world space transform. Computed from m_ssToWsCurve.
Definition FieldMapping.h:726
FrustumFieldMapping::m_defaultState
bool m_defaultState
Boolean to tell us if the mapping is in its 'default' state. This is needed because the class has a d...
Definition FieldMapping.h:740
FrustumFieldMapping::farPlaneSamples
const FloatCurve::SampleVec & farPlaneSamples() const
Returns a vector of all motion samples for far plane.
Definition FieldMapping.h:655
FrustumFieldMapping::cameraToWorldSamples
const MatrixCurve::SampleVec & cameraToWorldSamples() const
Returns a vector of all motion samples for camera to world transform.
Definition FieldMapping.h:647
FrustumFieldMapping::m_ssToWsCurve
MatrixCurve m_ssToWsCurve
Time-varying local perspective to world space transform This is not used in calculations,...
Definition FieldMapping.h:721
FrustumFieldMapping::m_farCurve
FloatCurve m_farCurve
Time-varying far plane. Computed from m_lpsToWsCurve.
Definition FieldMapping.h:730
FrustumFieldMapping::setZDistribution
void setZDistribution(ZDistribution dist)
Sets the z slice distribution.
Definition FieldMapping.h:626
FrustumFieldMapping::screenToWorldSamples
const MatrixCurve::SampleVec & screenToWorldSamples() const
Returns a vector of all motion samples for screen to world transform.
Definition FieldMapping.h:643
FrustumFieldMapping::m_wsVoxelSize
std::vector< V3d > m_wsVoxelSize
Precomputed world-space voxel size. Calculations may assume orthogonal transformation for efficiency.
Definition FieldMapping.h:734
FrustumFieldMapping::DEFINE_FIELD_RTTI_CONCRETE_CLASS
DEFINE_FIELD_RTTI_CONCRETE_CLASS
Definition FieldMapping.h:593
FrustumFieldMapping::zDistribution
ZDistribution zDistribution() const
Returns the z slice distribution.
Definition FieldMapping.h:629
FrustumFieldMapping::base
FieldMapping base
Convenience typedef for referring to base class.
Definition FieldMapping.h:745
FrustumFieldMapping::m_nearCurve
FloatCurve m_nearCurve
Time-varying near plane. Computed from m_lpsToWsCurve.
Definition FieldMapping.h:728
FrustumFieldMapping::screenToWorld
const M44d screenToWorld() const
Returns a reference to the screen to world space transform.
Definition FieldMapping.h:634
FrustumFieldMapping::Ptr
boost::intrusive_ptr< FrustumFieldMapping > Ptr
Convenience typedef.
Definition FieldMapping.h:571
FrustumFieldMapping::FloatCurve
Curve< double > FloatCurve
Time-varying float.
Definition FieldMapping.h:575
FrustumFieldMapping::farPlane
double farPlane() const
Returns the far plane.
Definition FieldMapping.h:663
FrustumFieldMapping::cameraToWorld
const M44d cameraToWorld() const
Returns a reference to the camera to world space transform.
Definition FieldMapping.h:639
FrustumFieldMapping::m_zDistribution
ZDistribution m_zDistribution
Slice distribution type.
Definition FieldMapping.h:716
FrustumFieldMapping::nearPlane
double nearPlane() const
Returns the near plane.
Definition FieldMapping.h:659
FrustumFieldMapping::MatrixCurve
Curve< Imath::M44d > MatrixCurve
Time-varying matrix.
Definition FieldMapping.h:573
FrustumFieldMapping::staticClassType
static const char * staticClassType()
Definition FieldMapping.h:595
FrustumFieldMapping::FrustumFieldMapping
FrustumFieldMapping()
Definition FieldMapping.cpp:423
FrustumFieldMapping::class_type
FrustumFieldMapping class_type
Definition FieldMapping.h:592
FrustumFieldMapping::nearPlaneSamples
const FloatCurve::SampleVec & nearPlaneSamples() const
Returns a vector of all motion samples for near plane.
Definition FieldMapping.h:651
FrustumFieldMapping::m_csToWsCurve
MatrixCurve m_csToWsCurve
Time-varying camera to world space transform.
Definition FieldMapping.h:723
MatrixFieldMapping
Represents the mapping of a field by a matrix transform.
Definition FieldMapping.h:335
MatrixFieldMapping::m_vsToWsCurve
MatrixCurve m_vsToWsCurve
Time-varying voxel to world space transform.
Definition FieldMapping.h:517
MatrixFieldMapping::MatrixCurve
Curve< Imath::M44d > MatrixCurve
Time-varying matrix.
Definition FieldMapping.h:343
MatrixFieldMapping::staticClassType
static const char * staticClassType()
Definition FieldMapping.h:350
MatrixFieldMapping::base
FieldMapping base
Convenience typedef for referring to base class.
Definition FieldMapping.h:530
MatrixFieldMapping::MatrixFieldMapping
MatrixFieldMapping()
Definition FieldMapping.cpp:253
MatrixFieldMapping::Ptr
boost::intrusive_ptr< MatrixFieldMapping > Ptr
Convenience typedef.
Definition FieldMapping.h:341
MatrixFieldMapping::wsVoxelSize
virtual V3d wsVoxelSize(int, int, int) const
Returns world-space size of a voxel at the specified coordinate.
Definition FieldMapping.h:484
MatrixFieldMapping::voxelToWorld
virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float time) const
Definition FieldMapping.h:426
MatrixFieldMapping::voxelToWorldDir
void voxelToWorldDir(const V3d &vsV, V3d &wsV) const
Definition FieldMapping.h:466
MatrixFieldMapping::localToWorld
const M44d & localToWorld() const
Returns a reference to the local to world transform.
Definition FieldMapping.h:376
MatrixFieldMapping::localToWorld
virtual void localToWorld(const V3d &lsP, V3d &wsP) const
Transform from local space position into world space.
Definition FieldMapping.h:449
MatrixFieldMapping::m_wsToVs
M44d m_wsToVs
World space to voxel space.
Definition FieldMapping.h:512
MatrixFieldMapping::m_wsToLs
M44d m_wsToLs
World space to local space.
Definition FieldMapping.h:506
MatrixFieldMapping::m_isTimeVarying
bool m_isTimeVarying
Stores whether the curve has more than one time sample.
Definition FieldMapping.h:521
MatrixFieldMapping::voxelToWorld
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const
Transform from voxel space position into world space.
Definition FieldMapping.h:424
MatrixFieldMapping::worldToLocal
virtual void worldToLocal(const V3d &wsP, V3d &lsP) const
Transform from world space position into local space.
Definition FieldMapping.h:436
MatrixFieldMapping::worldToVoxel
virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const
Transform from world space position into voxel space.
Definition FieldMapping.h:412
MatrixFieldMapping::worldToLocal
virtual void worldToLocal(const V3d &wsP, V3d &lsP, float time) const
Definition FieldMapping.h:438
MatrixFieldMapping::DEFINE_FIELD_RTTI_CONCRETE_CLASS
DEFINE_FIELD_RTTI_CONCRETE_CLASS
Definition FieldMapping.h:348
MatrixFieldMapping::m_vsToWs
M44d m_vsToWs
Voxel space to world space.
Definition FieldMapping.h:509
MatrixFieldMapping::localToWorld
virtual void localToWorld(const V3d &lsP, V3d &wsP, float time) const
Definition FieldMapping.h:451
MatrixFieldMapping::worldToVoxel
virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const
Definition FieldMapping.h:414
MatrixFieldMapping::voxelToWorld
const M44d & voxelToWorld() const
Returns a reference to the voxel to world space transform.
Definition FieldMapping.h:396
MatrixFieldMapping::worldToVoxel
M44d worldToVoxel(float time) const
Returns the world to voxel space transform at a given time.
Definition FieldMapping.h:385
MatrixFieldMapping::localToWorldSamples
const MatrixCurve::SampleVec & localToWorldSamples() const
Returns a vector of all motion samples for local to world transform.
Definition FieldMapping.h:400
MatrixFieldMapping::m_lsToWsCurve
MatrixCurve m_lsToWsCurve
Time-varying local to world space transform.
Definition FieldMapping.h:515
MatrixFieldMapping::worldToVoxel
const M44d & worldToVoxel() const
Returns a reference to the world to voxel space transform.
Definition FieldMapping.h:381
MatrixFieldMapping::m_wsVoxelSize
V3d m_wsVoxelSize
Precomputed world-space voxel size. Calculations may assume orthogonal transformation for efficiency.
Definition FieldMapping.h:525
MatrixFieldMapping::class_type
MatrixFieldMapping class_type
Definition FieldMapping.h:347
MatrixFieldMapping::localToWorldDir
void localToWorldDir(const V3d &lsV, V3d &wsV) const
Definition FieldMapping.h:474
MatrixFieldMapping::worldToLocalDir
void worldToLocalDir(const V3d &wsV, V3d &lsV) const
Definition FieldMapping.h:470
MatrixFieldMapping::worldToVoxelDir
void worldToVoxelDir(const V3d &wsV, V3d &vsV) const
Definition FieldMapping.h:462
MatrixFieldMapping::m_lsToWs
M44d m_lsToWs
Local space to world space.
Definition FieldMapping.h:503
NullFieldMapping::worldToVoxel
virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float) const
Definition FieldMapping.h:276
NullFieldMapping::class_type
NullFieldMapping class_type
Definition FieldMapping.h:247
NullFieldMapping::DEFINE_FIELD_RTTI_CONCRETE_CLASS
DEFINE_FIELD_RTTI_CONCRETE_CLASS
Definition FieldMapping.h:248
NullFieldMapping::worldToLocal
virtual void worldToLocal(const V3d &wsP, V3d &lsP) const
Transform from world space position into local space.
Definition FieldMapping.h:284
NullFieldMapping::localToWorld
virtual void localToWorld(const V3d &lsP, V3d &wsP) const
Transform from local space position into world space.
Definition FieldMapping.h:289
NullFieldMapping::wsVoxelSize
virtual V3d wsVoxelSize(int, int, int) const
Returns world-space size of a voxel at the specified coordinate.
Definition FieldMapping.h:299
NullFieldMapping::worldToLocal
virtual void worldToLocal(const V3d &wsP, V3d &lsP, float) const
Definition FieldMapping.h:286
NullFieldMapping::worldToVoxel
virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const
Transform from world space position into voxel space.
Definition FieldMapping.h:274
NullFieldMapping::voxelToWorld
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const
Transform from voxel space position into world space.
Definition FieldMapping.h:279
NullFieldMapping::NullFieldMapping
NullFieldMapping()
Definition FieldMapping.h:260
NullFieldMapping::localToWorld
virtual void localToWorld(const V3d &lsP, V3d &wsP, float) const
Definition FieldMapping.h:291
NullFieldMapping::staticClassType
static const char * staticClassType()
Definition FieldMapping.h:250
NullFieldMapping::NullFieldMapping
NullFieldMapping(const Box3i &extents)
Definition FieldMapping.h:263
NullFieldMapping::Ptr
boost::intrusive_ptr< NullFieldMapping > Ptr
Convenience typedef.
Definition FieldMapping.h:243
NullFieldMapping::base
FieldMapping base
Convenience typedef for referring to base class.
Definition FieldMapping.h:311
NullFieldMapping::voxelToWorld
virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float) const
Definition FieldMapping.h:281
RefBase::RefBase
RefBase()
Definition RefCount.h:120
FIELD3D_NAMESPACE_OPEN
Definition FieldMapping.cpp:74
ns.h
FIELD3D_API
#define FIELD3D_API
Definition ns.h:77
FIELD3D_NAMESPACE_HEADER_CLOSE
#define FIELD3D_NAMESPACE_HEADER_CLOSE
Definition ns.h:58