Field3D
|
Represents the mapping of a field by a matrix transform. More...
#include <FieldMapping.h>
Public Types | |
typedef MatrixFieldMapping | class_type |
typedef Curve< Imath::M44d > | MatrixCurve |
Time-varying matrix. | |
typedef boost::intrusive_ptr< MatrixFieldMapping > | Ptr |
Convenience typedef. | |
![]() | |
typedef FieldMapping | class_type |
typedef boost::intrusive_ptr< FieldMapping > | Ptr |
![]() | |
typedef boost::intrusive_ptr< RefBase > | Ptr |
typedef boost::weak_ptr< RefBase > | WeakPtr |
Public Member Functions | |
const M44d & | localToWorld () const |
Returns a reference to the local to world transform. | |
const MatrixCurve::SampleVec & | localToWorldSamples () const |
Returns a vector of all motion samples for local to world transform. | |
void | makeIdentity () |
Sets the transform to identity. This makes it functionally equivalent to a NullFieldMapping. | |
void | setLocalToWorld (const M44d &lsToWs) |
Sets the local to world transform. All other matrices will be updated based on this. | |
void | setLocalToWorld (float t, const M44d &lsToWs) |
Sets the local to world transform at a given time. | |
const M44d & | voxelToWorld () const |
Returns a reference to the voxel to world space transform. | |
const M44d & | worldToVoxel () const |
Returns a reference to the world to voxel space transform. | |
M44d | worldToVoxel (float time) const |
Returns the world to voxel space transform at a given time. | |
Constructors & destructor | |
MatrixFieldMapping () | |
MatrixFieldMapping (const Box3i &extents) | |
From FieldMapping | |
virtual void | worldToVoxel (const V3d &wsP, V3d &vsP) const |
Transform from world space position into voxel space. | |
virtual void | worldToVoxel (const V3d &wsP, V3d &vsP, float time) const |
virtual void | voxelToWorld (const V3d &vsP, V3d &wsP) const |
Transform from voxel space position into world space. | |
virtual void | voxelToWorld (const V3d &vsP, V3d &wsP, float time) const |
virtual void | worldToLocal (const V3d &wsP, V3d &lsP) const |
Transform from world space position into local space. | |
virtual void | worldToLocal (const V3d &wsP, V3d &lsP, float time) const |
virtual void | localToWorld (const V3d &lsP, V3d &wsP) const |
Transform from local space position into world space. | |
virtual void | localToWorld (const V3d &lsP, V3d &wsP, float time) const |
void | worldToVoxelDir (const V3d &wsV, V3d &vsV) const |
void | voxelToWorldDir (const V3d &vsV, V3d &wsV) const |
void | worldToLocalDir (const V3d &wsV, V3d &lsV) const |
void | localToWorldDir (const V3d &lsV, V3d &wsV) const |
virtual void | extentsChanged () |
Implement this if the subclass needs to update itself when the resolution changes. | |
virtual std::string | className () const |
Returns the FieldMapping type name. Used when writing/reading from disk. | |
virtual bool | isIdentical (FieldMapping::Ptr other, double tolerance=0.0) const |
Whether the mapping is identical to another mapping. | |
virtual V3d | wsVoxelSize (int, int, int) const |
Returns world-space size of a voxel at the specified coordinate. | |
virtual FieldMapping::Ptr | clone () const |
Returns a pointer to a copy of the mapping, pure virtual so ensure derived classes properly implement it. | |
![]() | |
const V3d & | origin () const |
Returns the origin. | |
const V3d & | resolution () const |
Returns the resolution. | |
void | setExtents (const Box3i &extents) |
This sets the field extents information to use for defining the local coordinate space. | |
FieldMapping () | |
Constructor. | |
FieldMapping (const Box3i &extents) | |
Construct with known extents. | |
virtual | ~FieldMapping () |
Destructor. | |
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 Field that we're mapping. | |
void | voxelToLocal (const V3d &vsP, V3d &lsP) const |
Inverse of localToVoxel. | |
![]() | |
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 * | staticClassType () |
![]() | |
static const char * | staticClassType () |
![]() | |
static const char * | staticClassType () |
Public Attributes | |
DEFINE_FIELD_RTTI_CONCRETE_CLASS | |
![]() | |
DEFINE_FIELD_RTTI_ABSTRACT_CLASS | |
Private Types | |
typedef FieldMapping | base |
Convenience typedef for referring to base class. | |
Private Member Functions | |
void | getLocalToVoxelMatrix (M44d &result) |
void | updateTransform () |
Updates the local to world transformation matrix. | |
Private Attributes | |
bool | m_isTimeVarying |
Stores whether the curve has more than one time sample. | |
M44d | m_lsToWs |
Local space to world space. | |
MatrixCurve | m_lsToWsCurve |
Time-varying local to world space transform. | |
M44d | m_vsToWs |
Voxel space to world space. | |
MatrixCurve | m_vsToWsCurve |
Time-varying voxel to world space transform. | |
M44d | m_wsToLs |
World space to local space. | |
M44d | m_wsToVs |
World space to voxel space. | |
V3d | m_wsVoxelSize |
Precomputed world-space voxel size. Calculations may assume orthogonal transformation for efficiency. | |
Additional Inherited Members | |
![]() | |
V3d | m_origin |
The integer voxel-space origin of the underlying Field object. Is equal to field.extents.min. | |
V3d | m_res |
The integer voxel-space resolution of the underlying Field object. Is equal to field.extents.max - field.extents.min + 1. | |
Represents the mapping of a field by a matrix transform.
Refer to using_mappings for examples of how to use this in your code.
Definition at line 334 of file FieldMapping.h.
boost::intrusive_ptr<MatrixFieldMapping> MatrixFieldMapping::Ptr |
Convenience typedef.
Definition at line 341 of file FieldMapping.h.
Curve<Imath::M44d> MatrixFieldMapping::MatrixCurve |
Time-varying matrix.
Definition at line 343 of file FieldMapping.h.
Definition at line 347 of file FieldMapping.h.
|
private |
Convenience typedef for referring to base class.
Definition at line 530 of file FieldMapping.h.
MatrixFieldMapping::MatrixFieldMapping | ( | ) |
Definition at line 253 of file FieldMapping.cpp.
References makeIdentity().
Referenced by clone().
MatrixFieldMapping::MatrixFieldMapping | ( | const Box3i & | extents | ) |
Definition at line 261 of file FieldMapping.cpp.
References makeIdentity().
|
inlinestatic |
Definition at line 350 of file FieldMapping.h.
Referenced by className().
void MatrixFieldMapping::setLocalToWorld | ( | const M44d & | lsToWs | ) |
Sets the local to world transform. All other matrices will be updated based on this.
Definition at line 269 of file FieldMapping.cpp.
References m_lsToWsCurve, makeIdentity(), Curve< T >::numSamples(), and setLocalToWorld().
Referenced by setLocalToWorld().
void MatrixFieldMapping::setLocalToWorld | ( | float | t, |
const M44d & | lsToWs ) |
Sets the local to world transform at a given time.
Definition at line 279 of file FieldMapping.cpp.
References Curve< T >::addSample(), m_lsToWsCurve, and updateTransform().
|
inline |
Returns a reference to the local to world transform.
Definition at line 376 of file FieldMapping.h.
|
inline |
Returns a reference to the world to voxel space transform.
Definition at line 381 of file FieldMapping.h.
Referenced by FieldWrapper< Field_T >::setWsBoundsOptimization(), and MIPFieldWrapper< Field_T >::setWsBoundsOptimization().
|
inline |
Returns the world to voxel space transform at a given time.
Definition at line 385 of file FieldMapping.h.
|
inline |
Returns a reference to the voxel to world space transform.
Definition at line 396 of file FieldMapping.h.
|
inline |
Returns a vector of all motion samples for local to world transform.
Definition at line 400 of file FieldMapping.h.
void MatrixFieldMapping::makeIdentity | ( | ) |
Sets the transform to identity. This makes it functionally equivalent to a NullFieldMapping.
Definition at line 287 of file FieldMapping.cpp.
References Curve< T >::clear(), m_lsToWsCurve, and updateTransform().
Referenced by MatrixFieldMapping(), MatrixFieldMapping(), and setLocalToWorld().
Transform from world space position into voxel space.
Implements FieldMapping.
Definition at line 412 of file FieldMapping.h.
|
inlinevirtual |
Implements FieldMapping.
Definition at line 414 of file FieldMapping.h.
Transform from voxel space position into world space.
Implements FieldMapping.
Definition at line 424 of file FieldMapping.h.
|
inlinevirtual |
Implements FieldMapping.
Definition at line 426 of file FieldMapping.h.
Transform from world space position into local space.
Implements FieldMapping.
Definition at line 436 of file FieldMapping.h.
Referenced by FieldGroup< BaseTypeList_T, Dims_T >::GetIntersections::intersectMatrixMapping().
|
inlinevirtual |
Implements FieldMapping.
Definition at line 438 of file FieldMapping.h.
Transform from local space position into world space.
Implements FieldMapping.
Definition at line 449 of file FieldMapping.h.
|
inlinevirtual |
Implements FieldMapping.
Definition at line 451 of file FieldMapping.h.
Definition at line 462 of file FieldMapping.h.
Definition at line 466 of file FieldMapping.h.
Definition at line 470 of file FieldMapping.h.
Referenced by FieldGroup< BaseTypeList_T, Dims_T >::GetIntersections::intersectMatrixMapping().
Definition at line 474 of file FieldMapping.h.
|
virtual |
Implement this if the subclass needs to update itself when the resolution changes.
Reimplemented from FieldMapping.
Definition at line 295 of file FieldMapping.cpp.
References updateTransform().
|
virtual |
Returns the FieldMapping type name. Used when writing/reading from disk.
Implements FieldMapping.
Definition at line 302 of file FieldMapping.cpp.
References staticClassType().
|
virtual |
Whether the mapping is identical to another mapping.
Implements FieldMapping.
Definition at line 309 of file FieldMapping.cpp.
References FIELD_DYNAMIC_CAST, m_lsToWsCurve, m_vsToWsCurve, and Curve< T >::samples().
|
inlinevirtual |
Returns world-space size of a voxel at the specified coordinate.
Implements FieldMapping.
Definition at line 484 of file FieldMapping.h.
Referenced by FieldGroup< BaseTypeList_T, Dims_T >::GetIntersections::intersectMatrixMapping().
|
virtual |
Returns a pointer to a copy of the mapping, pure virtual so ensure derived classes properly implement it.
Implements FieldMapping.
Definition at line 414 of file FieldMapping.cpp.
References MatrixFieldMapping().
|
private |
Updates the local to world transformation matrix.
Definition at line 363 of file FieldMapping.cpp.
References Curve< T >::addSample(), Curve< T >::clear(), getLocalToVoxelMatrix(), Curve< T >::linear(), m_isTimeVarying, m_lsToWs, m_lsToWsCurve, m_vsToWs, m_vsToWsCurve, m_wsToLs, m_wsToVs, m_wsVoxelSize, Curve< T >::numSamples(), and Curve< T >::samples().
Referenced by extentsChanged(), makeIdentity(), and setLocalToWorld().
|
private |
Definition at line 402 of file FieldMapping.cpp.
References FieldMapping::m_origin, and FieldMapping::m_res.
Referenced by updateTransform().
MatrixFieldMapping::DEFINE_FIELD_RTTI_CONCRETE_CLASS |
Definition at line 348 of file FieldMapping.h.
|
private |
Local space to world space.
Definition at line 503 of file FieldMapping.h.
Referenced by updateTransform().
|
private |
World space to local space.
Definition at line 506 of file FieldMapping.h.
Referenced by updateTransform().
|
private |
Voxel space to world space.
Definition at line 509 of file FieldMapping.h.
Referenced by updateTransform().
|
private |
World space to voxel space.
Definition at line 512 of file FieldMapping.h.
Referenced by updateTransform().
|
private |
Time-varying local to world space transform.
Definition at line 515 of file FieldMapping.h.
Referenced by isIdentical(), makeIdentity(), setLocalToWorld(), setLocalToWorld(), and updateTransform().
|
private |
Time-varying voxel to world space transform.
Definition at line 517 of file FieldMapping.h.
Referenced by isIdentical(), and updateTransform().
|
private |
Stores whether the curve has more than one time sample.
Definition at line 521 of file FieldMapping.h.
Referenced by updateTransform().
|
private |
Precomputed world-space voxel size. Calculations may assume orthogonal transformation for efficiency.
Definition at line 525 of file FieldMapping.h.
Referenced by updateTransform().