OpenVDB: Map Struct Reference

OpenVDB 13.0.0

Loading...
Searching...
No Matches
Map Struct Reference

Defines an affine transform and its inverse represented as a 3x3 matrix and a vec3 translation. More...

`#include <nanovdb/NanoVDB.h>`

## Public Member Functions
__hostdev__ | Map ()
| Default constructor for the identity map.
__hostdev__ | Map (double s, const Vec3d &t=Vec3d(0.0, 0.0, 0.0))
template<typename MatT, typename Vec3T>
void | set (const MatT &mat, const MatT &invMat, const Vec3T &translate, double taper=1.0)
| Initialize the member data from 3x3 or 4x4 matrices.
template<typename Mat4T>
void | set (const Mat4T &mat, const Mat4T &invMat, double taper=1.0)
| Initialize the member data from 4x4 matrices.
template<typename Vec3T>
void | set (double scale, const Vec3T &translation, double taper=1.0)
template<typename Vec3T>
__hostdev__ Vec3T | applyMap (const Vec3T &ijk) const
| Apply the forward affine transformation to a vector using 64bit floating point arithmetics.
template<typename Vec3T>
__hostdev__ Vec3T | applyMapF (const Vec3T &ijk) const
| Apply the forward affine transformation to a vector using 32bit floating point arithmetics.
template<typename Vec3T>
__hostdev__ Vec3T | applyJacobian (const Vec3T &ijk) const
| Apply the linear forward 3x3 transformation to an input 3d vector using 64bit floating point arithmetics, e.g. scale and rotation WITHOUT translation.
template<typename Vec3T>
__hostdev__ Vec3T | applyJacobianF (const Vec3T &ijk) const
| Apply the linear forward 3x3 transformation to an input 3d vector using 32bit floating point arithmetics, e.g. scale and rotation WITHOUT translation.
template<typename Vec3T>
__hostdev__ Vec3T | applyInverseMap (const Vec3T &xyz) const
| Apply the inverse affine mapping to a vector using 64bit floating point arithmetics.
template<typename Vec3T>
__hostdev__ Vec3T | applyInverseMapF (const Vec3T &xyz) const
| Apply the inverse affine mapping to a vector using 32bit floating point arithmetics.
template<typename Vec3T>
__hostdev__ Vec3T | applyInverseJacobian (const Vec3T &xyz) const
| Apply the linear inverse 3x3 transformation to an input 3d vector using 64bit floating point arithmetics, e.g. inverse scale and inverse rotation WITHOUT translation.
template<typename Vec3T>
__hostdev__ Vec3T | applyInverseJacobianF (const Vec3T &xyz) const
| Apply the linear inverse 3x3 transformation to an input 3d vector using 32bit floating point arithmetics, e.g. inverse scale and inverse rotation WITHOUT translation.
template<typename Vec3T>
__hostdev__ Vec3T | applyIJT (const Vec3T &xyz) const
| Apply the transposed inverse 3x3 transformation to an input 3d vector using 64bit floating point arithmetics, e.g. inverse scale and inverse rotation WITHOUT translation.
template<typename Vec3T>
__hostdev__ Vec3T | applyIJTF (const Vec3T &xyz) const
__hostdev__ Vec3d | getVoxelSize () const
| Return a voxels size in each coordinate direction, measured at the origin.

## Public Attributes
float | mMatF [9]
float | mInvMatF [9]
float | mVecF [3]
float | mTaperF
double | mMatD [9]
double | mInvMatD [9]
double | mVecD [3]
double | mTaperD

## Detailed Description

Defines an affine transform and its inverse represented as a 3x3 matrix and a vec3 translation.

## Constructor & Destructor Documentation

## ◆ Map() [1/2]

__hostdev__ Map | ( |  | ) |
| inline

Default constructor for the identity map.

## ◆ Map() [2/2]

__hostdev__ Map | ( | double | s,
|  | const Vec3d & | t = Vec3d(0.0, 0.0, 0.0) )
| inline

## Member Function Documentation

## ◆ applyIJT()

template<typename Vec3T>

__hostdev__ Vec3T applyIJT | ( | const Vec3T & | xyz | ) | const
| inline

Apply the transposed inverse 3x3 transformation to an input 3d vector using 64bit floating point arithmetics, e.g. inverse scale and inverse rotation WITHOUT translation.

Note
  Typically this operation is used for scale and rotation from world -> index mapping

Template Parameters

  Vec3T | Template type of the 3D vector to be mapped

Parameters

  ijk | 3D vector to be mapped - typically floating point index coordinates

Returns
  linear inverse 3x3 mapping of the input vector i.e. xyz x mat^-1

## ◆ applyIJTF()

template<typename Vec3T>

__hostdev__ Vec3T applyIJTF | ( | const Vec3T & | xyz | ) | const
| inline

## ◆ applyInverseJacobian()

template<typename Vec3T>

__hostdev__ Vec3T applyInverseJacobian | ( | const Vec3T & | xyz | ) | const
| inline

Apply the linear inverse 3x3 transformation to an input 3d vector using 64bit floating point arithmetics, e.g. inverse scale and inverse rotation WITHOUT translation.

Note
  Typically this operation is used for scale and rotation from world -> index mapping

Template Parameters

  Vec3T | Template type of the 3D vector to be mapped

Parameters

  ijk | 3D vector to be mapped - typically floating point index coordinates

Returns
  linear inverse 3x3 mapping of the input vector i.e. xyz x mat^-1

## ◆ applyInverseJacobianF()

template<typename Vec3T>

__hostdev__ Vec3T applyInverseJacobianF | ( | const Vec3T & | xyz | ) | const
| inline

Apply the linear inverse 3x3 transformation to an input 3d vector using 32bit floating point arithmetics, e.g. inverse scale and inverse rotation WITHOUT translation.

Note
  Typically this operation is used for scale and rotation from world -> index mapping

Template Parameters

  Vec3T | Template type of the 3D vector to be mapped

Parameters

  ijk | 3D vector to be mapped - typically floating point index coordinates

Returns
  linear inverse 3x3 mapping of the input vector i.e. xyz x mat^-1

## ◆ applyInverseMap()

template<typename Vec3T>

__hostdev__ Vec3T applyInverseMap | ( | const Vec3T & | xyz | ) | const
| inline

Apply the inverse affine mapping to a vector using 64bit floating point arithmetics.

Note
  Typically this operation is used for the world -> index mapping

Template Parameters

  Vec3T | Template type of the 3D vector to be mapped

Parameters

  xyz | 3D vector to be mapped - typically floating point world coordinates

Returns
  Inverse affine mapping of the input `xyz` i.e. (xyz - translation) x mat^-1

## ◆ applyInverseMapF()

template<typename Vec3T>

__hostdev__ Vec3T applyInverseMapF | ( | const Vec3T & | xyz | ) | const
| inline

Apply the inverse affine mapping to a vector using 32bit floating point arithmetics.

Note
  Typically this operation is used for the world -> index mapping

Template Parameters

  Vec3T | Template type of the 3D vector to be mapped

Parameters

  xyz | 3D vector to be mapped - typically floating point world coordinates

Returns
  Inverse affine mapping of the input `xyz` i.e. (xyz - translation) x mat^-1

## ◆ applyJacobian()

template<typename Vec3T>

__hostdev__ Vec3T applyJacobian | ( | const Vec3T & | ijk | ) | const
| inline

Apply the linear forward 3x3 transformation to an input 3d vector using 64bit floating point arithmetics, e.g. scale and rotation WITHOUT translation.

Note
  Typically this operation is used for scale and rotation from index -> world mapping

Template Parameters

  Vec3T | Template type of the 3D vector to be mapped

Parameters

  ijk | 3D vector to be mapped - typically floating point index coordinates

Returns
  linear forward 3x3 mapping of the input vector

## ◆ applyJacobianF()

template<typename Vec3T>

__hostdev__ Vec3T applyJacobianF | ( | const Vec3T & | ijk | ) | const
| inline

Apply the linear forward 3x3 transformation to an input 3d vector using 32bit floating point arithmetics, e.g. scale and rotation WITHOUT translation.

Note
  Typically this operation is used for scale and rotation from index -> world mapping

Template Parameters

  Vec3T | Template type of the 3D vector to be mapped

Parameters

  ijk | 3D vector to be mapped - typically floating point index coordinates

Returns
  linear forward 3x3 mapping of the input vector

## ◆ applyMap()

template<typename Vec3T>

__hostdev__ Vec3T applyMap | ( | const Vec3T & | ijk | ) | const
| inline

Apply the forward affine transformation to a vector using 64bit floating point arithmetics.

Note
  Typically this operation is used for the scale, rotation and translation of index -> world mapping

Template Parameters

  Vec3T | Template type of the 3D vector to be mapped

Parameters

  ijk | 3D vector to be mapped - typically floating point index coordinates

Returns
  Forward mapping for affine transformation, i.e. (mat x ijk) + translation

## ◆ applyMapF()

template<typename Vec3T>

__hostdev__ Vec3T applyMapF | ( | const Vec3T & | ijk | ) | const
| inline

Apply the forward affine transformation to a vector using 32bit floating point arithmetics.

Note
  Typically this operation is used for the scale, rotation and translation of index -> world mapping

Template Parameters

  Vec3T | Template type of the 3D vector to be mapped

Parameters

  ijk | 3D vector to be mapped - typically floating point index coordinates

Returns
  Forward mapping for affine transformation, i.e. (mat x ijk) + translation

## ◆ getVoxelSize()

__hostdev__ Vec3d getVoxelSize | ( |  | ) | const
| inline

Return a voxels size in each coordinate direction, measured at the origin.

## ◆ set() [1/3]

template<typename Mat4T>

void set | ( | const Mat4T & | mat,
|  | const Mat4T & | invMat,
|  | double | taper = 1.0 )
| inline

Initialize the member data from 4x4 matrices.

Note
  The last (4th) row of invMat is actually ignored. This is not _hostdev__ since then Mat4T=openvdb::Mat4d will produce warnings

## ◆ set() [2/3]

template<typename MatT, typename Vec3T>

void set | ( | const MatT & | mat,
|  | const MatT & | invMat,
|  | const Vec3T & | translate,
|  | double | taper = 1.0 )
| inline

Initialize the member data from 3x3 or 4x4 matrices.

Note
  This is not _hostdev__ since then MatT=openvdb::Mat4d will produce warnings

## ◆ set() [3/3]

template<typename Vec3T>

void set | ( | double | scale,
|  | const Vec3T & | translation,
|  | double | taper = 1.0 )
| inline

## Member Data Documentation

## ◆ mInvMatD

double mInvMatD[9]

## ◆ mInvMatF

float mInvMatF[9]

## ◆ mMatD

double mMatD[9]

## ◆ mMatF

float mMatF[9]

## ◆ mTaperD

double mTaperD

## ◆ mTaperF

float mTaperF

## ◆ mVecD

double mVecD[3]

## ◆ mVecF

float mVecF[3]