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
117  vtkEncodedGradientEstimator *GradientEstimator;
118  vtkEncodedGradientShader *GradientShader;
119  int Shade;
120 
121  float *GradientOpacityArray;
122  unsigned char *RGBAArray;
123  int ArraySize;
124  int NumberOfComponents;
125 
126  float *RedDiffuseShadingTable;
127  float *GreenDiffuseShadingTable;
128  float *BlueDiffuseShadingTable;
129  float *RedSpecularShadingTable;
130  float *GreenSpecularShadingTable;
131  float *BlueSpecularShadingTable;
132 
133  double DataOrigin[3];
134  double DataSpacing[3];
135 
136  unsigned short *EncodedNormals;
137  unsigned char *GradientMagnitudes;
138 
139  float SampleDistance;
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 
unsigned char * GetGradientMagnitudes()
Allow access to the arrays / variables from the templated functions in the subclasses.
unsigned short * GetEncodedNormals()
Allow access to the arrays / variables from the templated functions in the subclasses.
float * GetGreenSpecularShadingTable()
Allow access to the arrays / variables from the templated functions in the subclasses.
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:50
float * GetBlueDiffuseShadingTable()
Allow access to the arrays / variables from the templated functions in the subclasses.
Abstract class for a volume mapper.
Store vtkAlgorithm input/output information.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual float GetGradientMagnitudeBias(int)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Values needed by the volume.
void ReportReferences(vtkGarbageCollector *) override
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
Abstract class for a volume mapper.
abstract specification for renderers
Definition: vtkRenderer.h:63
Detect and break reference loops.
virtual float GetGradientMagnitudeScale()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE.
a simple class to control print indentation
Definition: vtkIndent.h:39
float * GetGreenDiffuseShadingTable()
Allow access to the arrays / variables from the templated functions in the subclasses.
Superclass for gradient estimation.
Compute shading tables for encoded normals.
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...
float * GetRedDiffuseShadingTable()
Allow access to the arrays / variables from the templated functions in the subclasses.
vtkWeakPointer< vtkRenderWindow > RenderWindow
unsigned char * GetRGBAArray()
Allow access to the arrays / variables from the templated functions in the subclasses.
float * GetGradientOpacityArray()
Allow access to the arrays / variables from the templated functions in the subclasses.
create a window for renderers to draw into
virtual float GetGradientMagnitudeScale(int)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Values needed by the volume.
Store zero or more vtkInformation instances.
float * GetBlueSpecularShadingTable()
Allow access to the arrays / variables from the templated functions in the subclasses.
float * GetRedSpecularShadingTable()
Allow access to the arrays / variables from the templated functions in the subclasses.
virtual float GetGradientMagnitudeBias()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE.