HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::tools::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 <RayIntersector.h>

Public Types

typedef GridT GridType
 
typedef RayT RayType
 
typedef RayT::RealType RealType
 
typedef RayT::Vec3T Vec3Type
 
typedef GridT::ValueType ValueT
 
typedef GridT::TreeType TreeT
 

Public Member Functions

 HBOOST_STATIC_ASSERT (NodeLevel >=-1 &&NodeLevel< int(TreeT::DEPTH)-1)
 
 HBOOST_STATIC_ASSERT (hboost::is_floating_point< ValueT >::value)
 
 LevelSetRayIntersector (const GridT &grid, const ValueT &isoValue=zeroVal< ValueT >())
 Constructor. More...
 
const ValueTgetIsoValue () const
 Return the iso-value used for ray-intersections. More...
 
bool intersectsIS (const RayType &iRay) const
 Return true if the index-space ray intersects the level set. More...
 
bool intersectsIS (const RayType &iRay, RealType &iTime) const
 Return true if the index-space ray intersects the level set. More...
 
bool intersectsIS (const RayType &iRay, Vec3Type &xyz) const
 Return true if the index-space ray intersects the level set. More...
 
bool intersectsIS (const RayType &iRay, Vec3Type &xyz, RealType &iTime) const
 Return true if the index-space ray intersects the level set. More...
 
bool intersectsWS (const RayType &wRay) const
 Return true if the world-space ray intersects the level set. More...
 
bool intersectsWS (const RayType &wRay, RealType &wTime) const
 Return true if the world-space ray intersects the level set. More...
 
bool intersectsWS (const RayType &wRay, Vec3Type &world) const
 Return true if the world-space ray intersects the level set. More...
 
bool intersectsWS (const RayType &wRay, Vec3Type &world, RealType &wTime) const
 Return true if the world-space ray intersects the level set. More...
 
bool intersectsWS (const RayType &wRay, Vec3Type &world, Vec3Type &normal) const
 Return true if the world-space ray intersects the level set. More...
 
bool intersectsWS (const RayType &wRay, Vec3Type &world, Vec3Type &normal, RealType &wTime) const
 Return true if the world-space ray intersects the level set. More...
 

Detailed Description

template<typename GridT, typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
class openvdb::OPENVDB_VERSION_NAME::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.
Todo:
Add TrilinearSearchImpl, as an alternative to LinearSearchImpl, that performs analytical 3D trilinear intersection tests, i.e., solves cubic equations. This is slower but also more accurate than the 1D linear interpolation in LinearSearchImpl.

Definition at line 109 of file RayIntersector.h.

Member Typedef Documentation

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

Definition at line 112 of file RayIntersector.h.

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

Definition at line 113 of file RayIntersector.h.

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

Definition at line 114 of file RayIntersector.h.

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

Definition at line 117 of file RayIntersector.h.

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
typedef GridT::ValueType openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::ValueT

Definition at line 116 of file RayIntersector.h.

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
typedef RayT::Vec3T openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::Vec3Type

Definition at line 115 of file RayIntersector.h.

Constructor & Destructor Documentation

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::LevelSetRayIntersector ( const GridT &  grid,
const ValueT isoValue = zeroVal<ValueT>() 
)
inline

Constructor.

Parameters
gridlevel set grid to intersect rays against.
isoValueoptional iso-value for the ray-intersection.

Definition at line 125 of file RayIntersector.h.

Member Function Documentation

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
const ValueT& openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::getIsoValue ( ) const
inline

Return the iso-value used for ray-intersections.

Definition at line 140 of file RayIntersector.h.

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::HBOOST_STATIC_ASSERT ( )
template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::HBOOST_STATIC_ASSERT ( hboost::is_floating_point< ValueT >::value  )
template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::intersectsIS ( const RayType iRay) const
inline

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

Parameters
iRayray represented in index space.

Definition at line 144 of file RayIntersector.h.

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::intersectsIS ( const RayType iRay,
RealType iTime 
) const
inline

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

Parameters
iRayray represented in index space.
iTimeif an intersection was found it is assigned the time of the intersection along the index ray.

Definition at line 154 of file RayIntersector.h.

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::intersectsIS ( const RayType iRay,
Vec3Type xyz 
) const
inline

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

Parameters
iRayray represented in index space.
xyzif an intersection was found it is assigned the intersection point in index space, otherwise it is unchanged.

Definition at line 165 of file RayIntersector.h.

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::intersectsIS ( const RayType iRay,
Vec3Type xyz,
RealType iTime 
) const
inline

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

Parameters
iRayray represented in index space.
xyzif an intersection was found it is assigned the intersection point in index space, otherwise it is unchanged.
iTimeif an intersection was found it is assigned the time of the intersection along the index ray.

Definition at line 179 of file RayIntersector.h.

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::intersectsWS ( const RayType wRay) const
inline

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

Parameters
wRayray represented in world space.

Definition at line 190 of file RayIntersector.h.

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::intersectsWS ( const RayType wRay,
RealType wTime 
) const
inline

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

Parameters
wRayray represented in world space.
wTimeif an intersection was found it is assigned the time of the intersection along the world ray.

Definition at line 200 of file RayIntersector.h.

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::intersectsWS ( const RayType wRay,
Vec3Type world 
) const
inline

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

Parameters
wRayray represented in world space.
worldif an intersection was found it is assigned the intersection point in world space, otherwise it is unchanged

Definition at line 211 of file RayIntersector.h.

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::intersectsWS ( const RayType wRay,
Vec3Type world,
RealType wTime 
) const
inline

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

Parameters
wRayray represented in world space.
worldif an intersection was found it is assigned the intersection point in world space, otherwise it is unchanged.
wTimeif an intersection was found it is assigned the time of the intersection along the world ray.

Definition at line 225 of file RayIntersector.h.

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::intersectsWS ( const RayType wRay,
Vec3Type world,
Vec3Type normal 
) const
inline

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

Parameters
wRayray represented in world space.
worldif an intersection was found it is assigned the intersection point in world space, otherwise it is unchanged.
normalif an intersection was found it is assigned the normal of the level set surface in world space, otherwise it is unchanged.

Definition at line 240 of file RayIntersector.h.

template<typename GridT , typename SearchImplT = LinearSearchImpl<GridT>, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetRayIntersector< GridT, SearchImplT, NodeLevel, RayT >::intersectsWS ( const RayType wRay,
Vec3Type world,
Vec3Type normal,
RealType wTime 
) const
inline

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

Parameters
wRayray represented in world space.
worldif an intersection was found it is assigned the intersection point in world space, otherwise it is unchanged.
normalif an intersection was found it is assigned the normal of the level set surface in world space, otherwise it is unchanged.
wTimeif an intersection was found it is assigned the time of the intersection along the world ray.

Definition at line 256 of file RayIntersector.h.


The documentation for this class was generated from the following file: