HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::math::Transform Class Reference

#include <Transform.h>

Public Types

using Ptr = SharedPtr< Transform >
 
using ConstPtr = SharedPtr< const Transform >
 

Public Member Functions

 Transform ()
 
 Transform (const MapBase::Ptr &)
 
 Transform (const Transform &)
 
 ~Transform ()
 
Ptr copy () const
 
bool isLinear () const
 Return true if the transformation map is exclusively linear/affine. More...
 
bool isIdentity () const
 Return true if the transform is equivalent to an idenity. More...
 
Name mapType () const
 Return the transformation map's type-name. More...
 
Vec3d voxelSize () const
 Return the size of a voxel using the linear component of the map. More...
 
Vec3d voxelSize (const Vec3d &xyz) const
 Return the size of a voxel at position (x, y, z). More...
 
double voxelVolume () const
 Return the voxel volume of the linear component of the map. More...
 
double voxelVolume (const Vec3d &xyz) const
 Return the voxel volume at position (x, y, z). More...
 
bool hasUniformScale () const
 Return true if the voxels in world space are uniformly sized cubes. More...
 
void read (std::istream &)
 Unserialize this transform from the given stream. More...
 
void write (std::ostream &) const
 Serialize this transform to the given stream. More...
 
void print (std::ostream &os=std::cout, const std::string &indent="") const
 Print a description of this transform. More...
 
bool operator== (const Transform &other) const
 
bool operator!= (const Transform &other) const
 
void preRotate (double radians, const Axis axis=X_AXIS)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void preTranslate (const Vec3d &)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void preScale (const Vec3d &)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void preScale (double)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void preShear (double shear, Axis axis0, Axis axis1)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void preMult (const Mat4d &)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void preMult (const Mat3d &)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void postRotate (double radians, const Axis axis=X_AXIS)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void postTranslate (const Vec3d &)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void postScale (const Vec3d &)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void postScale (double)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void postShear (double shear, Axis axis0, Axis axis1)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void postMult (const Mat4d &)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
void postMult (const Mat3d &)
 Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last. More...
 
Vec3d indexToWorld (const Vec3d &xyz) const
 Apply this transformation to the given coordinates. More...
 
Vec3d indexToWorld (const Coord &ijk) const
 Apply this transformation to the given coordinates. More...
 
Vec3d worldToIndex (const Vec3d &xyz) const
 Apply this transformation to the given coordinates. More...
 
Coord worldToIndexCellCentered (const Vec3d &xyz) const
 Apply this transformation to the given coordinates. More...
 
Coord worldToIndexNodeCentered (const Vec3d &xyz) const
 Apply this transformation to the given coordinates. More...
 
BBoxd indexToWorld (const CoordBBox &) const
 Apply this transformation to the given index-space bounding box. More...
 
BBoxd indexToWorld (const BBoxd &) const
 Apply this transformation to the given index-space bounding box. More...
 
BBoxd worldToIndex (const BBoxd &) const
 Apply the inverse of this transformation to the given world-space bounding box. More...
 
CoordBBox worldToIndexCellCentered (const BBoxd &) const
 Apply the inverse of this transformation to the given world-space bounding box. More...
 
CoordBBox worldToIndexNodeCentered (const BBoxd &) const
 Apply the inverse of this transformation to the given world-space bounding box. More...
 
MapBase::ConstPtr baseMap () const
 Return a base pointer to the transformation map. More...
 
MapBase::Ptr baseMap ()
 Return a base pointer to the transformation map. More...
 
template<typename MapType >
MapType::Ptr map ()
 Return the result of downcasting the base map pointer to a MapType pointer, or return a null pointer if the types are incompatible. More...
 
template<typename MapType >
MapType::ConstPtr map () const
 Return the result of downcasting the base map pointer to a MapType pointer, or return a null pointer if the types are incompatible. More...
 
template<typename MapType >
MapType::ConstPtr constMap () const
 Return the result of downcasting the base map pointer to a MapType pointer, or return a null pointer if the types are incompatible. More...
 

Static Public Member Functions

static Transform::Ptr createLinearTransform (double voxelSize=1.0)
 Create and return a shared pointer to a new transform. More...
 
static Transform::Ptr createLinearTransform (const Mat4R &)
 Create and return a shared pointer to a new transform. More...
 
