VTK  9.1.20211115
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 "vtkObject.h"
37 #include "vtkRenderingVolumeModule.h" // For export macro
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:
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 
71 
73 
83 
85 
90  vtkSetClampMacro(ActiveComponent, int, 0, 3);
91  vtkGetMacro(ActiveComponent, int);
93 
94 protected:
97 
112  void BuildShadingTable(int index, double lightDirection[3], double lightAmbientColor[3],
113  double lightDiffuseColor[3], double lightSpecularColor[3], double lightIntensity,
114  double viewDirection[3], double material[4], int twoSided, vtkEncodedGradientEstimator* gradest,
115  int updateFlag);
116 
117  // The six shading tables (r diffuse ,g diffuse ,b diffuse,
118  // r specular, g specular, b specular ) - with an entry for each
119  // encoded normal plus one entry at the end for the zero normal
120  // There is one shading table per volume listed in the ShadingTableVolume
121  // array. A null entry indicates an available slot.
122  float* ShadingTable[VTK_MAX_SHADING_TABLES][6];
123  vtkVolume* ShadingTableVolume[VTK_MAX_SHADING_TABLES];
124  int ShadingTableSize[VTK_MAX_SHADING_TABLES];
125 
127 
128  // The intensity of light used for the zero normals, since it
129  // can not be computed from the normal angles. Defaults to 0.0.
132 
133 private:
135  void operator=(const vtkEncodedGradientShader&) = delete;
136 };
137 
138 #endif
Superclass for gradient estimation.
Compute shading tables for encoded normals.
float * GetRedSpecularShadingTable(vtkVolume *vol)
Get the red/green/blue shading table.
float * GetGreenSpecularShadingTable(vtkVolume *vol)
Get the red/green/blue shading table.
float * GetRedDiffuseShadingTable(vtkVolume *vol)
Get the red/green/blue shading table.
void PrintSelf(ostream &os, vtkIndent indent) override
Print the vtkEncodedGradientShader.
static vtkEncodedGradientShader * New()
float * GetGreenDiffuseShadingTable(vtkVolume *vol)
Get the red/green/blue shading table.
void UpdateShadingTable(vtkRenderer *ren, vtkVolume *vol, vtkEncodedGradientEstimator *gradest)
Cause the shading table to be updated.
~vtkEncodedGradientShader() override
float * GetBlueDiffuseShadingTable(vtkVolume *vol)
Get the red/green/blue shading table.
void BuildShadingTable(int index, double lightDirection[3], double lightAmbientColor[3], double lightDiffuseColor[3], double lightSpecularColor[3], double lightIntensity, double viewDirection[3], double material[4], int twoSided, vtkEncodedGradientEstimator *gradest, int updateFlag)
Build a shading table for a light with the specified direction, and color for an object of the specif...
float * GetBlueSpecularShadingTable(vtkVolume *vol)
Get the red/green/blue shading table.
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:82
abstract specification for renderers
Definition: vtkRenderer.h:182
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:134
@ index
Definition: vtkX3D.h:252
#define VTK_MAX_SHADING_TABLES