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 =========================================================================*/
28 #ifndef vtkOpenGLVolumeTextureMapper3D_h
29 #define vtkOpenGLVolumeTextureMapper3D_h
30 
31 #include "vtkRenderingVolumeOpenGLModule.h" // For export macro
33 #include "vtkOpenGL.h" // GLfloat type is used in some method signatures.
34 
35 class vtkRenderWindow;
36 class vtkVolumeProperty;
37 
38 #if !defined(VTK_LEGACY_REMOVE)
39 class VTKRENDERINGVOLUMEOPENGL_EXPORT vtkOpenGLVolumeTextureMapper3D
41 {
42 public:
44  void PrintSelf(ostream& os, vtkIndent indent);
45 
47 
54  vtkRenderer *ren);
55 
61  virtual void Render(vtkRenderer *ren, vtkVolume *vol);
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 
75 
76 protected:
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 
89  GLuint Volume1Index;
90  GLuint Volume2Index;
91  GLuint Volume3Index;
95 
98 
99  // Actual internal texture format (uncompressed vs compressed)
100  // Computed in Render()
101  int InternalAlpha; // GLint
102  int InternalLA; // GLint
103  int InternalRGB; // GLint
104  int InternalRGBA; // GLint
105 
106  void Initialize(vtkRenderer *r);
107 
108  virtual void RenderNV(vtkRenderer *ren, vtkVolume *vol);
109  virtual void RenderFP(vtkRenderer *ren, vtkVolume *vol);
110 
111  void RenderOneIndependentNoShadeFP( vtkRenderer *ren,
112  vtkVolume *vol );
113  void RenderOneIndependentShadeFP( vtkRenderer *ren, vtkVolume *vol );
114  void RenderTwoDependentNoShadeFP( vtkRenderer *ren, vtkVolume *vol );
115  void RenderTwoDependentShadeFP( vtkRenderer *ren, vtkVolume *vol );
116  void RenderFourDependentNoShadeFP( vtkRenderer *ren, vtkVolume *vol );
117  void RenderFourDependentShadeFP( vtkRenderer *ren, vtkVolume *vol );
118 
119  void RenderOneIndependentNoShadeNV( vtkRenderer *ren, vtkVolume *vol );
120  void RenderOneIndependentShadeNV( vtkRenderer *ren, vtkVolume *vol );
121  void RenderTwoDependentNoShadeNV( vtkRenderer *ren, vtkVolume *vol );
122  void RenderTwoDependentShadeNV( vtkRenderer *ren, vtkVolume *vol );
123  void RenderFourDependentNoShadeNV( vtkRenderer *ren, vtkVolume *vol );
124  void RenderFourDependentShadeNV( vtkRenderer *ren, vtkVolume *vol );
125 
126  void SetupOneIndependentTextures( vtkRenderer *ren, vtkVolume *vol );
127  void SetupTwoDependentTextures( vtkRenderer *ren, vtkVolume *vol );
128  void SetupFourDependentTextures( vtkRenderer *ren, vtkVolume *vol );
129 
130  void SetupRegisterCombinersNoShadeNV( vtkRenderer *ren,
131  vtkVolume *vol,
132  int components );
133 
134  void SetupRegisterCombinersShadeNV( vtkRenderer *ren,
135  vtkVolume *vol,
136  int components );
137 
138  void DeleteTextureIndex( GLuint *index );
139  void CreateTextureIndex( GLuint *index );
140 
141  void RenderPolygons( vtkRenderer *ren,
142  vtkVolume *vol,
143  int stages[4] );
144 
145  void SetupProgramLocalsForShadingFP( vtkRenderer *ren, vtkVolume *vol );
146 
150  int IsTextureSizeSupported(int size[3],
151  int components);
152 
156  void Setup3DTextureParameters( vtkVolumeProperty *property );
157 
158 private:
160  void operator=(const vtkOpenGLVolumeTextureMapper3D&) VTK_DELETE_FUNCTION;
161 };
162 #endif // VTK_LEGACY_REMOVE
163 #endif
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:50
volume render with 3D texture mapping
virtual int IsRenderSupported(vtkVolumeProperty *, vtkRenderer *vtkNotUsed(r))
Based on hardware and properties, we may or may not be able to render using 3D texture mapping...
abstract specification for renderers
Definition: vtkRenderer.h:63
virtual void Render(vtkRenderer *, vtkVolume *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
concrete implementation of 3D volume texture mapping
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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))
Impemented in subclass - check is texture size is OK.
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
static vtkVolumeTextureMapper3D * New()