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 "vtkRenderingVolumeModule.h" // For export macro
85 #include "vtkVolumeMapper.h"
86 
87 class vtkImageData;
90 class vtkVolumeProperty;
91 
93 {
94 public:
96  void PrintSelf(ostream& os, vtkIndent indent);
97 
98  static vtkVolumeTextureMapper3D *New();
99 
101 
104  vtkSetMacro( SampleDistance, float );
105  vtkGetMacro( SampleDistance, float );
107 
109 
110  vtkGetVectorMacro( VolumeDimensions, int, 3 );
112 
114 
115  vtkGetVectorMacro( VolumeSpacing, float, 3 );
117 
119 
124  vtkRenderer *vtkNotUsed(r))
125  {return 0;}
127 
129 
130  vtkGetMacro( NumberOfPolygons, int );
132 
134 
135  vtkGetMacro( ActualSampleDistance, float );
137 
138 //BTX
139 
142  virtual void Render(vtkRenderer *, vtkVolume *) {}
143 
145 
146  enum
147  {
148  FRAGMENT_PROGRAM_METHOD=0,
149  NVIDIA_METHOD=1,
150  ATI_METHOD=2,
151  NO_METHOD=3
152  };
154 
156 
157  int GetNumberOfScalarComponents(vtkImageData *input);
158 //ETX
160 
162 
164  vtkSetClampMacro( PreferredRenderMethod, int,
168  { this->SetPreferredRenderMethod( vtkVolumeTextureMapper3D::FRAGMENT_PROGRAM_METHOD ); }
170  { this->SetPreferredRenderMethod( vtkVolumeTextureMapper3D::NVIDIA_METHOD ); }
171  vtkGetMacro(PreferredRenderMethod, int);
173 
174 
176 
181  vtkSetMacro(UseCompressedTexture,bool);
182  vtkGetMacro(UseCompressedTexture,bool);
184 
185 protected:
188 
193 
194  unsigned char *Volume1;
195  unsigned char *Volume2;
196  unsigned char *Volume3;
199  int VolumeDimensions[3];
200  float VolumeSpacing[3];
201 
204 
207 
215 
216  unsigned char ColorLookup[65536*4];
217  unsigned char AlphaLookup[65536];
218  float TempArray1[3*4096];
219  float TempArray2[4096];
223 
224  unsigned char DiffuseLookup[65536*4];
225  unsigned char SpecularLookup[65536*4];
226 
229 
233 
235 
237  void ComputePolygons( vtkRenderer *ren, vtkVolume *vol, double bounds[6] );
238 
240 
242  int UpdateVolumes( vtkVolume * );
243  int UpdateColorLookup( vtkVolume * );
245 
247 
248  virtual int IsTextureSizeSupported(int vtkNotUsed(size)[3],
249  int vtkNotUsed(components))
250  {
251  return 0;
252  }
253  //ETX
255 
256 private:
257  vtkVolumeTextureMapper3D(const vtkVolumeTextureMapper3D&); // Not implemented.
258  void operator=(const vtkVolumeTextureMapper3D&); // Not implemented.
259 };
260 
261 
262 #endif
263 
264 
265 
266 
267 
268 
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:49
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)
vtkColorTransferFunction * SavedRGBFunction
#define VTKRENDERINGVOLUME_EXPORT
record modification and/or execution time
Definition: vtkTimeStamp.h:34
virtual int IsRenderSupported(vtkVolumeProperty *, vtkRenderer *vtkNotUsed(r))
abstract specification for renderers
Definition: vtkRenderer.h:63
virtual void Render(vtkRenderer *, vtkVolume *)
vtkPiecewiseFunction * SavedGradientOpacityFunction
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
represents the common properties for rendering a volume.
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))
static vtkAlgorithm * New()