OpenVDB 12.1.0

Loading...
Searching...
No Matches
GridTransformer Class Reference

A GridTransformer applies a geometric transformation to an input grid using one of several sampling schemes, and stores the result in an output grid. More...

`#include <openvdb/tools/GridTransformer.h>`

Inheritance diagram for GridTransformer:

## Classes
struct | MatrixTransform

## Public Types
using | Ptr = SharedPtr<GridTransformer>
using | InterruptFunc = std::function<bool (void)>

## Public Member Functions
| GridTransformer (const Mat4R &xform)
| GridTransformer (const Vec3R &pivot, const Vec3R &scale, const Vec3R &rotate, const Vec3R &translate, const std::string &xformOrder="tsr", const std::string &rotationOrder="zyx")
| ~GridTransformer () override=default
| GridTransformer (const GridTransformer &)=default
GridTransformer & | operator= (const GridTransformer &)=default
const Mat4R & | getTransform () const
template<class Sampler, class GridT>
void | transformGrid (const GridT &inGrid, GridT &outGrid) const
void | setThreaded (bool b)
| Enable or disable threading. (Threading is enabled by default.)
bool | threaded () const
| Return `true` if threading is enabled.
void | setTransformTiles (bool b)
| Enable or disable processing of tiles. (Enabled by default, except for level set grids.)
bool | transformTiles () const
| Return `true` if tile processing is enabled.
template<typename InterrupterType>
void | setInterrupter (InterrupterType &)
| Allow processing to be aborted by providing an interrupter object. The interrupter will be queried periodically during processing.
template<typename Sampler, typename GridT, typename Transformer>
void | transformGrid (const Transformer &, const GridT &inGrid, GridT &outGrid) const

## Protected Member Functions
template<typename Sampler, typename GridT, typename Transformer>
void | applyTransform (const Transformer &, const GridT &inGrid, GridT &outGrid) const
bool | interrupt () const

## Detailed Description

A GridTransformer applies a geometric transformation to an input grid using one of several sampling schemes, and stores the result in an output grid.

Note
  GridTransformer is optimized for affine transformations.

Usage:

Mat4R xform = ...;
GridTransformer transformer(xform);
transformer.transformGrid<BoxSampler>(inGrid, outGrid);
openvdb::v12_1::tools::GridTransformer::GridTransformer
GridTransformer(const Mat4R &xform)
Definition GridTransformer.h:542
openvdb::v12_1::tools::outGrid
OutGridT & outGrid
Definition ValueTransformer.h:139
openvdb::v12_1::Mat4R
math::Mat4< Real > Mat4R
Definition Types.h:101
openvdb::v12_1::tools::BoxSampler
Definition Interpolation.h:121

or

Vec3R pivot = ..., scale = ..., rotate = ..., translate = ...;
GridTransformer transformer(pivot, scale, rotate, translate);
transformer.transformGrid<QuadraticSampler>(inGrid, outGrid);
openvdb::v12_1::Vec3R
math::Vec3< Real > Vec3R
Definition Types.h:72
openvdb::v12_1::tools::QuadraticSampler
Definition Interpolation.h:164

## Member Typedef Documentation

## ◆ InterruptFunc

using InterruptFunc = std::function<bool (void)>
| inherited

## ◆ Ptr

using Ptr = SharedPtr<GridTransformer>

## Constructor & Destructor Documentation

## ◆ GridTransformer() [1/3]

GridTransformer | ( | const Mat4R & | xform | ) |
| inline

## ◆ GridTransformer() [2/3]

GridTransformer | ( | const Vec3R & | pivot,
|  | const Vec3R & | scale,
|  | const Vec3R & | rotate,
|  | const Vec3R & | translate,
|  | const std::string & | xformOrder = "tsr",
|  | const std::string & | rotationOrder = "zyx" )
| inline

## ◆ ~GridTransformer()

~GridTransformer | ( |  | ) |
| override default

## ◆ GridTransformer() [3/3]

GridTransformer | ( | const GridTransformer & |  | ) |
| default

## Member Function Documentation

## ◆ applyTransform()

template<class Sampler, class GridT, typename Transformer>

void applyTransform | ( | const Transformer & | xform,
|  | const GridT & | inGrid,
|  | GridT & | outGrid ) const
| protected inherited

## ◆ getTransform()

const Mat4R & getTransform | ( |  | ) | const
| inline

## ◆ interrupt()

bool interrupt | ( |  | ) | const
| inline protected inherited

## ◆ operator=()

GridTransformer & operator= | ( | const GridTransformer & |  | ) |
| default

## ◆ setInterrupter()

template<typename InterrupterType>

void setInterrupter | ( | InterrupterType & | interrupter | ) |
| inherited

Allow processing to be aborted by providing an interrupter object. The interrupter will be queried periodically during processing.

See also
  util/NullInterrupter.h for interrupter interface requirements.

## ◆ setThreaded()

void setThreaded | ( | bool | b | ) |
| inline inherited

Enable or disable threading. (Threading is enabled by default.)

## ◆ setTransformTiles()

void setTransformTiles | ( | bool | b | ) |
| inline inherited

Enable or disable processing of tiles. (Enabled by default, except for level set grids.)

## ◆ threaded()

bool threaded | ( |  | ) | const
| inline inherited

Return `true` if threading is enabled.

## ◆ transformGrid() [1/2]

template<typename Sampler, typename GridT, typename Transformer>

void transformGrid | ( | const Transformer & | xform,
|  | const GridT & | inGrid,
|  | GridT & | outGrid ) const
| inherited

## ◆ transformGrid() [2/2]

template<class Sampler, class GridT>

void transformGrid | ( | const GridT & | inGrid,
|  | GridT & | outGrid ) const

## ◆ transformTiles()

bool transformTiles | ( |  | ) | const
| inline inherited

Return `true` if tile processing is enabled.