CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxDepthPeeling.cpp File Reference
#include "cxDepthPeeling.h"
#include "cxLogger.h"

Go to the source code of this file.

Functions

vtkSmartPointer< vtkAppendPolyData > GenerateOverlappingBunchOfSpheres (int theta, int phi)
 
bool SetupEnvironmentForDepthPeeling (vtkSmartPointer< vtkRenderWindow > renderWindow, vtkSmartPointer< vtkRenderer > renderer, int maxNoOfPeels, double occlusionRatio)
 
bool TurnOffDepthPeeling (vtkSmartPointer< vtkRenderWindow > renderWindow, vtkSmartPointer< vtkRenderer > renderer)
 Turn off depth peeling. More...
 
bool IsDepthPeelingSupported (vtkSmartPointer< vtkRenderWindow > renderWindow, vtkSmartPointer< vtkRenderer > renderer, bool doItOffScreen)
 

Function Documentation

vtkSmartPointer<vtkAppendPolyData> GenerateOverlappingBunchOfSpheres ( int  theta,
int  phi 
)

Generate a bunch of overlapping spheres within one poly data set: one big sphere evenly surrounded by four small spheres that intersect the centered sphere.

Parameters
thetasphere sampling resolution (THETA)
phisphere sampling resolution (PHI)
Returns
the set of spheres within one logical poly data set

Definition at line 22 of file cxDepthPeeling.cpp.

bool IsDepthPeelingSupported ( vtkSmartPointer< vtkRenderWindow >  renderWindow,
vtkSmartPointer< vtkRenderer >  renderer,
bool  doItOffScreen 
)

Find out whether this box supports depth peeling. Depth peeling requires a variety of openGL extensions and appropriate drivers.

Parameters
renderWindowa valid openGL-supporting render window
renderera valid renderer instance
doItOffScreendo the test off screen which means that nothing is rendered to screen (this requires the box to support off screen rendering)
Returns
TRUE if depth peeling is supported, FALSE otherwise (which means that another strategy must be used for correct rendering of translucent geometry, e.g. CPU-based depth sorting)

Definition at line 134 of file cxDepthPeeling.cpp.

bool SetupEnvironmentForDepthPeeling ( vtkSmartPointer< vtkRenderWindow >  renderWindow,
vtkSmartPointer< vtkRenderer >  renderer,
int  maxNoOfPeels,
double  occlusionRatio 
)

Setup the rendering environment for depth peeling (general depth peeling support is requested).

See also
IsDepthPeelingSupported()
Parameters
renderWindowa valid openGL-supporting render window
renderera valid renderer instance
maxNoOfPeelsmaximum number of depth peels (multi-pass rendering)
occlusionRatiothe occlusion ration (0.0 means a perfect image, >0.0 means a non-perfect image which in general results in faster rendering)
Returns
TRUE if depth peeling could be set up

Definition at line 67 of file cxDepthPeeling.cpp.

bool TurnOffDepthPeeling ( vtkSmartPointer< vtkRenderWindow >  renderWindow,
vtkSmartPointer< vtkRenderer >  renderer 
)

Turn off depth peeling.

Definition at line 102 of file cxDepthPeeling.cpp.