static Transform::Ptr createFrustumTransform (const BBoxd &, double taper, double depth, double voxelSize=1.0)
 Create and return a shared pointer to a new transform. More...
 

Detailed Description

Todo:
Calculate an axis-aligned bounding box in index space from a bounding sphere in world space.

Definition at line 39 of file Transform.h.

Member Typedef Documentation

Constructor & Destructor Documentation

openvdb::OPENVDB_VERSION_NAME::math::Transform::Transform ( )
inline

Definition at line 45 of file Transform.h.

openvdb::OPENVDB_VERSION_NAME::math::Transform::Transform ( const MapBase::Ptr )
openvdb::OPENVDB_VERSION_NAME::math::Transform::Transform ( const Transform )
openvdb::OPENVDB_VERSION_NAME::math::Transform::~Transform ( )
inline

Definition at line 48 of file Transform.h.

Member Function Documentation

MapBase::ConstPtr openvdb::OPENVDB_VERSION_NAME::math::Transform::baseMap ( ) const
inline

Return a base pointer to the transformation map.

Definition at line 131 of file Transform.h.

MapBase::Ptr openvdb::OPENVDB_VERSION_NAME::math::Transform::baseMap ( )
inline

Return a base pointer to the transformation map.

Definition at line 132 of file Transform.h.

template<typename MapType >
MapType::ConstPtr openvdb::OPENVDB_VERSION_NAME::math::Transform::constMap ( ) const
inline

Return the result of downcasting the base map pointer to a MapType pointer, or return a null pointer if the types are incompatible.

Definition at line 189 of file Transform.h.

Ptr openvdb::OPENVDB_VERSION_NAME::math::Transform::copy ( ) const
inline

Definition at line 50 of file Transform.h.

static Transform::Ptr openvdb::OPENVDB_VERSION_NAME::math::Transform::createFrustumTransform ( const BBoxd ,
double  taper,
double  depth,
double  voxelSize = 1.0 
)
static

Create and return a shared pointer to a new transform.

static Transform::Ptr openvdb::OPENVDB_VERSION_NAME::math::Transform::createLinearTransform ( double  voxelSize = 1.0)
static

Create and return a shared pointer to a new transform.

static Transform::Ptr openvdb::OPENVDB_VERSION_NAME::math::Transform::createLinearTransform ( const Mat4R )
static

Create and return a shared pointer to a new transform.

bool openvdb::OPENVDB_VERSION_NAME::math::Transform::hasUniformScale ( ) const
inline

Return true if the voxels in world space are uniformly sized cubes.

Definition at line 104 of file Transform.h.

Vec3d openvdb::OPENVDB_VERSION_NAME::math::Transform::indexToWorld ( const Vec3d xyz) const
inline

Apply this transformation to the given coordinates.

Definition at line 108 of file Transform.h.

Vec3d openvdb::OPENVDB_VERSION_NAME::math::Transform::indexToWorld ( const Coord ijk) const
inline

Apply this transformation to the given coordinates.

Definition at line 109 of file Transform.h.

BBoxd openvdb::OPENVDB_VERSION_NAME::math::Transform::indexToWorld ( const CoordBBox ) const

Apply this transformation to the given index-space bounding box.

Returns
an axis-aligned world-space bounding box
BBoxd openvdb::OPENVDB_VERSION_NAME::math::Transform::indexToWorld ( const BBoxd ) const

Apply this transformation to the given index-space bounding box.

Returns
an axis-aligned world-space bounding box
bool openvdb::OPENVDB_VERSION_NAME::math::Transform::isIdentity ( ) const

Return true if the transform is equivalent to an idenity.

bool openvdb::OPENVDB_VERSION_NAME::math::Transform::isLinear ( ) const
inline

Return true if the transformation map is exclusively linear/affine.

Definition at line 61 of file Transform.h.

template<typename MapType >
MapType::Ptr openvdb::OPENVDB_VERSION_NAME::math::Transform::map ( )
inline

Return the result of downcasting the base map pointer to a MapType pointer, or return a null pointer if the types are incompatible.

Definition at line 169 of file Transform.h.

template<typename MapType >
MapType::ConstPtr openvdb::OPENVDB_VERSION_NAME::math::Transform::map ( ) const
inline

Return the result of downcasting the base map pointer to a MapType pointer, or return a null pointer if the types are incompatible.

