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
89class vtkImageData;
93#if !defined(VTK_LEGACY_REMOVE)
94class VTKRENDERINGVOLUME_EXPORT vtkVolumeTextureMapper3D : public vtkVolumeMapper
95{
96public:
98 void PrintSelf(ostream& os, vtkIndent indent);
99
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
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
206protected:
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
270
275 virtual int IsTextureSizeSupported(int vtkNotUsed(size)[3],
276 int vtkNotUsed(components))
277 {
278 return 0;
279 }
280
281private:
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
Defines a transfer function for mapping a property to an RGB color value.
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
a simple class to control print indentation
Definition: vtkIndent.h:40
Defines a 1D piecewise function.
abstract specification for renderers
Definition: vtkRenderer.h:64
record modification and/or execution time
Definition: vtkTimeStamp.h:36
Abstract class for a volume mapper.
represents the common properties for rendering a volume.
volume render with 3D texture mapping
int UpdateVolumes(vtkVolume *)
Update the internal RGBA representation of the volume.
virtual void Render(vtkRenderer *, vtkVolume *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
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.
virtual int IsTextureSizeSupported(int vtkNotUsed(size)[3], int vtkNotUsed(components))
Impemented in subclass - check is texture size is OK.
int GetNumberOfScalarComponents(vtkImageData *input)
Returns the number of components of the point scalar field.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkColorTransferFunction * SavedRGBFunction
int UpdateColorLookup(vtkVolume *)
void ComputePolygons(vtkRenderer *ren, vtkVolume *vol, double bounds[6])
For the given viewing direction, compute the set of polygons.
vtkPiecewiseFunction * SavedGradientOpacityFunction
vtkPiecewiseFunction * SavedGrayFunction
vtkPiecewiseFunction * SavedScalarOpacityFunction
static vtkVolumeTextureMapper3D * New()
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:51
@ size
Definition: vtkX3D.h:253
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.