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 
29 #include "vtkRenderingVolumeOpenGLModule.h" // For export macro
31 #include "vtkOpenGL.h" // GLfloat type is used in some method signatures.
32 
33 class vtkRenderWindow;
34 class vtkVolumeProperty;
35 
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent);
42 
44 
46 
50  vtkRenderer *ren);
52 
53 //BTX
54 
57  virtual void Render(vtkRenderer *ren, vtkVolume *vol);
58 
59 //ETX
60 
61  // Desciption:
62  // Initialize when we go to render, or go to answer the
63  // IsRenderSupported question. Don't call unless we have
64  // a valid OpenGL context!
65  vtkGetMacro( Initialized, int );
66 
71 
72 protected:
75 
76 //BTX
77 
78  void GetLightInformation(vtkRenderer *ren,
79  vtkVolume *vol,
80  GLfloat lightDirection[2][4],
81  GLfloat lightDiffuseColor[2][4],
82  GLfloat lightSpecularColor[2][4],
83  GLfloat halfwayVector[2][4],
84  GLfloat *ambient );
85 //ETX
86 
88  GLuint Volume1Index;
89  GLuint Volume2Index;
90  GLuint Volume3Index;
94 
97 
98  // Actual internal texture format (uncompressed vs compressed)
99  // Computed in Render()
100  int InternalAlpha; // GLint
101  int InternalLA; // GLint
102  int InternalRGB; // GLint
103  int InternalRGBA; // GLint
104 
105  void Initialize(vtkRenderer *r);
106 
107  virtual void RenderNV(vtkRenderer *ren, vtkVolume *vol);
108  virtual void RenderFP(vtkRenderer *ren, vtkVolume *vol);
109 
110  void RenderOneIndependentNoShadeFP( vtkRenderer *ren,
111  vtkVolume *vol );
112  void RenderOneIndependentShadeFP( vtkRenderer *ren, vtkVolume *vol );
113  void RenderTwoDependentNoShadeFP( vtkRenderer *ren, vtkVolume *vol );
114  void RenderTwoDependentShadeFP( vtkRenderer *ren, vtkVolume *vol );
115  void RenderFourDependentNoShadeFP( vtkRenderer *ren, vtkVolume *vol );
116  void RenderFourDependentShadeFP( vtkRenderer *ren, vtkVolume *vol );
117 
118  void RenderOneIndependentNoShadeNV( vtkRenderer *ren, vtkVolume *vol );
119  void RenderOneIndependentShadeNV( vtkRenderer *ren, vtkVolume *vol );
120  void RenderTwoDependentNoShadeNV( vtkRenderer *ren, vtkVolume *vol );
121  void RenderTwoDependentShadeNV( vtkRenderer *ren, vtkVolume *vol );
122  void RenderFourDependentNoShadeNV( vtkRenderer *ren, vtkVolume *vol );
123  void RenderFourDependentShadeNV( vtkRenderer *ren, vtkVolume *vol );
124 
125  void SetupOneIndependentTextures( vtkRenderer *ren, vtkVolume *vol );
126  void SetupTwoDependentTextures( vtkRenderer *ren, vtkVolume *vol );
127  void SetupFourDependentTextures( vtkRenderer *ren, vtkVolume *vol );
128 
129  void SetupRegisterCombinersNoShadeNV( vtkRenderer *ren,
130  vtkVolume *vol,
131  int components );
132 
133  void SetupRegisterCombinersShadeNV( vtkRenderer *ren,
134  vtkVolume *vol,
135  int components );
136 
137  void DeleteTextureIndex( GLuint *index );
138  void CreateTextureIndex( GLuint *index );
139 
140  void RenderPolygons( vtkRenderer *ren,
141  vtkVolume *vol,
142  int stages[4] );
143 
144  void SetupProgramLocalsForShadingFP( vtkRenderer *ren, vtkVolume *vol );
145 
147 
149  int IsTextureSizeSupported(int size[3],
150  int components);
152 
154  void Setup3DTextureParameters( vtkVolumeProperty *property );
155 
156 private:
158  void operator=(const vtkOpenGLVolumeTextureMapper3D&); // Not implemented.
159 };
160 
161 #endif
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:49
#define VTKRENDERINGVOLUMEOPENGL_EXPORT
volume render with 3D texture mapping
virtual int IsRenderSupported(vtkVolumeProperty *, vtkRenderer *vtkNotUsed(r))
abstract specification for renderers
Definition: vtkRenderer.h:63
virtual void Render(vtkRenderer *, vtkVolume *)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
a simple class to control print indentation
Definition: vtkIndent.h:38
concrete implementation of 3D volume texture mapping
void PrintSelf(ostream &os, vtkIndent indent)
represents the common properties for rendering a volume.
create a window for renderers to draw into
virtual int IsTextureSizeSupported(int vtkNotUsed(size)[3], int vtkNotUsed(components))
virtual void ReleaseGraphicsResources(vtkWindow *)
static vtkVolumeTextureMapper3D * New()