VTK  9.3.20240425
vtkEncodedGradientShader.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
21#ifndef vtkEncodedGradientShader_h
22#define vtkEncodedGradientShader_h
23
24#include "vtkObject.h"
25#include "vtkRenderingVolumeModule.h" // For export macro
26
27VTK_ABI_NAMESPACE_BEGIN
28class vtkVolume;
29class vtkRenderer;
31
32#define VTK_MAX_SHADING_TABLES 100
33
34class VTKRENDERINGVOLUME_EXPORT vtkEncodedGradientShader : public vtkObject
35{
36public:
39
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
46
50 vtkSetClampMacro(ZeroNormalDiffuseIntensity, float, 0.0f, 1.0f);
51 vtkGetMacro(ZeroNormalDiffuseIntensity, float);
52 vtkSetClampMacro(ZeroNormalSpecularIntensity, float, 0.0f, 1.0f);
53 vtkGetMacro(ZeroNormalSpecularIntensity, float);
55
60
62
72
74
79 vtkSetClampMacro(ActiveComponent, int, 0, 3);
80 vtkGetMacro(ActiveComponent, int);
82
83protected:
86
101 void BuildShadingTable(int index, double lightDirection[3], double lightAmbientColor[3],
102 double lightDiffuseColor[3], double lightSpecularColor[3], double lightIntensity,
103 double viewDirection[3], double material[4], int twoSided, vtkEncodedGradientEstimator* gradest,
104 int updateFlag);
105
106 // The six shading tables (r diffuse ,g diffuse ,b diffuse,
107 // r specular, g specular, b specular ) - with an entry for each
108 // encoded normal plus one entry at the end for the zero normal
109 // There is one shading table per volume listed in the ShadingTableVolume
110 // array. A null entry indicates an available slot.
111 float* ShadingTable[VTK_MAX_SHADING_TABLES][6];
112 vtkVolume* ShadingTableVolume[VTK_MAX_SHADING_TABLES];
113 int ShadingTableSize[VTK_MAX_SHADING_TABLES];
114
116
117 // The intensity of light used for the zero normals, since it
118 // can not be computed from the normal angles. Defaults to 0.0.
121
122private:
124 void operator=(const vtkEncodedGradientShader&) = delete;
125};
126
127VTK_ABI_NAMESPACE_END
128#endif
Superclass for gradient estimation.
Compute shading tables for encoded normals.
float * GetRedSpecularShadingTable(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.
float * GetBlueDiffuseShadingTable(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 * GetGreenSpecularShadingTable(vtkVolume *vol)
Get the red/green/blue shading table.
float * GetGreenDiffuseShadingTable(vtkVolume *vol)
Get the red/green/blue shading table.
float * GetBlueSpecularShadingTable(vtkVolume *vol)
Get the red/green/blue shading table.
static vtkEncodedGradientShader * New()
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...
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
abstract specification for renderers
represents a volume (data & properties) in a rendered scene
Definition vtkVolume.h:120
#define VTK_MAX_SHADING_TABLES