Definition at line 180 of file Transform.h.

Name openvdb::OPENVDB_VERSION_NAME::math::Transform::mapType ( ) const
inline

Return the transformation map's type-name.

Definition at line 66 of file Transform.h.

Definition at line 154 of file Transform.h.

bool openvdb::OPENVDB_VERSION_NAME::math::Transform::operator== ( const Transform other) const
void openvdb::OPENVDB_VERSION_NAME::math::Transform::postMult ( const Mat4d )

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::postMult ( const Mat3d )

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::postRotate ( double  radians,
const Axis  axis = X_AXIS 
)

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::postScale ( const Vec3d )

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::postScale ( double  )

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::postShear ( double  shear,
Axis  axis0,
Axis  axis1 
)

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::postTranslate ( const Vec3d )

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::preMult ( const Mat4d )

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::preMult ( const Mat3d )

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::preRotate ( double  radians,
const Axis  axis = X_AXIS 
)

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::preScale ( const Vec3d )

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::preScale ( double  )

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::preShear ( double  shear,
Axis  axis0,
Axis  axis1 
)

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::preTranslate ( const Vec3d )

Update the linear (affine) map by prepending or postfixing the appropriate operation. In the case of a frustum, the pre-operations apply to the linear part of the transform and not the entire transform, while the post-operations are allways applied last.

void openvdb::OPENVDB_VERSION_NAME::math::Transform::print ( std::ostream &  os = std::cout,
const std::string indent = "" 
) const

Print a description of this transform.

Parameters
osa stream to which to write textual information
indenta string with which to prefix each line of text
void openvdb::OPENVDB_VERSION_NAME::math::Transform::read ( std::istream &  )

Unserialize this transform from the given stream.

Vec3d openvdb::OPENVDB_VERSION_NAME::math::Transform::voxelSize ( ) const
inline

Return the size of a voxel using the linear component of the map.

Definition at line 93 of file Transform.h.

Vec3d openvdb::OPENVDB_VERSION_NAME::math::Transform::voxelSize ( const Vec3d xyz) const
inline

Return the size of a voxel at position (x, y, z).

Note
Maps that have a nonlinear component (e.g., perspective and frustum maps) have position-dependent voxel sizes.

Definition at line 97 of file Transform.h.

double openvdb::OPENVDB_VERSION_NAME::math::Transform::voxelVolume ( ) const
inline

Return the voxel volume of the linear component of the map.

Definition at line 100 of file Transform.h.

double openvdb::OPENVDB_VERSION_NAME::math::Transform::voxelVolume ( const Vec3d xyz) const
inline

Return the voxel volume at position (x, y, z).

Definition at line 102 of file Transform.h.

Vec3d openvdb::OPENVDB_VERSION_NAME::math::Transform::worldToIndex ( const Vec3d xyz) const
inline

Apply this transformation to the given coordinates.

Definition at line 110 of file Transform.h.

BBoxd openvdb::OPENVDB_VERSION_NAME::math::Transform::worldToIndex ( const BBoxd ) const

Apply the inverse of this transformation to the given world-space bounding box.

Returns
an axis-aligned index-space bounding box
Coord openvdb::OPENVDB_VERSION_NAME::math::Transform::worldToIndexCellCentered ( const Vec3d xyz) const
inline

Apply this transformation to the given coordinates.

Definition at line 111 of file Transform.h.

CoordBBox openvdb::OPENVDB_VERSION_NAME::math::Transform::worldToIndexCellCentered ( const BBoxd ) const

Apply the inverse of this transformation to the given world-space bounding box.

Returns
an axis-aligned index-space bounding box
Coord openvdb::OPENVDB_VERSION_NAME::math::Transform::worldToIndexNodeCentered ( const Vec3d xyz) const
inline

Apply this transformation to the given coordinates.

Definition at line 112 of file Transform.h.

CoordBBox openvdb::OPENVDB_VERSION_NAME::math::Transform::worldToIndexNodeCentered ( const BBoxd ) const

Apply the inverse of this transformation to the given world-space bounding box.

Returns
an axis-aligned index-space bounding box
void openvdb::OPENVDB_VERSION_NAME::math::Transform::write ( std::ostream &  ) const

Serialize this transform to the given stream.


The documentation for this class was generated from the following file: