OpenVDB: MapBase Class Reference

OpenVDB 10.0.1

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
MapBase Class Referenceabstract

Abstract base class for maps. More...

`#include <openvdb/math/Maps.h>`

Inheritance diagram for MapBase:

## Public Types
using | Ptr = SharedPtr< MapBase >
using | ConstPtr = SharedPtr< const MapBase >
using | MapFactory = Ptr(*)()

## Public Member Functions
| MapBase (const MapBase &)=default
virtual | ~MapBase ()=default
virtual SharedPtr< AffineMap > | getAffineMap () const =0
virtual Name | type () const =0
| Return the name of this map's concrete type (e.g., `"AffineMap"`).
template<typename MapT >
bool | isType () const
| Return `true` if this map is of concrete type `MapT` (e.g., AffineMap).
virtual bool | isEqual (const MapBase &other) const =0
| Return `true` if this map is equal to the given map.
virtual bool | isLinear () const =0
| Return `true` if this map is linear.
virtual bool | hasUniformScale () const =0
| Return `true` if the spacing between the image of latice is uniform in all directions.
virtual Vec3d | applyMap (const Vec3d &in) const =0
virtual Vec3d | applyInverseMap (const Vec3d &in) const =0
virtual Vec3d | applyIJT (const Vec3d &in) const =0
| Apply the Inverse Jacobian Transpose of this map to a vector. For a linear map this is equivalent to applying the transpose of inverse map excluding translation.
virtual Vec3d | applyIJT (const Vec3d &in, const Vec3d &domainPos) const =0
virtual Mat3d | applyIJC (const Mat3d &m) const =0
virtual Mat3d | applyIJC (const Mat3d &m, const Vec3d &v, const Vec3d &domainPos) const =0
virtual double | determinant () const =0
virtual double | determinant (const Vec3d &) const =0
virtual Vec3d | voxelSize () const =0
| Method to return the local size of a voxel. When a location is specified as an argument, it is understood to be be in the domain of the map (i.e. index space)
virtual Vec3d | voxelSize (const Vec3d &) const =0
virtual void | read (std::istream &)=0
virtual void | write (std::ostream &) const =0
virtual std::string | str () const =0
virtual MapBase::Ptr | copy () const =0
virtual MapBase::Ptr | preRotate (double radians, Axis axis=X_AXIS) const =0
| Methods to update the map.
virtual MapBase::Ptr | preTranslate (const Vec3d &) const =0
virtual MapBase::Ptr | preScale (const Vec3d &) const =0
virtual MapBase::Ptr | preShear (double shear, Axis axis0, Axis axis1) const =0
virtual MapBase::Ptr | postRotate (double radians, Axis axis=X_AXIS) const =0
virtual MapBase::Ptr | postTranslate (const Vec3d &) const =0
virtual MapBase::Ptr | postScale (const Vec3d &) const =0
virtual MapBase::Ptr | postShear (double shear, Axis axis0, Axis axis1) const =0
virtual Vec3d | applyJacobian (const Vec3d &in) const =0
| Apply the Jacobian of this map to a vector. For a linear map this is equivalent to applying the map excluding translation.
virtual Vec3d | applyJacobian (const Vec3d &in, const Vec3d &domainPos) const =0
virtual Vec3d | applyInverseJacobian (const Vec3d &in) const =0
| Apply the InverseJacobian of this map to a vector. For a linear map this is equivalent to applying the map inverse excluding translation.
virtual Vec3d | applyInverseJacobian (const Vec3d &in, const Vec3d &domainPos) const =0
virtual Vec3d | applyJT (const Vec3d &in) const =0
| Apply the Jacobian transpose of this map to a vector. For a linear map this is equivalent to applying the transpose of the map excluding translation.
virtual Vec3d | applyJT (const Vec3d &in, const Vec3d &domainPos) const =0
virtual MapBase::Ptr | inverseMap () const =0
| Return a new map representing the inverse of this map.

## Protected Member Functions
| MapBase ()

## Static Protected Member Functions
template<typename MapT >
static bool | isEqualBase (const MapT &self, const MapBase &other)

## Detailed Description

Abstract base class for maps.

## Member Typedef Documentation

## ◆ ConstPtr

using ConstPtr = SharedPtr<const MapBase>

## ◆ MapFactory

using MapFactory = Ptr (*)()

## ◆ Ptr

using Ptr = SharedPtr<MapBase>

## Constructor & Destructor Documentation

## ◆ MapBase() [1/2]

MapBase | ( | const MapBase & |  | ) |
| default

## ◆ ~MapBase()

virtual ~MapBase | ( |  | ) |
| virtualdefault

