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. More... | |
typedef boost::intrusive_ptr< MatrixFieldMapping > | Ptr |
Convenience typedef. More... | |
![]() | |
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. More... | |
const MatrixCurve::SampleVec & | localToWorldSamples () const |
Returns a vector of all motion samples for local to world transform. More... | |
void | makeIdentity () |
Sets the transform to identity. This makes it functionally equivalent to a NullFieldMapping. More... | |
void | setLocalToWorld (const M44d &lsToWs) |
Sets the local to world transform. All other matrices will be updated based on this. More... | |
void | setLocalToWorld (float t, const M44d &lsToWs) |
Sets the local to world transform at a given time. More... | |
const M44d & | voxelToWorld () const |
Returns a reference to the voxel to world space transform. More... | |
const M44d & | worldToVoxel () const |
Returns a reference to the world to voxel space transform. More... | |
M44d | worldToVoxel (float time) const |
Returns the world to voxel space transform at a given time. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
virtual std::string | className () const |
Returns the FieldMapping type name. Used when writing/reading from disk. More... | |
virtual bool | isIdentical (FieldMapping::Ptr other, double tolerance=0.0) const |
Whether the mapping is identical to another mapping. More... | |
virtual V3d | wsVoxelSize (int, int, int) const |
Returns world-space size of a voxel at the specified coordinate. More... | |
virtual FieldMapping::Ptr | clone () const |
Returns a pointer to a copy of the mapping, pure virtual so ensure derived classes properly implement it. More... | |
![]() | |
const V3d & | origin () const |
Returns the origin. More... | |
const V3d & | resolution () const |
Returns the resolution. More... | |
void | setExtents (const Box3i &extents) |
This sets the field extents information to use for defining the local coordinate space. More... | |
FieldMapping () | |
Constructor. More... | |
FieldMapping (const Box3i &extents) | |
Construct with known extents. More... | |
virtual | ~FieldMapping () |
Destructor. More... | |
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. More... | |
void | voxelToLocal (const V3d &vsP, V3d &lsP) const |
Inverse of localToVoxel. More... | |
![]() | |
void | ref () const |
Used by boost::intrusive_pointer. More... | |
size_t | refcnt () |
Used by boost::intrusive_pointer. More... | |
void | unref () const |
Used by boost::intrusive_pointer. More... | |
WeakPtr | weakPtr () const |
RefBase () | |
RefBase (const RefBase &) | |
Copy constructor. More... | |
RefBase & | operator= (const RefBase &) |
Assignment operator. More... | |
virtual | ~RefBase () |
Destructor. More... | |
virtual bool | checkRTTI (const char *typenameStr)=0 |
This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();. More... | |
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. More... | |
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. More... | |
Private Member Functions | |
void | getLocalToVoxelMatrix (M44d &result) |
void | updateTransform () |
Updates the local to world transformation matrix. More... | |
Private Attributes | |
bool | m_isTimeVarying |
Stores whether the curve has more than one time sample. More... | |
M44d | m_lsToWs |
Local space to world space. More... | |
MatrixCurve | m_lsToWsCurve |
Time-varying local to world space transform. More... | |
M44d | m_vsToWs |
Voxel space to world space. More... | |
MatrixCurve | m_vsToWsCurve |
Time-varying voxel to world space transform. More... | |
M44d | m_wsToLs |
World space to local space. More... | |
M44d | m_wsToVs |
World space to voxel space. More... | |
V3d | m_wsVoxelSize |
Precomputed world-space voxel size. Calculations may assume orthogonal transformation for efficiency. More... | |
Additional Inherited Members | |
![]() | |
V3d | m_origin |
The integer voxel-space origin of the underlying Field object. Is equal to field.extents.min. More... | |
V3d | m_res |
The integer voxel-space resolution of the underlying Field object. Is equal to field.extents.max - field.extents.min + 1. More... | |
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.
typedef boost::intrusive_ptr<MatrixFieldMapping> MatrixFieldMapping::Ptr |
Convenience typedef.
Definition at line 341 of file FieldMapping.h.
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 | ( | ) |
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(), and Curve< T >::numSamples().
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(), and setLocalToWorld().
Transform from world space position into voxel space.
Implements FieldMapping.
Definition at line 412 of file FieldMapping.h.
|
inlinevirtual |
Transform from voxel space position into world space.
Implements FieldMapping.
Definition at line 424 of file FieldMapping.h.
|
inlinevirtual |
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 |
Transform from local space position into world space.
Implements FieldMapping.
Definition at line 449 of file FieldMapping.h.
|
inlinevirtual |
Definition at line 470 of file FieldMapping.h.
Referenced by FieldGroup< BaseTypeList_T, Dims_T >::GetIntersections::intersectMatrixMapping().
|
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 FIELD3D_NAMESPACE_OPEN::checkMatricesIdentical(), FIELD3D_NAMESPACE_OPEN::k_matrixMappingName(), 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(), 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().