VTK
vtkVolumeTextureMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkVolumeTextureMapper.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 =========================================================================*/
27 #ifndef vtkVolumeTextureMapper_h
28 #define vtkVolumeTextureMapper_h
29 
30 #include "vtkRenderingVolumeModule.h" // For export macro
31 #include "vtkVolumeMapper.h"
32 
35 class vtkRenderWindow;
36 class vtkRenderer;
37 class vtkVolume;
38 
39 class VTKRENDERINGVOLUME_EXPORT vtkVolumeTextureMapper : public vtkVolumeMapper
40 {
41 public:
43  void PrintSelf( ostream& os, vtkIndent indent );
44 
46 
49  virtual void SetGradientEstimator( vtkEncodedGradientEstimator *gradest );
50  vtkGetObjectMacro( GradientEstimator, vtkEncodedGradientEstimator );
52 
54 
57  vtkGetObjectMacro( GradientShader, vtkEncodedGradientShader );
59 
61 
65  float *GetGradientOpacityArray(){return this->GradientOpacityArray;};
66  unsigned char *GetRGBAArray(){return this->RGBAArray;};
67  float *GetRedDiffuseShadingTable(){return this->RedDiffuseShadingTable;};
68  float *GetGreenDiffuseShadingTable(){return this->GreenDiffuseShadingTable;};
69  float *GetBlueDiffuseShadingTable(){return this->BlueDiffuseShadingTable;};
70  float *GetRedSpecularShadingTable(){return this->RedSpecularShadingTable;};
71  float *GetGreenSpecularShadingTable(){return this->GreenSpecularShadingTable;};
72  float *GetBlueSpecularShadingTable(){return this->BlueSpecularShadingTable;};
73  unsigned short *GetEncodedNormals(){return this->EncodedNormals;};
74  unsigned char *GetGradientMagnitudes(){return this->GradientMagnitudes;};
75  vtkGetMacro( Shade, int );
76  vtkGetObjectMacro( RenderWindow, vtkRenderWindow );
77  vtkGetVectorMacro( DataOrigin, double, 3 );
78  vtkGetVectorMacro( DataSpacing, double, 3 );
80 
86  virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0;
87 
89 
93  virtual float GetGradientMagnitudeScale();
94  virtual float GetGradientMagnitudeBias();
95  virtual float GetGradientMagnitudeScale(int)
96  { return this->GetGradientMagnitudeScale(); };
97  virtual float GetGradientMagnitudeBias(int)
98  { return this->GetGradientMagnitudeBias(); };
100 
104  virtual int ProcessRequest(vtkInformation*,
107 
108 protected:
111 
112  void InitializeRender( vtkRenderer *ren, vtkVolume *vol );
113 
114  void ReportReferences(vtkGarbageCollector*) VTK_OVERRIDE;
115 
116  // Objects / variables needed for shading / gradient magnitude opacity
119  int Shade;
120 
122  unsigned char *RGBAArray;
125 
132 
133  double DataOrigin[3];
134  double DataSpacing[3];
135 
136  unsigned short *EncodedNormals;
137  unsigned char *GradientMagnitudes;
138 
140 
142 private:
143  vtkVolumeTextureMapper(const vtkVolumeTextureMapper&) VTK_DELETE_FUNCTION;
144  void operator=(const vtkVolumeTextureMapper&) VTK_DELETE_FUNCTION;
145 };
146 
147 
148 #endif
149 
150 
vtkVolumeTextureMapper::GetGreenSpecularShadingTable
float * GetGreenSpecularShadingTable()
Definition: vtkVolumeTextureMapper.h:71
vtkVolumeTextureMapper::RedSpecularShadingTable
float * RedSpecularShadingTable
Definition: vtkVolumeTextureMapper.h:129
vtkVolumeMapper
Abstract class for a volume mapper.
Definition: vtkVolumeMapper.h:49
vtkVolumeTextureMapper::GetGradientOpacityArray
float * GetGradientOpacityArray()
Allow access to the arrays / variables from the templated functions in the subclasses.
Definition: vtkVolumeTextureMapper.h:65
vtkVolumeTextureMapper::EncodedNormals
unsigned short * EncodedNormals
Definition: vtkVolumeTextureMapper.h:136
vtkVolume
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:50
vtkVolumeTextureMapper::GetGradientMagnitudeScale
virtual float GetGradientMagnitudeScale(int)
Definition: vtkVolumeTextureMapper.h:95
vtkVolumeTextureMapper::GradientMagnitudes
unsigned char * GradientMagnitudes
Definition: vtkVolumeTextureMapper.h:137
vtkVolumeTextureMapper::RenderWindow
vtkRenderWindow * RenderWindow
Definition: vtkVolumeTextureMapper.h:141
vtkVolumeTextureMapper::GetEncodedNormals
unsigned short * GetEncodedNormals()
Definition: vtkVolumeTextureMapper.h:73
vtkVolumeTextureMapper::RedDiffuseShadingTable
float * RedDiffuseShadingTable
Definition: vtkVolumeTextureMapper.h:126
vtkVolumeMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkVolumeTextureMapper::SampleDistance
float SampleDistance
Definition: vtkVolumeTextureMapper.h:139
vtkVolumeTextureMapper::ArraySize
int ArraySize
Definition: vtkVolumeTextureMapper.h:123
vtkVolumeTextureMapper::GetBlueDiffuseShadingTable
float * GetBlueDiffuseShadingTable()
Definition: vtkVolumeTextureMapper.h:69
vtkAbstractVolumeMapper::GetGradientMagnitudeScale
virtual float GetGradientMagnitudeScale()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE.
Definition: vtkAbstractVolumeMapper.h:115
vtkVolumeTextureMapper::GreenDiffuseShadingTable
float * GreenDiffuseShadingTable
Definition: vtkVolumeTextureMapper.h:127
vtkVolumeTextureMapper::NumberOfComponents
int NumberOfComponents
Definition: vtkVolumeTextureMapper.h:124
vtkEncodedGradientShader
Compute shading tables for encoded normals.
Definition: vtkEncodedGradientShader.h:45
vtkVolumeTextureMapper::GradientEstimator
vtkEncodedGradientEstimator * GradientEstimator
Definition: vtkVolumeTextureMapper.h:117
vtkEncodedGradientEstimator
Superclass for gradient estimation.
Definition: vtkEncodedGradientEstimator.h:44
vtkVolumeTextureMapper::Shade
int Shade
Definition: vtkVolumeTextureMapper.h:119
vtkVolumeTextureMapper::RGBAArray
unsigned char * RGBAArray
Definition: vtkVolumeTextureMapper.h:122
vtkVolumeMapper.h
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkVolumeMapper::Render
virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
vtkVolumeTextureMapper::GetRedSpecularShadingTable
float * GetRedSpecularShadingTable()
Definition: vtkVolumeTextureMapper.h:70
vtkVolumeTextureMapper
Abstract class for a volume mapper.
Definition: vtkVolumeTextureMapper.h:39
vtkVolumeTextureMapper::GetRedDiffuseShadingTable
float * GetRedDiffuseShadingTable()
Definition: vtkVolumeTextureMapper.h:67
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:99
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkVolumeTextureMapper::BlueDiffuseShadingTable
float * BlueDiffuseShadingTable
Definition: vtkVolumeTextureMapper.h:128
vtkAlgorithm::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
vtkAlgorithm::ProcessRequest
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
vtkVolumeTextureMapper::GetGreenDiffuseShadingTable
float * GetGreenDiffuseShadingTable()
Definition: vtkVolumeTextureMapper.h:68
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkVolumeTextureMapper::GetRGBAArray
unsigned char * GetRGBAArray()
Definition: vtkVolumeTextureMapper.h:66
vtkVolumeTextureMapper::GetGradientMagnitudeBias
virtual float GetGradientMagnitudeBias(int)
Definition: vtkVolumeTextureMapper.h:97
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:86
vtkAbstractVolumeMapper::GetGradientMagnitudeBias
virtual float GetGradientMagnitudeBias()
Definition: vtkAbstractVolumeMapper.h:116
vtkVolumeTextureMapper::BlueSpecularShadingTable
float * BlueSpecularShadingTable
Definition: vtkVolumeTextureMapper.h:131
vtkVolumeTextureMapper::GetBlueSpecularShadingTable
float * GetBlueSpecularShadingTable()
Definition: vtkVolumeTextureMapper.h:72
vtkVolumeTextureMapper::GradientOpacityArray
float * GradientOpacityArray
Definition: vtkVolumeTextureMapper.h:121
vtkVolumeTextureMapper::GreenSpecularShadingTable
float * GreenSpecularShadingTable
Definition: vtkVolumeTextureMapper.h:130
vtkVolumeTextureMapper::GetGradientMagnitudes
unsigned char * GetGradientMagnitudes()
Definition: vtkVolumeTextureMapper.h:74
vtkVolumeTextureMapper::GradientShader
vtkEncodedGradientShader * GradientShader
Definition: vtkVolumeTextureMapper.h:118