OpenVDB 11.0.0

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

This map is composed of three steps. First it will take a box of size (Lx X Ly X Lz) defined by a member data bounding box and map it into a frustum with near plane (1 X Ly/Lx) and prescribed depth Then this frustum is transformed by an internal second map: most often a uniform scale, but other effects can be achieved by accumulating translation, shear and rotation: these are all applied to the second map. More...

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

Inheritance diagram for NonlinearFrustumMap:

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

## Public Member Functions
| NonlinearFrustumMap ()
| NonlinearFrustumMap (const BBoxd &bb, double taper, double depth)
| Constructor that takes an index-space bounding box to be mapped into a frustum with a given depth and taper (defined as ratio of nearplane/farplane).
| NonlinearFrustumMap (const BBoxd &bb, double taper, double depth, const MapBase::Ptr &secondMap)
| Constructor that takes an index-space bounding box to be mapped into a frustum with a given depth and taper (defined as ratio of nearplane/farplane).
| NonlinearFrustumMap (const NonlinearFrustumMap &other)
| NonlinearFrustumMap (const Vec3d &position, const Vec3d &direction, const Vec3d &up, double aspect, double z_near, double depth, Coord::ValueType x_count, Coord::ValueType z_count)
| Constructor from a camera frustum.
| ~NonlinearFrustumMap () override=default
MapBase::Ptr | copy () const override
| Return a MapBase::Ptr to a deep copy of this map.
MapBase::Ptr | inverseMap () const override
| Not implemented, since there is currently no map type that can represent the inverse of a frustum.
Name | type () const override
| Return `NonlinearFrustumMap`.
bool | isLinear () const override
| Return `false` (a NonlinearFrustumMap is never linear).
bool | hasUniformScale () const override
| Return `false` (by convention false)
bool | isIdentity () const
| Return `true` if the map is equivalent to an identity.
bool | isEqual (const MapBase &other) const override
| Return `true` if this map is equal to the given map.
bool | operator== (const NonlinearFrustumMap &other) const
bool | operator!= (const NonlinearFrustumMap &other) const
Vec3d | applyMap (const Vec3d &in) const override
| Return the image of `in` under the map.
Vec3d | applyInverseMap (const Vec3d &in) const override
| Return the pre-image of `in` under the map.
Vec3d | applyJacobian (const Vec3d &in) const override
| Return the Jacobian of the linear second map applied to `in`.
Vec3d | applyJacobian (const Vec3d &in, const Vec3d &isloc) const override
| Return the Jacobian defined at `isloc` applied to `in`.
Vec3d | applyInverseJacobian (const Vec3d &in) const override
| Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation)
Vec3d | applyInverseJacobian (const Vec3d &in, const Vec3d &isloc) const override
| Return the Inverse Jacobian defined at `isloc` of the map applied to in.
Vec3d | applyJT (const Vec3d &in, const Vec3d &isloc) const override
| Return the Jacobian Transpose of the map applied to vector `in` at `indexloc`.
Vec3d | applyJT (const Vec3d &in) const override
| Return the Jacobian Transpose of the second map applied to `in`.
Vec3d | applyIJT (const Vec3d &in) const override
| Return the transpose of the inverse Jacobian of the linear second map applied to `in`.
Vec3d | applyIJT (const Vec3d &d1_is, const Vec3d &ijk) const override
Mat3d | applyIJC (const Mat3d &in) const override
| Return the Jacobian Curvature for the linear second map.
Mat3d | applyIJC (const Mat3d &d2_is, const Vec3d &d1_is, const Vec3d &ijk) const override
double | determinant () const override
| Return the determinant of the Jacobian of linear second map.
double | determinant (const Vec3d &loc) const override
Vec3d | voxelSize () const override
| Return the size of a voxel at the center of the near plane.
Vec3d | voxelSize (const Vec3d &loc) const override
| Returns the lengths of the images of the three segments from loc to loc + (1,0,0), from loc to loc + (0,1,0) and from loc to loc + (0,0,1)
AffineMap::Ptr | getAffineMap () const override
void | setTaper (double t)
| set the taper value, the ratio of nearplane width / far plane width
double | getTaper () const
| Return the taper value.
void | setDepth (double d)
| set the frustum depth: distance between near and far plane = frustm depth * frustm x-width
double | getDepth () const
| Return the unscaled frustm depth.
double | getGamma () const
const BBoxd & | getBBox () const
| Return the bounding box that defines the frustum in pre-image space.
const AffineMap & | secondMap () const
| Return MapBase::Ptr& to the second map.
bool | isValid () const
bool | hasSimpleAffine () const
| Return `true` if the second map is a uniform scale, Rotation and translation.
void | read (std::istream &is) override
| read serialization
void | write (std::ostream &os) const override
| write serialization
std::string | str () const override
| string serialization, useful for debuging
MapBase::Ptr | preRotate (double radians, Axis axis=X_AXIS) const override
| Return a MapBase::Ptr to a new map that is the result of prepending the given rotation to the linear part of this map.
MapBase::Ptr | preTranslate (const Vec3d &t) const override
| Return a MapBase::Ptr to a new map that is the result of prepending the given translation to the linear part of this map.
MapBase::Ptr | preScale (const Vec3d &s) const override
| Return a MapBase::Ptr to a new map that is the result of prepending the given scale to the linear part of this map.
MapBase::Ptr | preShear (double shear, Axis axis0, Axis axis1) const override
| Return a MapBase::Ptr to a new map that is the result of prepending the given shear to the linear part of this map.
MapBase::Ptr | postRotate (double radians, Axis axis=X_AXIS) const override
| Return a MapBase::Ptr to a new map that is the result of appending the given rotation to the linear part of this map.
MapBase::Ptr | postTranslate (const Vec3d &t) const override
| Return a MapBase::Ptr to a new map that is the result of appending the given translation to the linear part of this map.
MapBase::Ptr | postScale (const Vec3d &s) const override
| Return a MapBase::Ptr to a new map that is the result of appending the given scale to the linear part of this map.
MapBase::Ptr | postShear (double shear, Axis axis0, Axis axis1) const override
| Return a MapBase::Ptr to a new map that is the result of appending the given shear to the linear part of this map.
template<typename MapT >
bool | isType () const
| Return `true` if this map is of concrete type `MapT` (e.g., AffineMap).

