VTK
vtkOpenGLVolumeTextureMapper3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLVolumeTextureMapper3D.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 =========================================================================*/
26 #ifndef __vtkOpenGLVolumeTextureMapper3D_h
27 #define __vtkOpenGLVolumeTextureMapper3D_h
28 
30 
31 #ifndef VTK_IMPLEMENT_MESA_CXX
32 # include "vtkOpenGL.h" // GLfloat type is used in some method signatures.
33 #endif
34 
35 
36 class vtkRenderWindow;
37 class vtkVolumeProperty;
38 
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
46 
48 
52  vtkRenderer *ren);
54 
55 //BTX
56 
59  virtual void Render(vtkRenderer *ren, vtkVolume *vol);
60 
61 //ETX
62 
63  // Desciption:
64  // Initialize when we go to render, or go to answer the
65  // IsRenderSupported question. Don't call unless we have
66  // a valid OpenGL context!
67  vtkGetMacro( Initialized, int );
68 
73 
74 protected:
77 
78 //BTX
79 
80  void GetLightInformation(vtkRenderer *ren,
81  vtkVolume *vol,
82  GLfloat lightDirection[2][4],
83  GLfloat lightDiffuseColor[2][4],
84  GLfloat lightSpecularColor[2][4],
85  GLfloat halfwayVector[2][4],
86  GLfloat *ambient );
87 //ETX
88 
90  GLuint Volume1Index;
91  GLuint Volume2Index;
92  GLuint Volume3Index;
96 
99 
100  // Actual internal texture format (uncompressed vs compressed)
101  // Computed in Render()
102  int InternalAlpha; // GLint
103  int InternalLA; // GLint
104  int InternalRGB; // GLint
105  int InternalRGBA; // GLint
106 
107  void Initialize(vtkRenderer *r);
108 
109  virtual void RenderNV(vtkRenderer *ren, vtkVolume *vol);
110  virtual void RenderFP(vtkRenderer *ren, vtkVolume *vol);
111 
112  void RenderOneIndependentNoShadeFP( vtkRenderer *ren,
113  vtkVolume *vol );
114  void RenderOneIndependentShadeFP( vtkRenderer *ren, vtkVolume *vol );
115  void RenderTwoDependentNoShadeFP( vtkRenderer *ren, vtkVolume *vol );
116  void RenderTwoDependentShadeFP( vtkRenderer *ren, vtkVolume *vol );
117  void RenderFourDependentNoShadeFP( vtkRenderer *ren, vtkVolume *vol );
118  void RenderFourDependentShadeFP( vtkRenderer *ren, vtkVolume *vol );
119 
120  void RenderOneIndependentNoShadeNV( vtkRenderer *ren, vtkVolume *vol );
121  void RenderOneIndependentShadeNV( vtkRenderer *ren, vtkVolume *vol );
122  void RenderTwoDependentNoShadeNV( vtkRenderer *ren, vtkVolume *vol );
123  void RenderTwoDependentShadeNV( vtkRenderer *ren, vtkVolume *vol );
124  void RenderFourDependentNoShadeNV( vtkRenderer *ren, vtkVolume *vol );
125  void RenderFourDependentShadeNV( vtkRenderer *ren, vtkVolume *vol );
126 
127  void SetupOneIndependentTextures( vtkRenderer *ren, vtkVolume *vol );
128  void SetupTwoDependentTextures( vtkRenderer *ren, vtkVolume *vol );
129  void SetupFourDependentTextures( vtkRenderer *ren, vtkVolume *vol );
130 
131  void SetupRegisterCombinersNoShadeNV( vtkRenderer *ren,
132  vtkVolume *vol,
133  int components );
134 
135  void SetupRegisterCombinersShadeNV( vtkRenderer *ren,
136  vtkVolume *vol,
137  int components );
138 
139  void DeleteTextureIndex( GLuint *index );
140  void CreateTextureIndex( GLuint *index );
141 
142  void RenderPolygons( vtkRenderer *ren,
143  vtkVolume *vol,
144  int stages[4] );
145 
146  void SetupProgramLocalsForShadingFP( vtkRenderer *ren, vtkVolume *vol );
147 
149 
151  int IsTextureSizeSupported(int size[3],
152  int components);
154 
156  void Setup3DTextureParameters( vtkVolumeProperty *property );
157 
158 private:
160  void operator=(const vtkOpenGLVolumeTextureMapper3D&); // Not implemented.
161 };
162 
163 
164 #endif
165 
166 
167