VTK
vtkOpenGLGPUVolumeRayCastMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLGPUVolumeRayCastMapper.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 #ifndef vtkOpenGLGPUVolumeRayCastMapper_h
17 #define vtkOpenGLGPUVolumeRayCastMapper_h
18 
19 #include "vtkRenderingVolumeOpenGLNewModule.h" // For export macro
20 
22 
23 //----------------------------------------------------------------------------
24 class VTKRENDERINGVOLUMEOPENGLNEW_EXPORT vtkOpenGLGPUVolumeRayCastMapper :
26 {
27 public:
29 
31  void PrintSelf( ostream& os, vtkIndent indent );
32 
33 protected:
36 
37  // Description:
38  // Delete OpenGL objects.
39  // \post done: this->OpenGLObjectsCreated==0
40  virtual void ReleaseGraphicsResources(vtkWindow *window);
41 
42  // Description:
43  // Build vertex and fragment shader for the volume rendering
44  void BuildShader(vtkRenderer* ren, vtkVolume* vol, int noOfComponents);
45 
46  // Description:
47  // Rendering volume on GPU
48  void GPURender(vtkRenderer *ren, vtkVolume *vol);
49 
50  // Description:
51  // Not implemented
52  virtual void PreRender(vtkRenderer* vtkNotUsed(ren),
53  vtkVolume* vtkNotUsed(vol),
54  double vtkNotUsed(datasetBounds)[6],
55  double vtkNotUsed(scalarRange)[2],
56  int vtkNotUsed(numberOfScalarComponents),
57  unsigned int vtkNotUsed(numberOfLevels)) {};
58 
59  // Description:
60  // Empty implementation.
61  virtual void RenderBlock(vtkRenderer* vtkNotUsed(ren),
62  vtkVolume* vtkNotUsed(vol),
63  unsigned int vtkNotUsed(level)) {};
64 
65  // Description:
66  // Empty implementation.
67  virtual void PostRender(vtkRenderer* vtkNotUsed(ren),
68  int vtkNotUsed(umberOfScalarComponents)) {};
69 
70  // Description:
71  // Empty implementation.
72  void GetReductionRatio(double* ratio)
73  {
74  ratio[0] = ratio[1] = ratio[2] = 1.0;
75  }
76 
77  // Description:
78  // Empty implementation.
80  vtkVolumeProperty *vtkNotUsed(property))
81  {
82  return 1;
83  }
84 
85 private:
86  class vtkInternal;
87  vtkInternal* Impl;
88 
90  const vtkOpenGLGPUVolumeRayCastMapper&); // Not implemented.
91  void operator=(const vtkOpenGLGPUVolumeRayCastMapper&); // Not implemented.
92 };
93 
94 #endif // vtkOpenGLGPUVolumeRayCastMapper_h
virtual void GPURender(vtkRenderer *, vtkVolume *)
#define vtkNotUsed(x)
Definition: vtkSetGet.h:547
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:49
GLint level
Definition: vtkgl.h:11316
abstract specification for renderers
Definition: vtkRenderer.h:63
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:632
window superclass for vtkRenderWindow
Definition: vtkWindow.h:33
OpenGL subclass that draws the image to the screen.
a simple class to control print indentation
Definition: vtkIndent.h:38
represents the common properties for rendering a volume.
create a window for renderers to draw into
virtual void PostRender(vtkRenderer *vtkNotUsed(ren), int vtkNotUsed(umberOfScalarComponents))
virtual int IsRenderSupported(vtkRenderWindow *vtkNotUsed(window), vtkVolumeProperty *vtkNotUsed(property))
void PrintSelf(ostream &os, vtkIndent indent)
virtual void RenderBlock(vtkRenderer *vtkNotUsed(ren), vtkVolume *vtkNotUsed(vol), unsigned int vtkNotUsed(level))
Ray casting performed on the GPU.
static vtkGPUVolumeRayCastMapper * New()
virtual void PreRender(vtkRenderer *vtkNotUsed(ren), vtkVolume *vtkNotUsed(vol), double vtkNotUsed(datasetBounds)[6], double vtkNotUsed(scalarRange)[2], int vtkNotUsed(numberOfScalarComponents), unsigned int vtkNotUsed(numberOfLevels))