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 
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  };
152 //ETX
154 
156 
158  vtkSetClampMacro( PreferredRenderMethod, int,
162  { this->SetPreferredRenderMethod( vtkVolumeTextureMapper3D::FRAGMENT_PROGRAM_METHOD ); }
164  { this->SetPreferredRenderMethod( vtkVolumeTextureMapper3D::NVIDIA_METHOD ); }
165  vtkGetMacro(PreferredRenderMethod, int);
167 
168 
170 
175  vtkSetMacro(UseCompressedTexture,bool);
176  vtkGetMacro(UseCompressedTexture,bool);
178 
179 protected:
182 
187 
188  unsigned char *Volume1;
189  unsigned char *Volume2;
190  unsigned char *Volume3;
193  int VolumeDimensions[3];
194  float VolumeSpacing[3];
195 
198 
201 
209 
210  unsigned char ColorLookup[65536*4];
211  unsigned char AlphaLookup[65536];
212  float TempArray1[3*4096];
213  float TempArray2[4096];
217 
218  unsigned char DiffuseLookup[65536*4];
219  unsigned char SpecularLookup[65536*4];
220 
223 
227 
229 
231  void ComputePolygons( vtkRenderer *ren, vtkVolume *vol, double bounds[6] );
232 
234 
236  int UpdateVolumes( vtkVolume * );
237  int UpdateColorLookup( vtkVolume * );
239 
241 
242  virtual int IsTextureSizeSupported(int vtkNotUsed(size)[3],
243  int vtkNotUsed(components))
244  {
245  return 0;
246  }
247  //ETX
249 
250 private:
251  vtkVolumeTextureMapper3D(const vtkVolumeTextureMapper3D&); // Not implemented.
252  void operator=(const vtkVolumeTextureMapper3D&); // Not implemented.
253 };
254 
255 
256 #endif
257 
258 
259 
260 
261 
262