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 =========================================================================*/
83 #ifndef vtkVolumeTextureMapper3D_h
84 #define vtkVolumeTextureMapper3D_h
85 
86 #include "vtkRenderingVolumeModule.h" // For export macro
87 #include "vtkVolumeMapper.h"
88 
89 class vtkImageData;
92 class vtkVolumeProperty;
93 #if !defined(VTK_LEGACY_REMOVE)
94 class VTKRENDERINGVOLUME_EXPORT vtkVolumeTextureMapper3D : public vtkVolumeMapper
95 {
96 public:
98  void PrintSelf(ostream& os, vtkIndent indent);
99 
100  static vtkVolumeTextureMapper3D *New();
101 
103 
109  vtkSetMacro( SampleDistance, float );
110  vtkGetMacro( SampleDistance, float );
112 
114 
117  vtkGetVectorMacro( VolumeDimensions, int, 3 );
119 
121 
124  vtkGetVectorMacro( VolumeSpacing, float, 3 );
126 
134  vtkRenderer *vtkNotUsed(r))
135  {return 0;}
136 
138 
142  vtkGetMacro( NumberOfPolygons, int );
144 
146 
150  vtkGetMacro( ActualSampleDistance, float );
152 
158  virtual void Render(vtkRenderer *, vtkVolume *) {}
159 
163  enum
164  {
165  FRAGMENT_PROGRAM_METHOD=0,
166  NVIDIA_METHOD=1,
167  ATI_METHOD=2,
168  NO_METHOD=3
169  };
170 
174  int GetNumberOfScalarComponents(vtkImageData *input);
175 
177 
182  vtkSetClampMacro( PreferredRenderMethod, int,
186  { this->SetPreferredRenderMethod( vtkVolumeTextureMapper3D::FRAGMENT_PROGRAM_METHOD ); }
188  { this->SetPreferredRenderMethod( vtkVolumeTextureMapper3D::NVIDIA_METHOD ); }
189  vtkGetMacro(PreferredRenderMethod, int);
191 
192 
194 
202  vtkSetMacro(UseCompressedTexture,bool);
203  vtkGetMacro(UseCompressedTexture,bool);
205 
206 protected:
209 
214 
215  unsigned char *Volume1;
216  unsigned char *Volume2;
217  unsigned char *Volume3;
220  int VolumeDimensions[3];
221  float VolumeSpacing[3];
222 
225 
228 
236 
237  unsigned char ColorLookup[65536*4];
238  unsigned char AlphaLookup[65536];
239  float TempArray1[3*4096];
240  float TempArray2[4096];
244 
245  unsigned char DiffuseLookup[65536*4];
246  unsigned char SpecularLookup[65536*4];
247 
250 
254 
256 
260  void ComputePolygons( vtkRenderer *ren, vtkVolume *vol, double bounds[6] );
261 
263 
267  int UpdateVolumes( vtkVolume * );
268  int UpdateColorLookup( vtkVolume * );
270 
275  virtual int IsTextureSizeSupported(int vtkNotUsed(size)[3],
276  int vtkNotUsed(components))
277  {
278  return 0;
279  }
280 
281 private:
282  vtkVolumeTextureMapper3D(const vtkVolumeTextureMapper3D&) VTK_DELETE_FUNCTION;
283  void operator=(const vtkVolumeTextureMapper3D&) VTK_DELETE_FUNCTION;
284 };
285 
286 #endif // VTK_LEGACY_REMOVE
287 #endif
288 
289 
290 
291 
292 
293 
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:50
Abstract class for a volume mapper.
volume render with 3D texture mapping
vtkPiecewiseFunction * SavedScalarOpacityFunction
Defines a 1D piecewise function.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkColorTransferFunction * SavedRGBFunction
record modification and/or execution time
Definition: vtkTimeStamp.h:35
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...
void SetPreferredMethodToFragmentProgram()
Set the preferred render method.
vtkPiecewiseFunction * SavedGradientOpacityFunction
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
represents the common properties for rendering a volume.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkPiecewiseFunction * SavedGrayFunction
Defines a transfer function for mapping a property to an RGB color value.
virtual int IsTextureSizeSupported(int vtkNotUsed(size)[3], int vtkNotUsed(components))
Impemented in subclass - check is texture size is OK.
static vtkAlgorithm * New()
void SetPreferredMethodToNVidia()
Set the preferred render method.