HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nanovdb::HDDA< RayT, CoordT > Class Template Reference

A Digital Differential Analyzer specialized for OpenVDB grids. More...

#include <HDDA.h>

Public Types

using RealType = typename RayT::RealType
 
using RealT = RealType
 
using Vec3Type = typename RayT::Vec3Type
 
using Vec3T = Vec3Type
 
using CoordType = CoordT
 

Public Member Functions

 HDDA ()=default
 Default ctor. More...
 
__hostdev__ HDDA (const RayT &ray, int dim)
 ctor from ray and dimension at which the DDA marches More...
 
__hostdev__ void init (const RayT &ray, RealT startTime, RealT maxTime, int dim)
 Re-initializes the HDDA. More...
 
__hostdev__ void init (const RayT &ray, int dim)
 Simular to init above except it uses the bounds of the input ray. More...
 
__hostdev__ bool update (const RayT &ray, int dim)
 Updates the HDDA to march with the specified dimension. More...
 
__hostdev__ int dim () const
 
__hostdev__ bool step ()
 Increment the voxel index to next intersected voxel or node and returns true if the step in time does not exceed maxTime. More...
 
__hostdev__ const CoordT & voxel () const
 Return the index coordinates of the next node or voxel intersected by the ray. If Log2Dim = 0 the return value is the actual signed coordinate of the voxel, else it is the origin of the corresponding VDB tree node or tile. More...
 
__hostdev__ RealType time () const
 Return the time (parameterized along the Ray) of the first hit of a tree node of size 2^Log2Dim. More...
 
__hostdev__ RealType maxTime () const
 Return the maximum time (parameterized along the Ray). More...
 
__hostdev__ RealType next () const
 Return the time (parameterized along the Ray) of the second (i.e. next) hit of a tree node of size 2^Log2Dim. More...
 

Detailed Description

template<typename RayT, typename CoordT = Coord>
class nanovdb::HDDA< RayT, CoordT >

A Digital Differential Analyzer specialized for OpenVDB grids.

Note
Conceptually similar to Bresenham's line algorithm applied to a 3D Ray intersecting OpenVDB nodes or voxels. Log2Dim = 0 corresponds to a voxel and Log2Dim a tree node of size 2^Log2Dim.
The Ray template class is expected to have the following methods: test(time), t0(), t1(), invDir(), and operator()(time). See the example Ray class above for their definition.

Definition at line 29 of file HDDA.h.

Member Typedef Documentation

template<typename RayT, typename CoordT = Coord>
using nanovdb::HDDA< RayT, CoordT >::CoordType = CoordT

Definition at line 36 of file HDDA.h.

template<typename RayT, typename CoordT = Coord>
using nanovdb::HDDA< RayT, CoordT >::RealT = RealType

Definition at line 33 of file HDDA.h.

template<typename RayT, typename CoordT = Coord>
using nanovdb::HDDA< RayT, CoordT >::RealType = typename RayT::RealType

Definition at line 32 of file HDDA.h.

template<typename RayT, typename CoordT = Coord>
using nanovdb::HDDA< RayT, CoordT >::Vec3T = Vec3Type

Definition at line 35 of file HDDA.h.

template<typename RayT, typename CoordT = Coord>
using nanovdb::HDDA< RayT, CoordT >::Vec3Type = typename RayT::Vec3Type

Definition at line 34 of file HDDA.h.

Constructor & Destructor Documentation

template<typename RayT, typename CoordT = Coord>
nanovdb::HDDA< RayT, CoordT >::HDDA ( )
default

Default ctor.

template<typename RayT, typename CoordT = Coord>
__hostdev__ nanovdb::HDDA< RayT, CoordT >::HDDA ( const RayT &  ray,
int  dim 
)
inline

ctor from ray and dimension at which the DDA marches

Definition at line 42 of file HDDA.h.

Member Function Documentation

template<typename RayT, typename CoordT = Coord>
__hostdev__ int nanovdb::HDDA< RayT, CoordT >::dim ( ) const
inline

Definition at line 91 of file HDDA.h.

template<typename RayT, typename CoordT = Coord>
__hostdev__ void nanovdb::HDDA< RayT, CoordT >::init ( const RayT &  ray,
RealT  startTime,
RealT  maxTime,
int  dim 
)
inline

Re-initializes the HDDA.

Definition at line 45 of file HDDA.h.

template<typename RayT, typename CoordT = Coord>
__hostdev__ void nanovdb::HDDA< RayT, CoordT >::init ( const RayT &  ray,
int  dim 
)
inline

Simular to init above except it uses the bounds of the input ray.

Definition at line 70 of file HDDA.h.

template<typename RayT, typename CoordT = Coord>
__hostdev__ RealType nanovdb::HDDA< RayT, CoordT >::maxTime ( ) const
inline

Return the maximum time (parameterized along the Ray).

Definition at line 130 of file HDDA.h.

template<typename RayT, typename CoordT = Coord>
__hostdev__ RealType nanovdb::HDDA< RayT, CoordT >::next ( ) const
inline

Return the time (parameterized along the Ray) of the second (i.e. next) hit of a tree node of size 2^Log2Dim.

Note
Incurs a (small) computational overhead.

Definition at line 135 of file HDDA.h.

template<typename RayT, typename CoordT = Coord>
__hostdev__ bool nanovdb::HDDA< RayT, CoordT >::step ( )
inline

Increment the voxel index to next intersected voxel or node and returns true if the step in time does not exceed maxTime.

Definition at line 95 of file HDDA.h.

template<typename RayT, typename CoordT = Coord>
__hostdev__ RealType nanovdb::HDDA< RayT, CoordT >::time ( ) const
inline

Return the time (parameterized along the Ray) of the first hit of a tree node of size 2^Log2Dim.

This value is initialized to startTime or ray.t0() depending on the constructor used.

Note
Incurs no computational overhead.

Definition at line 127 of file HDDA.h.

template<typename RayT, typename CoordT = Coord>
__hostdev__ bool nanovdb::HDDA< RayT, CoordT >::update ( const RayT &  ray,
int  dim 
)
inline

Updates the HDDA to march with the specified dimension.

Definition at line 73 of file HDDA.h.

template<typename RayT, typename CoordT = Coord>
__hostdev__ const CoordT& nanovdb::HDDA< RayT, CoordT >::voxel ( ) const
inline

Return the index coordinates of the next node or voxel intersected by the ray. If Log2Dim = 0 the return value is the actual signed coordinate of the voxel, else it is the origin of the corresponding VDB tree node or tile.

Note
Incurs no computational overhead.

Definition at line 120 of file HDDA.h.


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