HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT > Class Template Reference

A (very) simple multithreaded volume render specifically for scalar density. More...

#include <RayTracer.h>

Public Types

using GridType = typename IntersectorT::GridType
 
using RayType = typename IntersectorT::RayType
 
using ValueType = typename GridType::ValueType
 
using AccessorType = typename GridType::ConstAccessor
 
using SamplerType = tools::GridSampler< AccessorType, SamplerT >
 

Public Member Functions

 VolumeRender (const IntersectorT &inter, BaseCamera &camera)
 Constructor taking an intersector and a base camera. More...
 
 VolumeRender (const VolumeRender &other)
 Copy constructor which creates a thread-safe clone. More...
 
void render (bool threaded=true) const
 Perform the actual (potentially multithreaded) volume rendering. More...
 
void setCamera (BaseCamera &camera)
 Set the camera derived from the abstract BaseCamera class. More...
 
void setIntersector (const IntersectorT &inter)
 Set the intersector that performs the actual intersection of the rays against the volume. More...
 
void setLightDir (Real x, Real y, Real z)
 Set the vector components of a directional light source. More...
 
void setLightColor (Real r, Real g, Real b)
 Set the color of the directional light source. More...
 
void setPrimaryStep (Real primaryStep)
 Set the integration step-size in voxel units for the primay ray. More...
 
void setShadowStep (Real shadowStep)
 Set the integration step-size in voxel units for the primay ray. More...
 
void setScattering (Real x, Real y, Real z)
 Set Scattering coefficients. More...
 
void setAbsorption (Real x, Real y, Real z)
 Set absorption coefficients. More...
 
void setLightGain (Real gain)
 Set parameter that imitates multi-scattering. A value of zero implies no multi-scattering. More...
 
void setCutOff (Real cutOff)
 Set the cut-off value for density and transmittance. More...
 
void print (std::ostream &os=std::cout, int verboseLevel=1)
 Print parameters, statistics, memory usage and other information. More...
 
void operator() (const tbb::blocked_range< size_t > &range) const
 Public method required by tbb::parallel_for. More...
 

Detailed Description

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>
class openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >

A (very) simple multithreaded volume render specifically for scalar density.

Included primarily as a reference implementation.

Note
It will only compile if the IntersectorT is templated on a Grid with a floating-point voxel type.

Definition at line 182 of file RayTracer.h.

Member Typedef Documentation

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
using openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::AccessorType = typename GridType::ConstAccessor

Definition at line 189 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
using openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::GridType = typename IntersectorT::GridType

Definition at line 186 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
using openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::RayType = typename IntersectorT::RayType

Definition at line 187 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
using openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::SamplerType = tools::GridSampler<AccessorType, SamplerT>

Definition at line 190 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
using openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::ValueType = typename GridType::ValueType

Definition at line 188 of file RayTracer.h.

Constructor & Destructor Documentation

template<typename IntersectorT , typename SampleT >
openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SampleT >::VolumeRender ( const IntersectorT &  inter,
BaseCamera camera 
)
inline

Constructor taking an intersector and a base camera.

Definition at line 969 of file RayTracer.h.

template<typename IntersectorT , typename SampleT >
openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SampleT >::VolumeRender ( const VolumeRender< IntersectorT, SamplerT > &  other)
inline

Copy constructor which creates a thread-safe clone.

Definition at line 987 of file RayTracer.h.

Member Function Documentation

template<typename IntersectorT , typename SampleT >
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SampleT >::operator() ( const tbb::blocked_range< size_t > &  range) const
inline

Public method required by tbb::parallel_for.

Warning
Never call it directly.

Definition at line 1038 of file RayTracer.h.

template<typename IntersectorT , typename SampleT >
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SampleT >::print ( std::ostream &  os = std::cout,
int  verboseLevel = 1 
)
inline

Print parameters, statistics, memory usage and other information.

Parameters
osa stream to which to write textual information
verboseLevel1: print parameters only; 2: include grid statistics; 3: include memory usage

Definition at line 1005 of file RayTracer.h.

template<typename IntersectorT , typename SampleT >
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SampleT >::render ( bool  threaded = true) const
inline

Perform the actual (potentially multithreaded) volume rendering.

Definition at line 1030 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::setAbsorption ( Real  x,
Real  y,
Real  z 
)
inline

Set absorption coefficients.

Definition at line 227 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::setCamera ( BaseCamera camera)
inline

Set the camera derived from the abstract BaseCamera class.

Definition at line 204 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::setCutOff ( Real  cutOff)
inline

Set the cut-off value for density and transmittance.

Definition at line 234 of file RayTracer.h.

template<typename IntersectorT , typename SampleT >
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SampleT >::setIntersector ( const IntersectorT &  inter)
inline

Set the intersector that performs the actual intersection of the rays against the volume.

Definition at line 1022 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::setLightColor ( Real  r,
Real  g,
Real  b 
)
inline

Set the color of the directional light source.

Definition at line 215 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::setLightDir ( Real  x,
Real  y,
Real  z 
)
inline

Set the vector components of a directional light source.

Exceptions
ArithmeticErrorif input is a null vector.

Definition at line 212 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::setLightGain ( Real  gain)
inline

Set parameter that imitates multi-scattering. A value of zero implies no multi-scattering.

Definition at line 231 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::setPrimaryStep ( Real  primaryStep)
inline

Set the integration step-size in voxel units for the primay ray.

Definition at line 218 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::setScattering ( Real  x,
Real  y,
Real  z 
)
inline

Set Scattering coefficients.

Definition at line 224 of file RayTracer.h.

template<typename IntersectorT , typename SamplerT = tools::BoxSampler>
void openvdb::OPENVDB_VERSION_NAME::tools::VolumeRender< IntersectorT, SamplerT >::setShadowStep ( Real  shadowStep)
inline

Set the integration step-size in voxel units for the primay ray.

Definition at line 221 of file RayTracer.h.


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