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
39class vtkVolume;
40class vtkRenderer;
42
43#define VTK_MAX_SHADING_TABLES 100
44
45class VTKRENDERINGVOLUME_EXPORT vtkEncodedGradientShader : public vtkObject
46{
47public:
50
54 void PrintSelf( ostream& os, vtkIndent indent );
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
72
74
84
86
91 vtkSetClampMacro( ActiveComponent, int, 0, 3 );
92 vtkGetMacro( ActiveComponent, int );
94
95protected:
98
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.
140private:
141 vtkEncodedGradientShader(const vtkEncodedGradientShader&) VTK_DELETE_FUNCTION;
142 void operator=(const vtkEncodedGradientShader&) VTK_DELETE_FUNCTION;
143};
144
145
146#endif
Superclass for gradient estimation.
Compute shading tables for encoded normals.
float * GetRedSpecularShadingTable(vtkVolume *vol)
float * GetRedDiffuseShadingTable(vtkVolume *vol)
Get the red/green/blue shading table.
float * GetBlueDiffuseShadingTable(vtkVolume *vol)
void UpdateShadingTable(vtkRenderer *ren, vtkVolume *vol, vtkEncodedGradientEstimator *gradest)
Cause the shading table to be updated.
void PrintSelf(ostream &os, vtkIndent indent)
Print the vtkEncodedGradientShader.
float * GetGreenSpecularShadingTable(vtkVolume *vol)
float * GetGreenDiffuseShadingTable(vtkVolume *vol)
float * GetBlueSpecularShadingTable(vtkVolume *vol)
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:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
abstract specification for renderers
Definition: vtkRenderer.h:64
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:51
@ index
Definition: vtkX3D.h:246
#define VTK_MAX_SHADING_TABLES