VTK
vtkEncodedGradientShader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkEncodedGradientShader.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 =========================================================================*/
15 
33 #ifndef vtkEncodedGradientShader_h
34 #define vtkEncodedGradientShader_h
35 
36 #include "vtkRenderingVolumeModule.h" // For export macro
37 #include "vtkObject.h"
38 
39 class vtkVolume;
40 class vtkRenderer;
42 
43 #define VTK_MAX_SHADING_TABLES 100
44 
45 class VTKRENDERINGVOLUME_EXPORT vtkEncodedGradientShader : public vtkObject
46 {
47 public:
48  static vtkEncodedGradientShader *New();
50 
54  void PrintSelf( ostream& os, vtkIndent indent ) override;
55 
57 
61  vtkSetClampMacro( ZeroNormalDiffuseIntensity, float, 0.0f, 1.0f);
62  vtkGetMacro( ZeroNormalDiffuseIntensity, float );
63  vtkSetClampMacro( ZeroNormalSpecularIntensity, float, 0.0f, 1.0f);
64  vtkGetMacro( ZeroNormalSpecularIntensity, float );
66 
70  void UpdateShadingTable( vtkRenderer *ren, vtkVolume *vol,
72 
74 
77  float *GetRedDiffuseShadingTable( vtkVolume *vol );
78  float *GetGreenDiffuseShadingTable( vtkVolume *vol );
79  float *GetBlueDiffuseShadingTable( vtkVolume *vol );
80  float *GetRedSpecularShadingTable( vtkVolume *vol );
81  float *GetGreenSpecularShadingTable( vtkVolume *vol );
82  float *GetBlueSpecularShadingTable( vtkVolume *vol );
84 
86 
91  vtkSetClampMacro( ActiveComponent, int, 0, 3 );
92  vtkGetMacro( ActiveComponent, int );
94 
95 protected:
97  ~vtkEncodedGradientShader() override;
98 
113  void BuildShadingTable( int index,
114  double lightDirection[3],
115  double lightAmbientColor[3],
116  double lightDiffuseColor[3],
117  double lightSpecularColor[3],
118  double lightIntensity,
119  double viewDirection[3],
120  double material[4],
121  int twoSided,
123  int updateFlag );
124 
125  // The six shading tables (r diffuse ,g diffuse ,b diffuse,
126  // r specular, g specular, b specular ) - with an entry for each
127  // encoded normal plus one entry at the end for the zero normal
128  // There is one shading table per volume listed in the ShadingTableVolume
129  // array. A null entry indicates an available slot.
130  float *ShadingTable[VTK_MAX_SHADING_TABLES][6];
131  vtkVolume *ShadingTableVolume[VTK_MAX_SHADING_TABLES];
132  int ShadingTableSize[VTK_MAX_SHADING_TABLES];
133 
135 
136  // The intensity of light used for the zero normals, since it
137  // can not be computed from the normal angles. Defaults to 0.0.
140 private:
142  void operator=(const vtkEncodedGradientShader&) = delete;
143 };
144 
145 
146 #endif
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:50
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract specification for renderers
Definition: vtkRenderer.h:63
a simple class to control print indentation
Definition: vtkIndent.h:39
Superclass for gradient estimation.
Compute shading tables for encoded normals.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
#define VTK_MAX_SHADING_TABLES