HDK
|
This class provides the public API for intersecting a ray with a generic (e.g. density) volume. More...
#include <RayIntersector.h>
Public Types | |
using | GridType = GridT |
using | RayType = RayT |
using | RealType = typename RayT::RealType |
using | RootType = typename GridT::TreeType::RootNodeType |
using | TreeT = tree::Tree< typename RootType::template ValueConverter< bool >::Type > |
Public Member Functions | |
VolumeRayIntersector (const GridT &grid, int dilationCount=0) | |
Grid constructor. More... | |
VolumeRayIntersector (const GridT &grid, const math::CoordBBox &bbox) | |
Grid and BBox constructor. More... | |
VolumeRayIntersector (const VolumeRayIntersector &other) | |
Shallow copy constructor. More... | |
~VolumeRayIntersector () | |
Destructor. More... | |
bool | setIndexRay (const RayT &iRay) |
Return false if the index ray misses the bbox of the grid. More... | |
bool | setWorldRay (const RayT &wRay) |
Return false if the world ray misses the bbox of the grid. More... | |
RayT::TimeSpan | march () |
bool | march (RealType &t0, RealType &t1) |
Return true if the ray intersects active values, i.e. either active voxels or tiles. Only when a hit is detected are t0 and t1 updated with the corresponding entry and exit times along the INDEX ray! More... | |
template<typename ListType > | |
void | hits (ListType &list) |
Generates a list of hits along the ray. More... | |
Vec3R | getIndexPos (RealType time) const |
Return the floating-point index position along the current index ray at the specified time. More... | |
Vec3R | getWorldPos (RealType time) const |
Return the floating-point world position along the current index ray at the specified time. More... | |
RealType | getWorldTime (RealType time) const |
const GridT & | grid () const |
Return a const reference to the input grid. More... | |
const TreeT & | tree () const |
Return a const reference to the (potentially dilated) bool tree used to accelerate the ray marching. More... | |
const math::CoordBBox & | bbox () const |
Return a const reference to the BBOX of the grid. More... | |
void | print (std::ostream &os=std::cout, int verboseLevel=1) |
Print bbox, statistics, memory usage and other information. More... | |
This class provides the public API for intersecting a ray with a generic (e.g. density) volume.
Internally it performs the actual hierarchical tree node traversal.
Definition at line 277 of file RayIntersector.h.
using openvdb::OPENVDB_VERSION_NAME::tools::VolumeRayIntersector< GridT, NodeLevel, RayT >::GridType = GridT |
Definition at line 280 of file RayIntersector.h.
using openvdb::OPENVDB_VERSION_NAME::tools::VolumeRayIntersector< GridT, NodeLevel, RayT >::RayType = RayT |
Definition at line 281 of file RayIntersector.h.
using openvdb::OPENVDB_VERSION_NAME::tools::VolumeRayIntersector< GridT, NodeLevel, RayT >::RealType = typename RayT::RealType |
Definition at line 282 of file RayIntersector.h.
using openvdb::OPENVDB_VERSION_NAME::tools::VolumeRayIntersector< GridT, NodeLevel, RayT >::RootType = typename GridT::TreeType::RootNodeType |
Definition at line 283 of file RayIntersector.h.
using openvdb::OPENVDB_VERSION_NAME::tools::VolumeRayIntersector< GridT, NodeLevel, RayT >::TreeT = tree::Tree<typename RootType::template ValueConverter<bool>::Type> |
Definition at line 284 of file RayIntersector.h.
|
inline |
Grid constructor.
grid | Generic grid to intersect rays against. |
dilationCount | The number of voxel dilations performed on (a boolean copy of) the input grid. This allows the intersector to account for the size of interpolation kernels in client code. |
RuntimeError | if the voxels of the grid are not uniform or the grid is empty. |
Definition at line 296 of file RayIntersector.h.
|
inline |
Grid and BBox constructor.
grid | Generic grid to intersect rays against. |
bbox | The axis-aligned bounding-box in the index space of the grid. |
RuntimeError | if the voxels of the grid are not uniform or the grid is empty. |
Definition at line 325 of file RayIntersector.h.
|
inline |
Shallow copy constructor.
Definition at line 346 of file RayIntersector.h.
|
inline |
Destructor.
Definition at line 358 of file RayIntersector.h.
|
inline |
Return a const reference to the BBOX of the grid.
Definition at line 452 of file RayIntersector.h.
|
inline |
Return the floating-point index position along the current index ray at the specified time.
Definition at line 433 of file RayIntersector.h.
|
inline |
Return the floating-point world position along the current index ray at the specified time.
Definition at line 437 of file RayIntersector.h.
|
inline |
Definition at line 439 of file RayIntersector.h.
|
inline |
Return a const reference to the input grid.
Definition at line 445 of file RayIntersector.h.
|
inline |
Generates a list of hits along the ray.
list | List of hits represented as time spans. |
Definition at line 426 of file RayIntersector.h.
|
inline |
Definition at line 389 of file RayIntersector.h.
|
inline |
Return true
if the ray intersects active values, i.e. either active voxels or tiles. Only when a hit is detected are t0 and t1 updated with the corresponding entry and exit times along the INDEX ray!
t0 | If the return value > 0 this is the time of the first hit of an active tile or leaf. |
t1 | If the return value > t0 this is the time of the first hit (> t0) of an inactive tile or exit point of the BBOX for the leaf nodes. |
Definition at line 410 of file RayIntersector.h.
|
inline |
Print bbox, statistics, memory usage and other information.
os | a stream to which to write textual information |
verboseLevel | 1: print bbox only; 2: include boolean tree statistics; 3: include memory usage |
Definition at line 458 of file RayIntersector.h.
|
inline |
Return false
if the index ray misses the bbox of the grid.
iRay | Ray represented in index space. |
Definition at line 365 of file RayIntersector.h.
|
inline |
Return false
if the world ray misses the bbox of the grid.
wRay | Ray represented in world space. |
Since hit times are computed with respect to the ray represented in index space of the current grid, it is recommended that either the client code uses getIndexPos to compute index position from hit times or alternatively keeps an instance of the index ray and instead uses setIndexRay to initialize the ray.
Definition at line 384 of file RayIntersector.h.
|
inline |
Return a const reference to the (potentially dilated) bool tree used to accelerate the ray marching.
Definition at line 449 of file RayIntersector.h.