VTK
Public Member Functions | Public Attributes | List of all members
vtkBlockSortHelper::BackToFront< T > Struct Template Reference

operator() for back-to-front sorting. More...

#include <vtkBlockSortHelper.h>

Public Member Functions

 BackToFront (vtkRenderer *ren, vtkMatrix4x4 *volMatrix)
 
bool operator() (T *first, T *second)
 
bool CompareByDistanceDescending (vtkImageData *first, vtkImageData *second)
 Compares distances from images (first, second) to the camera position. More...
 
void ComputeCenter (double const *bounds, double *center)
 
template<>
bool operator() (vtkImageData *first, vtkImageData *second)
 
template<>
bool operator() (vtkVolumeMapper *first, vtkVolumeMapper *second)
 

Public Attributes

double CameraPosition [4]
 

Detailed Description

template<typename T>
struct vtkBlockSortHelper::BackToFront< T >

operator() for back-to-front sorting.

Note
Use as the 'comp' parameter of std::sort.

Definition at line 40 of file vtkBlockSortHelper.h.

Constructor & Destructor Documentation

◆ BackToFront()

template<typename T >
vtkBlockSortHelper::BackToFront< T >::BackToFront ( vtkRenderer ren,
vtkMatrix4x4 volMatrix 
)
inline

Definition at line 45 of file vtkBlockSortHelper.h.

Member Function Documentation

◆ operator()() [1/3]

template<typename T >
bool vtkBlockSortHelper::BackToFront< T >::operator() ( T *  first,
T *  second 
)

◆ CompareByDistanceDescending()

template<typename T >
bool vtkBlockSortHelper::BackToFront< T >::CompareByDistanceDescending ( vtkImageData first,
vtkImageData second 
)
inline

Compares distances from images (first, second) to the camera position.

Returns true if the distance of first is greater than the distance of second (descending order according to the std::sort convention).

Note this does not provide the correct rendering order all the time. To get the correct rendering order (if there is one) you need a more complex algorithm.

Definition at line 73 of file vtkBlockSortHelper.h.

◆ ComputeCenter()

template<typename T >
void vtkBlockSortHelper::BackToFront< T >::ComputeCenter ( double const *  bounds,
double *  center 
)
inline

Definition at line 90 of file vtkBlockSortHelper.h.

◆ operator()() [2/3]

template<>
bool vtkBlockSortHelper::BackToFront< vtkImageData >::operator() ( vtkImageData first,
vtkImageData second 
)
inline

Definition at line 100 of file vtkBlockSortHelper.h.

◆ operator()() [3/3]

template<>
bool vtkBlockSortHelper::BackToFront< vtkVolumeMapper >::operator() ( vtkVolumeMapper first,
vtkVolumeMapper second 
)
inline

Definition at line 107 of file vtkBlockSortHelper.h.

Member Data Documentation

◆ CameraPosition

template<typename T >
double vtkBlockSortHelper::BackToFront< T >::CameraPosition[4]

Definition at line 42 of file vtkBlockSortHelper.h.


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