VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkOpenGLGPUVolumeRayCastMapper.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 00016 #ifndef vtkOpenGLGPUVolumeRayCastMapper_h 00017 #define vtkOpenGLGPUVolumeRayCastMapper_h 00018 00019 #include "vtkRenderingVolumeOpenGLNewModule.h" // For export macro 00020 00021 #include <vtkGPUVolumeRayCastMapper.h> 00022 00023 //---------------------------------------------------------------------------- 00024 class VTKRENDERINGVOLUMEOPENGLNEW_EXPORT vtkOpenGLGPUVolumeRayCastMapper : 00025 public vtkGPUVolumeRayCastMapper 00026 { 00027 public: 00028 static vtkOpenGLGPUVolumeRayCastMapper* New(); 00029 00030 vtkTypeMacro(vtkOpenGLGPUVolumeRayCastMapper, vtkGPUVolumeRayCastMapper); 00031 void PrintSelf( ostream& os, vtkIndent indent ); 00032 00033 protected: 00034 vtkOpenGLGPUVolumeRayCastMapper(); 00035 ~vtkOpenGLGPUVolumeRayCastMapper(); 00036 00037 // Description: 00038 // Delete OpenGL objects. 00039 // \post done: this->OpenGLObjectsCreated==0 00040 virtual void ReleaseGraphicsResources(vtkWindow *window); 00041 00042 // Description: 00043 // Build vertex and fragment shader for the volume rendering 00044 void BuildShader(vtkRenderer* ren, vtkVolume* vol, int noOfComponents); 00045 00046 // Description: 00047 // Rendering volume on GPU 00048 void GPURender(vtkRenderer *ren, vtkVolume *vol); 00049 00050 // Description: 00051 // Not implemented 00052 virtual void PreRender(vtkRenderer* vtkNotUsed(ren), 00053 vtkVolume* vtkNotUsed(vol), 00054 double vtkNotUsed(datasetBounds)[6], 00055 double vtkNotUsed(scalarRange)[2], 00056 int vtkNotUsed(numberOfScalarComponents), 00057 unsigned int vtkNotUsed(numberOfLevels)) {}; 00058 00059 // Description: 00060 // Empty implementation. 00061 virtual void RenderBlock(vtkRenderer* vtkNotUsed(ren), 00062 vtkVolume* vtkNotUsed(vol), 00063 unsigned int vtkNotUsed(level)) {}; 00064 00065 // Description: 00066 // Empty implementation. 00067 virtual void PostRender(vtkRenderer* vtkNotUsed(ren), 00068 int vtkNotUsed(umberOfScalarComponents)) {}; 00069 00070 // Description: 00071 // Empty implementation. 00072 void GetReductionRatio(double* ratio) 00073 { 00074 ratio[0] = ratio[1] = ratio[2] = 1.0; 00075 } 00076 00077 // Description: 00078 // Empty implementation. 00079 virtual int IsRenderSupported(vtkRenderWindow *vtkNotUsed(window), 00080 vtkVolumeProperty *vtkNotUsed(property)) 00081 { 00082 return 1; 00083 } 00084 00085 private: 00086 class vtkInternal; 00087 vtkInternal* Impl; 00088 00089 vtkOpenGLGPUVolumeRayCastMapper( 00090 const vtkOpenGLGPUVolumeRayCastMapper&); // Not implemented. 00091 void operator=(const vtkOpenGLGPUVolumeRayCastMapper&); // Not implemented. 00092 }; 00093 00094 #endif // vtkOpenGLGPUVolumeRayCastMapper_h