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 
32 #ifndef vtkEncodedGradientShader_h
33 #define vtkEncodedGradientShader_h
34 
35 #include "vtkRenderingVolumeModule.h" // For export macro
36 #include "vtkObject.h"
37 
38 class vtkVolume;
39 class vtkRenderer;
41 
42 #define VTK_MAX_SHADING_TABLES 100
43 
45 {
46 public:
47  static vtkEncodedGradientShader *New();
49 
51  void PrintSelf( ostream& os, vtkIndent indent );
52 
54 
56  vtkSetClampMacro( ZeroNormalDiffuseIntensity, float, 0.0f, 1.0f);
57  vtkGetMacro( ZeroNormalDiffuseIntensity, float );
58  vtkSetClampMacro( ZeroNormalSpecularIntensity, float, 0.0f, 1.0f);
59  vtkGetMacro( ZeroNormalSpecularIntensity, float );
61 
63 
64  void UpdateShadingTable( vtkRenderer *ren, vtkVolume *vol,
67 
69 
70  float *GetRedDiffuseShadingTable( vtkVolume *vol );
71  float *GetGreenDiffuseShadingTable( vtkVolume *vol );
72  float *GetBlueDiffuseShadingTable( vtkVolume *vol );
73  float *GetRedSpecularShadingTable( vtkVolume *vol );
74  float *GetGreenSpecularShadingTable( vtkVolume *vol );
75  float *GetBlueSpecularShadingTable( vtkVolume *vol );
77 
79 
82  vtkSetClampMacro( ActiveComponent, int, 0, 3 );
83  vtkGetMacro( ActiveComponent, int );
85 
86 protected:
89 
91 
103  void BuildShadingTable( int index,
104  double lightDirection[3],
105  double lightAmbientColor[3],
106  double lightDiffuseColor[3],
107  double lightSpecularColor[3],
108  double lightIntensity,
109  double viewDirection[3],
110  double material[4],
111  int twoSided,
113  int updateFlag );
115 
116  // The six shading tables (r diffuse ,g diffuse ,b diffuse,
117  // r specular, g specular, b specular ) - with an entry for each
118  // encoded normal plus one entry at the end for the zero normal
119  // There is one shading table per volume listed in the ShadingTableVolume
120  // array. A null entry indicates an available slot.
121  float *ShadingTable[VTK_MAX_SHADING_TABLES][6];
122  vtkVolume *ShadingTableVolume[VTK_MAX_SHADING_TABLES];
123  int ShadingTableSize[VTK_MAX_SHADING_TABLES];
124 
126 
127  // The intensity of light used for the zero normals, since it
128  // can not be computed from the normal angles. Defaults to 0.0.
131 private:
132  vtkEncodedGradientShader(const vtkEncodedGradientShader&); // Not implemented.
133  void operator=(const vtkEncodedGradientShader&); // Not implemented.
134 };
135 
136 
137 #endif
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:49
abstract base class for most VTK objects
Definition: vtkObject.h:61
#define VTKRENDERINGVOLUME_EXPORT
abstract specification for renderers
Definition: vtkRenderer.h:62
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
Superclass for gradient estimation.
Compute shading tables for encoded normals.
static vtkObject * New()
#define VTK_MAX_SHADING_TABLES