/usr/include/vtk-7.1/vtkOpenGLGPUVolumeRayCastMapper.h is in libvtk7-dev 7.1.1+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkOpenGLGPUVolumeRayCastMapper.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef vtkOpenGLGPUVolumeRayCastMapper_h
#define vtkOpenGLGPUVolumeRayCastMapper_h
#include "vtkRenderingVolumeOpenGL2Module.h" // For export macro
#include <vtkGPUVolumeRayCastMapper.h>
// Forward declarations
class vtkOpenGLCamera;
class vtkShaderProgram;
class vtkTextureObject;
class vtkGenericOpenGLResourceFreeCallback;
class vtkImplicitFunction;
//----------------------------------------------------------------------------
class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkOpenGLGPUVolumeRayCastMapper :
public vtkGPUVolumeRayCastMapper
{
public:
static vtkOpenGLGPUVolumeRayCastMapper* New();
enum Passes
{
RenderPass,
DepthPass = 1
};
vtkTypeMacro(vtkOpenGLGPUVolumeRayCastMapper, vtkGPUVolumeRayCastMapper);
void PrintSelf( ostream& os, vtkIndent indent );
// Description:
// Low level API to enable access to depth texture in
// RenderToTexture mode. It will return either NULL if
// RenderToImage was never turned on or texture captured
// the last time RenderToImage was on.
vtkTextureObject* GetDepthTexture();
// Description:
// Low level API to enable access to color texture in
// RenderToTexture mode. It will return either NULL if
// RenderToImage was never turned on or texture captured
// the last time RenderToImage was on.
vtkTextureObject* GetColorTexture();
// Description:
// Low level API to export the depth texture as vtkImageData in
// RenderToImage mode.
void GetDepthImage(vtkImageData* im);
// Description:
// Low level API to export the color texture as vtkImageData in
// RenderToImage mode.
void GetColorImage(vtkImageData* im);
// Description:
// Mapper can have multiple passes and internally it will set
// the state. The state can not be set externally explicitly
// but can be set indirectly depending on the options set by
// the user.
vtkGetMacro(CurrentPass, int);
//@{
/**
* Sets a user defined function to generate the ray jittering noise.
* vtkPerlinNoise is used by default with a texture size equivlent to
* the window size. These settings will have no effect when UseJittering
* is Off.
*/
void SetNoiseGenerator(vtkImplicitFunction* generator);
vtkSetVector2Macro(NoiseTextureSize, int);
//@}
protected:
vtkOpenGLGPUVolumeRayCastMapper();
~vtkOpenGLGPUVolumeRayCastMapper();
// Description:
// Delete OpenGL objects.
// \post done: this->OpenGLObjectsCreated==0
virtual void ReleaseGraphicsResources(vtkWindow *window);
vtkGenericOpenGLResourceFreeCallback *ResourceCallback;
// Description:
// Build vertex and fragment shader for the volume rendering
void BuildDepthPassShader(vtkRenderer* ren, vtkVolume* vol,
int noOfComponents,
int independentComponents);
// Description:
// Build vertex and fragment shader for the volume rendering
void BuildShader(vtkRenderer* ren, vtkVolume* vol, int noOfCmponents);
// TODO Take these out as these are no longer needed
// Methods called by the AMR Volume Mapper.
virtual void PreRender(vtkRenderer * vtkNotUsed(ren),
vtkVolume *vtkNotUsed(vol),
double vtkNotUsed(datasetBounds)[6],
double vtkNotUsed(scalarRange)[2],
int vtkNotUsed(noOfComponents),
unsigned int vtkNotUsed(numberOfLevels)) {};
// \pre input is up-to-date
virtual void RenderBlock(vtkRenderer *vtkNotUsed(ren),
vtkVolume *vtkNotUsed(vol),
unsigned int vtkNotUsed(level)) {}
virtual void PostRender(vtkRenderer *vtkNotUsed(ren),
int vtkNotUsed(noOfComponents)) {}
// Description:
// Rendering volume on GPU
void GPURender(vtkRenderer *ren, vtkVolume *vol);
// Description:
// Method that performs the actual rendering given a volume and a shader
void DoGPURender(vtkRenderer* ren,
vtkVolume* vol,
vtkImageData* input,
vtkOpenGLCamera* cam,
vtkShaderProgram* shaderProgram,
int noOfComponents,
int independentComponents);
// Description:
// Update the reduction factor of the render viewport (this->ReductionFactor)
// according to the time spent in seconds to render the previous frame
// (this->TimeToDraw) and a time in seconds allocated to render the next
// frame (allocatedTime).
// \pre valid_current_reduction_range: this->ReductionFactor>0.0 && this->ReductionFactor<=1.0
// \pre positive_TimeToDraw: this->TimeToDraw>=0.0
// \pre positive_time: allocatedTime>0
// \post valid_new_reduction_range: this->ReductionFactor>0.0 && this->ReductionFactor<=1.0
void ComputeReductionFactor(double allocatedTime);
// Description:
// Empty implementation.
void GetReductionRatio(double* ratio)
{
ratio[0] = ratio[1] = ratio[2] = 1.0;
}
// Description:
// Empty implementation.
virtual int IsRenderSupported(vtkRenderWindow *vtkNotUsed(window),
vtkVolumeProperty *vtkNotUsed(property))
{
return 1;
}
double ReductionFactor;
int CurrentPass;
private:
class vtkInternal;
vtkInternal* Impl;
vtkImplicitFunction* NoiseGenerator;
int NoiseTextureSize[2];
vtkOpenGLGPUVolumeRayCastMapper(
const vtkOpenGLGPUVolumeRayCastMapper&) VTK_DELETE_FUNCTION;
void operator=(const vtkOpenGLGPUVolumeRayCastMapper&) VTK_DELETE_FUNCTION;
};
#endif // vtkOpenGLGPUVolumeRayCastMapper_h
|