Loading...
Searching...
No Matches
VolumeRender< IntersectorT, SamplerT > Class Template Reference

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

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

## Detailed Description

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>
class openvdb::v10_0::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.

## Member Typedef Documentation

## AccessorType

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

using AccessorType = typename GridType::ConstAccessor

## GridType

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

using GridType = typename IntersectorT::GridType

## RayType

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

using RayType = typename IntersectorT::RayType

## SamplerType

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

using SamplerType = tools::GridSampler<AccessorType, SamplerT>

## ValueType

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

using ValueType = typename GridType::ValueType

## Constructor & Destructor Documentation

## VolumeRender() [1/2]

template<typename IntersectorT, typename SampleT>

VolumeRender | ( | const IntersectorT & | inter,
|  | BaseCamera & | camera )

inline

Constructor taking an intersector and a base camera.

## VolumeRender() [2/2]

template<typename IntersectorT, typename SampleT>

VolumeRender | ( | const VolumeRender< IntersectorT, SamplerT > & | other | ) |

inline

Copy constructor which creates a thread-safe clone.

## Member Function Documentation

## operator()()

template<typename IntersectorT, typename SampleT>

void operator() | ( | const tbb::blocked_range< size_t > & | range | ) | const

inline

Public method required by tbb::parallel_for.

Warning
  Never call it directly.

## print()

template<typename IntersectorT, typename SampleT>

void print | ( | std::ostream & | os = std::cout,
|  | int | verboseLevel = 1 )

inline

Print parameters, statistics, memory usage and other information.

Parameters

  os | a stream to which to write textual information
  verboseLevel | 1: print parameters only; 2: include grid statistics; 3: include memory usage

## render()

template<typename IntersectorT, typename SampleT>

void render | ( | bool | threaded = true | ) | const

inline

Perform the actual (potentially multithreaded) volume rendering.

## setAbsorption()

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

void setAbsorption | ( | Real | x,
|  | Real | y,
|  | Real | z )

inline

Set absorption coefficients.

## setCamera()

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

void setCamera | ( | BaseCamera & | camera | ) |

inline

Set the camera derived from the abstract BaseCamera class.

## setCutOff()

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

void setCutOff | ( | Real | cutOff | ) |

inline

Set the cut-off value for density and transmittance.

## setIntersector()

template<typename IntersectorT, typename SampleT>

void setIntersector | ( | const IntersectorT & | inter | ) |

inline

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

## setLightColor()

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

void setLightColor | ( | Real | r,
|  | Real | g,
|  | Real | b )

inline

Set the color of the directional light source.

## setLightDir()

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

void setLightDir | ( | Real | x,
|  | Real | y,
|  | Real | z )

inline

Set the vector components of a directional light source.

Exceptions

  ArithmeticError | if input is a null vector.

## setLightGain()

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

void setLightGain | ( | Real | gain | ) |

inline

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

## setPrimaryStep()

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

void setPrimaryStep | ( | Real | primaryStep | ) |

inline

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

## setScattering()

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

void setScattering | ( | Real | x,
|  | Real | y,
|  | Real | z )

inline

Set Scattering coefficients.

## setShadowStep()

template<typename IntersectorT, typename SamplerT = tools::BoxSampler>

void setShadowStep | ( | Real | shadowStep | ) |

inline

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