## Static Public Member Functions
static MapBase::Ptr | create ()
| Return a MapBase::Ptr to a new NonlinearFrustumMap.
static bool | isRegistered ()
static void | registerMap ()
static Name | mapType ()
| Return `NonlinearFrustumMap`.

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

## Detailed Description

This map is composed of three steps. First it will take a box of size (Lx X Ly X Lz) defined by a member data bounding box and map it into a frustum with near plane (1 X Ly/Lx) and prescribed depth Then this frustum is transformed by an internal second map: most often a uniform scale, but other effects can be achieved by accumulating translation, shear and rotation: these are all applied to the second map.

## Member Typedef Documentation

## ◆ ConstPtr

using ConstPtr = SharedPtr<const NonlinearFrustumMap>

## ◆ MapFactory

using MapFactory = Ptr (*)()
| inherited

## ◆ Ptr

using Ptr = SharedPtr<NonlinearFrustumMap>

## Constructor & Destructor Documentation

## ◆ NonlinearFrustumMap() [1/5]

NonlinearFrustumMap | ( |  | ) |
| inline

## ◆ NonlinearFrustumMap() [2/5]

NonlinearFrustumMap | ( | const BBoxd & | bb,
|  | double | taper,
|  | double | depth
| ) |  |
| inline

Constructor that takes an index-space bounding box to be mapped into a frustum with a given depth and taper (defined as ratio of nearplane/farplane).

## ◆ NonlinearFrustumMap() [3/5]

NonlinearFrustumMap | ( | const BBoxd & | bb,
|  | double | taper,
|  | double | depth,
|  | const MapBase::Ptr & | secondMap
| ) |  |
| inline

Constructor that takes an index-space bounding box to be mapped into a frustum with a given depth and taper (defined as ratio of nearplane/farplane).

This frustum is further modifed by the secondMap, intended to be a simple translation and rotation and uniform scale

## ◆ NonlinearFrustumMap() [4/5]

NonlinearFrustumMap | ( | const NonlinearFrustumMap & | other | ) |
| inline

## ◆ NonlinearFrustumMap() [5/5]

NonlinearFrustumMap | ( | const Vec3d & | position,
|  | const Vec3d & | direction,
|  | const Vec3d & | up,
|  | double | aspect,
|  | double | z_near,
|  | double | depth,
|  | Coord::ValueType | x_count,
|  | Coord::ValueType | z_count
| ) |  |
| inline

Constructor from a camera frustum.

