VTK  9.0.1
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
vtkEncodedGradientShader::GetRedSpecularShadingTable
float * GetRedSpecularShadingTable(vtkVolume *vol)
vtkEncodedGradientShader::GetRedDiffuseShadingTable
float * GetRedDiffuseShadingTable(vtkVolume *vol)
Get the red/green/blue shading table.
vtkVolume
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:45
vtkEncodedGradientShader::ZeroNormalSpecularIntensity
float ZeroNormalSpecularIntensity
Definition: vtkEncodedGradientShader.h:131
vtkEncodedGradientShader::GetGreenDiffuseShadingTable
float * GetGreenDiffuseShadingTable(vtkVolume *vol)
vtkEncodedGradientShader::GetBlueSpecularShadingTable
float * GetBlueSpecularShadingTable(vtkVolume *vol)
vtkEncodedGradientShader::BuildShadingTable
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...
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkEncodedGradientShader::UpdateShadingTable
void UpdateShadingTable(vtkRenderer *ren, vtkVolume *vol, vtkEncodedGradientEstimator *gradest)
Cause the shading table to be updated.
vtkEncodedGradientShader::ZeroNormalDiffuseIntensity
float ZeroNormalDiffuseIntensity
Definition: vtkEncodedGradientShader.h:130
vtkEncodedGradientShader::ActiveComponent
int ActiveComponent
Definition: vtkEncodedGradientShader.h:126
vtkEncodedGradientShader
Compute shading tables for encoded normals.
Definition: vtkEncodedGradientShader.h:46
vtkEncodedGradientShader::~vtkEncodedGradientShader
~vtkEncodedGradientShader() override
vtkEncodedGradientEstimator
Superclass for gradient estimation.
Definition: vtkEncodedGradientEstimator.h:45
vtkEncodedGradientShader::vtkEncodedGradientShader
vtkEncodedGradientShader()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
VTK_MAX_SHADING_TABLES
#define VTK_MAX_SHADING_TABLES
Definition: vtkEncodedGradientShader.h:43
vtkEncodedGradientShader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Print the vtkEncodedGradientShader.
vtkObject.h
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:59
vtkEncodedGradientShader::GetBlueDiffuseShadingTable
float * GetBlueDiffuseShadingTable(vtkVolume *vol)
vtkEncodedGradientShader::New
static vtkEncodedGradientShader * New()
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkEncodedGradientShader::GetGreenSpecularShadingTable
float * GetGreenSpecularShadingTable(vtkVolume *vol)