OpenVDB 11.0.0

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT > Class Template Reference

This class provides the public API for intersecting a ray with a narrow-band level set. More...

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

## Public Types
using | GridType = GridT
using | RayType = RayT
using | RealType = typename RayT::RealType
using | Vec3Type = typename RayT::Vec3T
using | ValueT = typename GridT::ValueType
using | TreeT = typename GridT::TreeType

## Public Member Functions
| LevelSetRayIntersector (const GridT &grid, const ValueT &isoValue=zeroVal< ValueT >())
| Constructor.
const ValueT & | getIsoValue () const
| Return the iso-value used for ray-intersections.
bool | intersectsIS (const RayType &iRay) const
| Return `true` if the index-space ray intersects the level set.
bool | intersectsIS (const RayType &iRay, RealType &iTime) const
| Return `true` if the index-space ray intersects the level set.
bool | intersectsIS (const RayType &iRay, Vec3Type &xyz) const
| Return `true` if the index-space ray intersects the level set.
bool | intersectsIS (const RayType &iRay, Vec3Type &xyz, RealType &iTime) const
| Return `true` if the index-space ray intersects the level set.
bool | intersectsWS (const RayType &wRay) const
| Return `true` if the world-space ray intersects the level set.
bool | intersectsWS (const RayType &wRay, RealType &wTime) const
| Return `true` if the world-space ray intersects the level set.
bool | intersectsWS (const RayType &wRay, Vec3Type &world) const
| Return `true` if the world-space ray intersects the level set.
bool | intersectsWS (const RayType &wRay, Vec3Type &world, RealType &wTime) const
| Return `true` if the world-space ray intersects the level set.
bool | intersectsWS (const RayType &wRay, Vec3Type &world, Vec3Type &normal) const
| Return `true` if the world-space ray intersects the level set.
bool | intersectsWS (const RayType &wRay, Vec3Type &world, Vec3Type &normal, RealType &wTime) const
| Return `true` if the world-space ray intersects the level set.

## Detailed Description

template<typename GridT, typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
class openvdb::v11_0::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >

This class provides the public API for intersecting a ray with a narrow-band level set.

It wraps a SearchImplT with a simple public API and performs the actual hierarchical tree node and voxel traversal.

Warning
  Use the (default) copy-constructor to make sure each computational thread has their own instance of this class. This is important since the SearchImplT contains a ValueAccessor that is not thread-safe. However copying is very efficient.

See also
  tools/RayTracer.h for examples of intended usage.

## Member Typedef Documentation

## ◆ GridType

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

using GridType = GridT

## ◆ RayType

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

using RayType = RayT

## ◆ RealType

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

using RealType = typename RayT::RealType

## ◆ TreeT

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

using TreeT = typename GridT::TreeType

## ◆ ValueT

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

using ValueT = typename GridT::ValueType

## ◆ Vec3Type

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

using Vec3Type = typename RayT::Vec3T

## Constructor & Destructor Documentation

## ◆ LevelSetRayIntersector()

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

LevelSetRayIntersector | ( | const GridT & | grid,
|  | const ValueT & | isoValue = `zeroVal<ValueT>()`
| ) |  |
| inline

Constructor.

Parameters

  grid | level set grid to intersect rays against.
  isoValue | optional iso-value for the ray-intersection.

## Member Function Documentation

## ◆ getIsoValue()

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

const ValueT & getIsoValue | ( |  | ) | const
| inline

Return the iso-value used for ray-intersections.

## ◆ intersectsIS() [1/4]

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

bool intersectsIS | ( | const RayType & | iRay | ) | const
| inline

Return `true` if the index-space ray intersects the level set.

Parameters

  iRay | ray represented in index space.

## ◆ intersectsIS() [2/4]

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

bool intersectsIS | ( | const RayType & | iRay,
|  | RealType & | iTime
| ) |  | const
| inline

Return `true` if the index-space ray intersects the level set.

Parameters

  iRay | ray represented in index space.
  iTime | if an intersection was found it is assigned the time of the intersection along the index ray.

## ◆ intersectsIS() [3/4]

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

bool intersectsIS | ( | const RayType & | iRay,
|  | Vec3Type & | xyz
| ) |  | const
| inline

Return `true` if the index-space ray intersects the level set.

Parameters

  iRay | ray represented in index space.
  xyz | if an intersection was found it is assigned the intersection point in index space, otherwise it is unchanged.

## ◆ intersectsIS() [4/4]

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

bool intersectsIS | ( | const RayType & | iRay,
|  | Vec3Type & | xyz,
|  | RealType & | iTime
| ) |  | const
| inline

Return `true` if the index-space ray intersects the level set.

Parameters

  iRay | ray represented in index space.
  xyz | if an intersection was found it is assigned the intersection point in index space, otherwise it is unchanged.
  iTime | if an intersection was found it is assigned the time of the intersection along the index ray.

## ◆ intersectsWS() [1/6]

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

bool intersectsWS | ( | const RayType & | wRay | ) | const
| inline

Return `true` if the world-space ray intersects the level set.

Parameters

  wRay | ray represented in world space.

## ◆ intersectsWS() [2/6]

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

bool intersectsWS | ( | const RayType & | wRay,
|  | RealType & | wTime
| ) |  | const
| inline

Return `true` if the world-space ray intersects the level set.

Parameters

  wRay | ray represented in world space.
  wTime | if an intersection was found it is assigned the time of the intersection along the world ray.

## ◆ intersectsWS() [3/6]

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

bool intersectsWS | ( | const RayType & | wRay,
|  | Vec3Type & | world
| ) |  | const
| inline

Return `true` if the world-space ray intersects the level set.

Parameters

  wRay | ray represented in world space.
  world | if an intersection was found it is assigned the intersection point in world space, otherwise it is unchanged

## ◆ intersectsWS() [4/6]

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

bool intersectsWS | ( | const RayType & | wRay,
|  | Vec3Type & | world,
|  | RealType & | wTime
| ) |  | const
| inline

Return `true` if the world-space ray intersects the level set.

Parameters

  wRay | ray represented in world space.
  world | if an intersection was found it is assigned the intersection point in world space, otherwise it is unchanged.
  wTime | if an intersection was found it is assigned the time of the intersection along the world ray.

## ◆ intersectsWS() [5/6]

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

bool intersectsWS | ( | const RayType & | wRay,
|  | Vec3Type & | world,
|  | Vec3Type & | normal
| ) |  | const
| inline

Return `true` if the world-space ray intersects the level set.

Parameters

  wRay | ray represented in world space.
  world | if an intersection was found it is assigned the intersection point in world space, otherwise it is unchanged.
  normal | if an intersection was found it is assigned the normal of the level set surface in world space, otherwise it is unchanged.

## ◆ intersectsWS() [6/6]

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>

bool intersectsWS | ( | const RayType & | wRay,
|  | Vec3Type & | world,
|  | Vec3Type & | normal,
|  | RealType & | wTime
| ) |  | const
| inline

Return `true` if the world-space ray intersects the level set.

Parameters

  wRay | ray represented in world space.
  world | if an intersection was found it is assigned the intersection point in world space, otherwise it is unchanged.
  normal | if an intersection was found it is assigned the normal of the level set surface in world space, otherwise it is unchanged.
  wTime | if an intersection was found it is assigned the time of the intersection along the world ray.