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:
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 
67 
69 
77 
79 
82  vtkSetClampMacro( ActiveComponent, int, 0, 3 );
83  vtkGetMacro( ActiveComponent, int );
85 
86 protected:
89 
91 
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
vtkEncodedGradientShader::GetRedSpecularShadingTable
float * GetRedSpecularShadingTable(vtkVolume *vol)
vtkEncodedGradientShader::GetRedDiffuseShadingTable
float * GetRedDiffuseShadingTable(vtkVolume *vol)
vtkVolume
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:50
vtkRenderingVolumeModule.h
vtkEncodedGradientShader::ZeroNormalSpecularIntensity
float ZeroNormalSpecularIntensity
Definition: vtkEncodedGradientShader.h:130
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
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)
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkEncodedGradientShader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkEncodedGradientShader::UpdateShadingTable
void UpdateShadingTable(vtkRenderer *ren, vtkVolume *vol, vtkEncodedGradientEstimator *gradest)
vtkEncodedGradientShader::ZeroNormalDiffuseIntensity
float ZeroNormalDiffuseIntensity
Definition: vtkEncodedGradientShader.h:129
vtkEncodedGradientShader::ActiveComponent
int ActiveComponent
Definition: vtkEncodedGradientShader.h:125
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkEncodedGradientShader
Compute shading tables for encoded normals.
Definition: vtkEncodedGradientShader.h:45
vtkEncodedGradientEstimator
Superclass for gradient estimation.
Definition: vtkEncodedGradientEstimator.h:44
vtkEncodedGradientShader::vtkEncodedGradientShader
vtkEncodedGradientShader()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
VTK_MAX_SHADING_TABLES
#define VTK_MAX_SHADING_TABLES
Definition: vtkEncodedGradientShader.h:42
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkgl::f
GLclampf f
Definition: vtkgl.h:14181
vtkObject.h
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkEncodedGradientShader::GetBlueDiffuseShadingTable
float * GetBlueDiffuseShadingTable(vtkVolume *vol)
vtkEncodedGradientShader::New
static vtkEncodedGradientShader * New()
VTKRENDERINGVOLUME_EXPORT
#define VTKRENDERINGVOLUME_EXPORT
Definition: vtkRenderingVolumeModule.h:15
vtkEncodedGradientShader::GetGreenSpecularShadingTable
float * GetGreenSpecularShadingTable(vtkVolume *vol)
vtkEncodedGradientShader::~vtkEncodedGradientShader
~vtkEncodedGradientShader()