HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim > Class Template Reference

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

#include <DDA.h>

Public Types

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

Public Member Functions

 DDA ()
 uninitialized constructor More...
 
 DDA (const RayT &ray)
 
 DDA (const RayT &ray, RealT startTime)
 
 DDA (const RayT &ray, RealT startTime, RealT maxTime)
 
void init (const RayT &ray, RealT startTime, RealT maxTime)
 
void init (const RayT &ray)
 
void init (const RayT &ray, RealT startTime)
 
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...
 
const Coordvoxel () 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...
 
RealType time () const
 Return the time (parameterized along the Ray) of the first hit of a tree node of size 2^Log2Dim. More...
 
RealType maxTime () const
 Return the maximum time (parameterized along the Ray). More...
 
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...
 
void print (std::ostream &os=std::cout) const
 Print information about this DDA for debugging. More...
 

Detailed Description

template<typename RayT, Index Log2Dim = 0>
class openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >

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 34 of file DDA.h.

Member Typedef Documentation

template<typename RayT, Index Log2Dim = 0>
using openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::RealT = RealType

Definition at line 38 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
using openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::RealType = typename RayT::RealType

Definition at line 37 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
using openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::Vec3T = Vec3Type

Definition at line 40 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
using openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::Vec3Type = typename RayT::Vec3Type

Definition at line 39 of file DDA.h.

Constructor & Destructor Documentation

template<typename RayT, Index Log2Dim = 0>
openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::DDA ( )
inline

uninitialized constructor

Definition at line 43 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::DDA ( const RayT &  ray)
inline

Definition at line 45 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::DDA ( const RayT &  ray,
RealT  startTime 
)
inline

Definition at line 47 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::DDA ( const RayT &  ray,
RealT  startTime,
RealT  maxTime 
)
inline

Definition at line 49 of file DDA.h.

Member Function Documentation

template<typename RayT, Index Log2Dim = 0>
void openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::init ( const RayT &  ray,
RealT  startTime,
RealT  maxTime 
)
inline

Definition at line 51 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
void openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::init ( const RayT &  ray)
inline

Definition at line 76 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
void openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::init ( const RayT &  ray,
RealT  startTime 
)
inline

Definition at line 78 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
RealType openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::maxTime ( ) const
inline

Return the maximum time (parameterized along the Ray).

Definition at line 106 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
RealType openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::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 111 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
void openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::print ( std::ostream &  os = std::cout) const
inline

Print information about this DDA for debugging.

Parameters
osa stream to which to write textual information.

Definition at line 115 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
bool openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::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 82 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
RealType openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::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 103 of file DDA.h.

template<typename RayT, Index Log2Dim = 0>
const Coord& openvdb::OPENVDB_VERSION_NAME::math::DDA< RayT, Log2Dim >::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 96 of file DDA.h.


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