Parameters

  position | the tip of the frustum (i.e., the camera's position).
  direction | a vector pointing from position toward the near plane.
  up | a non-unit vector describing the direction and extent of the frustum's intersection on the near plane. Together, up must be orthogonal to direction.
  aspect | the aspect ratio of the frustum intersection with near plane defined as width / height
  z_near,depth | the distance from position along direction to the near and far planes of the frustum.
  x_count | the number of voxels, aligned with left, across the face of the frustum
  z_count | the number of voxels, aligned with direction, between the near and far planes

## ◆ ~NonlinearFrustumMap()

~NonlinearFrustumMap | ( |  | ) |
| override default

## Member Function Documentation

## ◆ applyIJC() [1/2]

Mat3d applyIJC | ( | const Mat3d & | d2_is,
|  | const Vec3d & | d1_is,
|  | const Vec3d & | ijk
| ) |  | const
| inline override virtual

Return the Jacobian Curvature: all the second derivatives in range space

Parameters

  d2_is | second derivative matrix computed in index space
  d1_is | gradient computed in index space
  ijk | the index space location where the result is computed

Implements MapBase.

## ◆ applyIJC() [2/2]

Mat3d applyIJC | ( | const Mat3d & | in | ) | const
| inline override virtual

Return the Jacobian Curvature for the linear second map.

Implements MapBase.

## ◆ applyIJT() [1/2]

Vec3d applyIJT | ( | const Vec3d & | d1_is,
|  | const Vec3d & | ijk
| ) |  | const
| inline override virtual

Return the transpose of the inverse Jacobain (at `locW` applied to `in`. `ijk` is the location in the pre-image space (e.g. index space)

Implements MapBase.

## ◆ applyIJT() [2/2]

Vec3d applyIJT | ( | const Vec3d & | in | ) | const
| inline override virtual

Return the transpose of the inverse Jacobian of the linear second map applied to `in`.

Implements MapBase.

## ◆ applyInverseJacobian() [1/2]

Vec3d applyInverseJacobian | ( | const Vec3d & | in | ) | const
| inline override virtual

Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation)

Implements MapBase.

## ◆ applyInverseJacobian() [2/2]

Vec3d applyInverseJacobian | ( | const Vec3d & | in,
|  | const Vec3d & | isloc
| ) |  | const
| inline override virtual

Return the Inverse Jacobian defined at `isloc` of the map applied to in.

Implements MapBase.

## ◆ applyInverseMap()

Vec3d applyInverseMap | ( | const Vec3d & | in | ) | const
| inline override virtual

Return the pre-image of `in` under the map.

Implements MapBase.

## ◆ applyJacobian() [1/2]

Vec3d applyJacobian | ( | const Vec3d & | in | ) | const
| inline override virtual

Return the Jacobian of the linear second map applied to `in`.

Implements MapBase.

## ◆ applyJacobian() [2/2]

Vec3d applyJacobian | ( | const Vec3d & | in,
|  | const Vec3d & | isloc
| ) |  | const
| inline override virtual

Return the Jacobian defined at `isloc` applied to `in`.

Implements MapBase.

## ◆ applyJT() [1/2]

Vec3d applyJT | ( | const Vec3d & | in | ) | const
| inline override virtual

Return the Jacobian Transpose of the second map applied to `in`.

Implements MapBase.

## ◆ applyJT() [2/2]

Vec3d applyJT | ( | const Vec3d & | in,
|  | const Vec3d & | isloc
| ) |  | const
| inline override virtual

Return the Jacobian Transpose of the map applied to vector `in` at `indexloc`.

This tranforms range-space gradients to domain-space gradients.

Implements MapBase.

## ◆ applyMap()

Vec3d applyMap | ( | const Vec3d & | in | ) | const
| inline override virtual

Return the image of `in` under the map.

Implements MapBase.

## ◆ copy()

MapBase::Ptr copy | ( |  | ) | const
| inline override virtual

Return a MapBase::Ptr to a deep copy of this map.

Implements MapBase.

## ◆ create()

static MapBase::Ptr create | ( |  | ) |
| inline static

Return a MapBase::Ptr to a new NonlinearFrustumMap.

## ◆ determinant() [1/2]

double determinant | ( |  | ) | const
| inline override virtual

Return the determinant of the Jacobian of linear second map.

Implements MapBase.

## ◆ determinant() [2/2]

double determinant | ( | const Vec3d & | loc | ) | const
| inline override virtual

Return the determinate of the Jacobian evaluated at `loc` `loc` is a location in the pre-image space (e.g., index space)

Implements MapBase.

## ◆ getAffineMap()

AffineMap::Ptr getAffineMap | ( |  | ) | const
| inline override virtual

Implements MapBase.

## ◆ getBBox()

const BBoxd & getBBox | ( |  | ) | const
| inline

Return the bounding box that defines the frustum in pre-image space.

## ◆ getDepth()

double getDepth | ( |  | ) | const
| inline

Return the unscaled frustm depth.

## ◆ getGamma()

double getGamma | ( |  | ) | const
| inline

## ◆ getTaper()

double getTaper | ( |  | ) | const
| inline

Return the taper value.

## ◆ hasSimpleAffine()

bool hasSimpleAffine | ( |  | ) | const
| inline

Return `true` if the second map is a uniform scale, Rotation and translation.

## ◆ hasUniformScale()

bool hasUniformScale | ( |  | ) | const
| inline override virtual

Return `false` (by convention false)

Implements MapBase.

## ◆ inverseMap()

MapBase::Ptr inverseMap | ( |  | ) | const
| inline override virtual

Not implemented, since there is currently no map type that can represent the inverse of a frustum.

Exceptions

  NotImplementedError |

Implements MapBase.

## ◆ isEqual()

bool isEqual | ( | const MapBase & | other | ) | const
| inline override virtual

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

Implements MapBase.

## ◆ isEqualBase()

template<typename MapT >

static bool isEqualBase | ( | const MapT & | self,
|  | const MapBase & | other
| ) |  |
| inline static protected inherited

## ◆ isIdentity()

bool isIdentity | ( |  | ) | const
| inline

Return `true` if the map is equivalent to an identity.

## ◆ isLinear()

bool isLinear | ( |  | ) | const
| inline override virtual

Return `false` (a NonlinearFrustumMap is never linear).

Implements MapBase.

## ◆ isRegistered()

static bool isRegistered | ( |  | ) |
| inline static

## ◆ isType()

template<typename MapT >

bool isType | ( |  | ) | const
| inline inherited

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

## ◆ isValid()

bool isValid | ( |  | ) | const
| inline

Return `true` if the the bounding box in index space that defines the region that is maped into the frustum is non-zero, otherwise `false`

## ◆ mapType()

static Name mapType | ( |  | ) |
| inline static

Return `NonlinearFrustumMap`.

## ◆ operator!=()

bool operator!= | ( | const NonlinearFrustumMap & | other | ) | const
| inline

## ◆ operator==()

bool operator== | ( | const NonlinearFrustumMap & | other | ) | const
| inline

## ◆ postRotate()

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

Return a MapBase::Ptr to a new map that is the result of appending the given rotation to the linear part of this map.

Implements MapBase.

## ◆ postScale()

MapBase::Ptr postScale | ( | const Vec3d & | s | ) | const
| inline override virtual

Return a MapBase::Ptr to a new map that is the result of appending the given scale to the linear part of this map.

Implements MapBase.

## ◆ postShear()

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

Return a MapBase::Ptr to a new map that is the result of appending the given shear to the linear part of this map.

Implements MapBase.

## ◆ postTranslate()

MapBase::Ptr postTranslate | ( | const Vec3d & | t | ) | const
| inline override virtual

Return a MapBase::Ptr to a new map that is the result of appending the given translation to the linear part of this map.

Implements MapBase.

## ◆ preRotate()

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

Return a MapBase::Ptr to a new map that is the result of prepending the given rotation to the linear part of this map.

Implements MapBase.

## ◆ preScale()

MapBase::Ptr preScale | ( | const Vec3d & | s | ) | const
| inline override virtual

Return a MapBase::Ptr to a new map that is the result of prepending the given scale to the linear part of this map.

Implements MapBase.

## ◆ preShear()

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

Return a MapBase::Ptr to a new map that is the result of prepending the given shear to the linear part of this map.

Implements MapBase.

## ◆ preTranslate()

MapBase::Ptr preTranslate | ( | const Vec3d & | t | ) | const
| inline override virtual

Return a MapBase::Ptr to a new map that is the result of prepending the given translation to the linear part of this map.

Implements MapBase.

## ◆ read()

void read | ( | std::istream & | is | ) |
| inline override virtual

read serialization

Implements MapBase.

## ◆ registerMap()

static void registerMap | ( |  | ) |
| inline static

## ◆ secondMap()

const AffineMap & secondMap | ( |  | ) | const
| inline

Return MapBase::Ptr& to the second map.

## ◆ setDepth()

void setDepth | ( | double | d | ) |
| inline

set the frustum depth: distance between near and far plane = frustm depth * frustm x-width

## ◆ setTaper()

void setTaper | ( | double | t | ) |
| inline

set the taper value, the ratio of nearplane width / far plane width

## ◆ str()

std::string str | ( |  | ) | const
| inline override virtual

string serialization, useful for debuging

Implements MapBase.

## ◆ type()

Name type | ( |  | ) | const
| inline override virtual

Return `NonlinearFrustumMap`.

Implements MapBase.

## ◆ voxelSize() [1/2]

Vec3d voxelSize | ( |  | ) | const
| inline override virtual

Return the size of a voxel at the center of the near plane.

Implements MapBase.

## ◆ voxelSize() [2/2]

Vec3d voxelSize | ( | const Vec3d & | loc | ) | const
| inline override virtual

Returns the lengths of the images of the three segments from loc to loc + (1,0,0), from loc to loc + (0,1,0) and from loc to loc + (0,0,1)

Parameters

  loc | a location in the pre-image space (e.g., index space)

Implements MapBase.

## ◆ write()

void write | ( | std::ostream & | os | ) | const
| inline override virtual

write serialization

Implements MapBase.