VTK
vtkVolumeTextureMapper3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkVolumeTextureMapper3D.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 =========================================================================*/
81 #ifndef __vtkVolumeTextureMapper3D_h
82 #define __vtkVolumeTextureMapper3D_h
83 
84 #include "vtkVolumeMapper.h"
85 
86 class vtkImageData;
89 class vtkVolumeProperty;
90 
92 {
93 public:
95  void PrintSelf(ostream& os, vtkIndent indent);
96 
97  static vtkVolumeTextureMapper3D *New();
98 
100 
103  vtkSetMacro( SampleDistance, float );
104  vtkGetMacro( SampleDistance, float );
106 
108 
109  vtkGetVectorMacro( VolumeDimensions, int, 3 );
111 
113 
114  vtkGetVectorMacro( VolumeSpacing, float, 3 );
116 
118 
122  virtual int IsRenderSupported( vtkVolumeProperty *,
123  vtkRenderer *vtkNotUsed(r))
124  {return 0;}
126 
128 
129  vtkGetMacro( NumberOfPolygons, int );
131 
133 
134  vtkGetMacro( ActualSampleDistance, float );
136 
137 //BTX
138 
141  virtual void Render(vtkRenderer *, vtkVolume *) {};
142 
144 
145  enum
146  {
147  FRAGMENT_PROGRAM_METHOD=0,
148  NVIDIA_METHOD=1,
149  ATI_METHOD=2,
150  NO_METHOD=3
151  };
153 
155 
156  int GetNumberOfScalarComponents(vtkImageData *input);
157 //ETX
159 
161 
163  vtkSetClampMacro( PreferredRenderMethod, int,
166  void SetPreferredMethodToFragmentProgram()
167  { this->SetPreferredRenderMethod( vtkVolumeTextureMapper3D::FRAGMENT_PROGRAM_METHOD ); }
168  void SetPreferredMethodToNVidia()
169  { this->SetPreferredRenderMethod( vtkVolumeTextureMapper3D::NVIDIA_METHOD ); }
170  vtkGetMacro(PreferredRenderMethod, int);
172 
173 
175 
180  vtkSetMacro(UseCompressedTexture,bool);
181  vtkGetMacro(UseCompressedTexture,bool);
183 
184 protected:
187 
192 
193  unsigned char *Volume1;
194  unsigned char *Volume2;
195  unsigned char *Volume3;
198  int VolumeDimensions[3];
199  float VolumeSpacing[3];
200 
203 
206 
214 
215  unsigned char ColorLookup[65536*4];
216  unsigned char AlphaLookup[65536];
217  float TempArray1[3*4096];
218  float TempArray2[4096];
222 
223  unsigned char DiffuseLookup[65536*4];
224  unsigned char SpecularLookup[65536*4];
225 
228 
232 
234 
236  void ComputePolygons( vtkRenderer *ren, vtkVolume *vol, double bounds[6] );
237 
239 
241  int UpdateVolumes( vtkVolume * );
242  int UpdateColorLookup( vtkVolume * );
244 
246 
247  virtual int IsTextureSizeSupported(int vtkNotUsed(size)[3],
248  int vtkNotUsed(components))
249  {
250  return 0;
251  }
252  //ETX
254 
255 private:
256  vtkVolumeTextureMapper3D(const vtkVolumeTextureMapper3D&); // Not implemented.
257  void operator=(const vtkVolumeTextureMapper3D&); // Not implemented.
258 };
259 
260 
261 #endif
262 
263 
264 
265 
266 
267