## ◆ MapBase() [2/2]

MapBase | ( |  | ) |
| inlineprotected

## Member Function Documentation

## ◆ applyIJC() [1/2]

virtual Mat3d applyIJC | ( | const Mat3d & | m | ) | const
| pure virtual

Implemented in ScaleMap, ScaleTranslateMap, UnitaryMap, NonlinearFrustumMap, AffineMap, and TranslationMap.

## ◆ applyIJC() [2/2]

virtual Mat3d applyIJC | ( | const Mat3d & | m,
|  | const Vec3d & | v,
|  | const Vec3d & | domainPos
| ) |  | const
| pure virtual

Implemented in NonlinearFrustumMap, ScaleMap, ScaleTranslateMap, AffineMap, UnitaryMap, and TranslationMap.

## ◆ applyIJT() [1/2]

virtual Vec3d applyIJT | ( | const Vec3d & | in | ) | const
| pure virtual

Apply the Inverse Jacobian Transpose of this map to a vector. For a linear map this is equivalent to applying the transpose of inverse map excluding translation.

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ applyIJT() [2/2]

virtual Vec3d applyIJT | ( | const Vec3d & | in,
|  | const Vec3d & | domainPos
| ) |  | const
| pure virtual

Implemented in NonlinearFrustumMap, ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, and UnitaryMap.

## ◆ applyInverseJacobian() [1/2]

virtual Vec3d applyInverseJacobian | ( | const Vec3d & | in | ) | const
| pure virtual

Apply the InverseJacobian of this map to a vector. For a linear map this is equivalent to applying the map inverse excluding translation.

Warning
  Houdini 12.5 uses an earlier version of OpenVDB, and maps created with that version lack a virtual table entry for this method. Do not call this method from Houdini 12.5.

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ applyInverseJacobian() [2/2]

virtual Vec3d applyInverseJacobian | ( | const Vec3d & | in,
|  | const Vec3d & | domainPos
| ) |  | const
| pure virtual

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ applyInverseMap()

virtual Vec3d applyInverseMap | ( | const Vec3d & | in | ) | const
| pure virtual

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ applyJacobian() [1/2]

virtual Vec3d applyJacobian | ( | const Vec3d & | in | ) | const
| pure virtual

Apply the Jacobian of this map to a vector. For a linear map this is equivalent to applying the map excluding translation.

Warning
  Houdini 12.5 uses an earlier version of OpenVDB, and maps created with that version lack a virtual table entry for this method. Do not call this method from Houdini 12.5.

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ applyJacobian() [2/2]

virtual Vec3d applyJacobian | ( | const Vec3d & | in,
|  | const Vec3d & | domainPos
| ) |  | const
| pure virtual

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ applyJT() [1/2]

virtual Vec3d applyJT | ( | const Vec3d & | in | ) | const
| pure virtual

Apply the Jacobian transpose of this map to a vector. For a linear map this is equivalent to applying the transpose of the map excluding translation.

Warning
  Houdini 12.5 uses an earlier version of OpenVDB, and maps created with that version lack a virtual table entry for this method. Do not call this method from Houdini 12.5.

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ applyJT() [2/2]

virtual Vec3d applyJT | ( | const Vec3d & | in,
|  | const Vec3d & | domainPos
| ) |  | const
| pure virtual

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ applyMap()

virtual Vec3d applyMap | ( | const Vec3d & | in | ) | const
| pure virtual

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ copy()

virtual MapBase::Ptr copy | ( |  | ) | const
| pure virtual

Implemented in AffineMap, ScaleMap, UniformScaleMap, TranslationMap, ScaleTranslateMap, UniformScaleTranslateMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ determinant() [1/2]

virtual double determinant | ( |  | ) | const
| pure virtual

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ determinant() [2/2]

virtual double determinant | ( | const Vec3d & |  | ) | const
| pure virtual

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ getAffineMap()

virtual SharedPtr< AffineMap > getAffineMap | ( |  | ) | const
| pure virtual

Implemented in AffineMap, ScaleMap, TranslationMap, ScaleTranslateMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ hasUniformScale()

virtual bool hasUniformScale | ( |  | ) | const
| pure virtual

Return `true` if the spacing between the image of latice is uniform in all directions.

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ inverseMap()

virtual MapBase::Ptr inverseMap | ( |  | ) | const
| pure virtual

Return a new map representing the inverse of this map.

Exceptions

  NotImplementedError | if the map is a NonlinearFrustumMap.

Warning
  Houdini 12.5 uses an earlier version of OpenVDB, and maps created with that version lack a virtual table entry for this method. Do not call this method from Houdini 12.5.

Implemented in AffineMap, ScaleMap, UniformScaleMap, TranslationMap, ScaleTranslateMap, UniformScaleTranslateMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ isEqual()

virtual bool isEqual | ( | const MapBase & | other | ) | const
| pure virtual

Return `true` if this map is equal to the given map.

Implemented in AffineMap, ScaleMap, UniformScaleMap, TranslationMap, ScaleTranslateMap, UniformScaleTranslateMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ isEqualBase()

template<typename MapT >

static bool isEqualBase | ( | const MapT & | self,
|  | const MapBase & | other
| ) |  |
| inlinestaticprotected

## ◆ isLinear()

virtual bool isLinear | ( |  | ) | const
| pure virtual

Return `true` if this map is linear.

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ isType()

template<typename MapT >

bool isType | ( |  | ) | const
| inline

Return `true` if this map is of concrete type `MapT` (e.g., AffineMap).

## ◆ postRotate()

virtual MapBase::Ptr postRotate | ( | double | radians,
|  | Axis | axis = `X_AXIS`
| ) |  | const
| pure virtual

Implemented in ScaleMap, TranslationMap, ScaleTranslateMap, UnitaryMap, AffineMap, and NonlinearFrustumMap.

## ◆ postScale()

virtual MapBase::Ptr postScale | ( | const Vec3d & |  | ) | const
| pure virtual

Implemented in ScaleMap, AffineMap, NonlinearFrustumMap, TranslationMap, ScaleTranslateMap, and UnitaryMap.

## ◆ postShear()

virtual MapBase::Ptr postShear | ( | double | shear,
|  | Axis | axis0,
|  | Axis | axis1
| ) |  | const
| pure virtual

Implemented in AffineMap, ScaleMap, TranslationMap, ScaleTranslateMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ postTranslate()

virtual MapBase::Ptr postTranslate | ( | const Vec3d & |  | ) | const
| pure virtual

Implemented in ScaleMap, UniformScaleMap, AffineMap, TranslationMap, ScaleTranslateMap, UniformScaleTranslateMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ preRotate()

virtual MapBase::Ptr preRotate | ( | double | radians,
|  | Axis | axis = `X_AXIS`
| ) |  | const
| pure virtual

Methods to update the map.

Implemented in ScaleMap, TranslationMap, ScaleTranslateMap, UnitaryMap, AffineMap, and NonlinearFrustumMap.

## ◆ preScale()

virtual MapBase::Ptr preScale | ( | const Vec3d & |  | ) | const
| pure virtual

Implemented in ScaleMap, AffineMap, NonlinearFrustumMap, TranslationMap, ScaleTranslateMap, and UnitaryMap.

## ◆ preShear()

virtual MapBase::Ptr preShear | ( | double | shear,
|  | Axis | axis0,
|  | Axis | axis1
| ) |  | const
| pure virtual

Implemented in AffineMap, ScaleMap, TranslationMap, ScaleTranslateMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ preTranslate()

virtual MapBase::Ptr preTranslate | ( | const Vec3d & |  | ) | const
| pure virtual

Implemented in ScaleMap, UniformScaleMap, AffineMap, TranslationMap, ScaleTranslateMap, UniformScaleTranslateMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ read()

virtual void read | ( | std::istream & |  | ) |
| pure virtual

Implemented in AffineMap, ScaleMap, TranslationMap, ScaleTranslateMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ str()

virtual std::string str | ( |  | ) | const
| pure virtual

Implemented in AffineMap, ScaleMap, TranslationMap, ScaleTranslateMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ type()

virtual Name type | ( |  | ) | const
| pure virtual

Return the name of this map's concrete type (e.g., `"AffineMap"`).

Implemented in AffineMap, ScaleMap, UniformScaleMap, TranslationMap, ScaleTranslateMap, UniformScaleTranslateMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ voxelSize() [1/2]

virtual Vec3d voxelSize | ( |  | ) | const
| pure virtual

Method to return the local size of a voxel. When a location is specified as an argument, it is understood to be be in the domain of the map (i.e. index space)

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ voxelSize() [2/2]

virtual Vec3d voxelSize | ( | const Vec3d & |  | ) | const
| pure virtual

Implemented in ScaleMap, ScaleTranslateMap, AffineMap, TranslationMap, UnitaryMap, and NonlinearFrustumMap.

## ◆ write()

virtual void write | ( | std::ostream & |  | ) | const
| pure virtual

Implemented in AffineMap, ScaleMap, TranslationMap, ScaleTranslateMap, UnitaryMap, and NonlinearFrustumMap.