VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkSphericalDirectionEncoder.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00025 #ifndef __vtkSphericalDirectionEncoder_h 00026 #define __vtkSphericalDirectionEncoder_h 00027 00028 #include "vtkRenderingVolumeModule.h" // For export macro 00029 #include "vtkDirectionEncoder.h" 00030 00031 class VTKRENDERINGVOLUME_EXPORT vtkSphericalDirectionEncoder : public vtkDirectionEncoder 00032 { 00033 public: 00034 vtkTypeMacro(vtkSphericalDirectionEncoder,vtkDirectionEncoder); 00035 void PrintSelf( ostream& os, vtkIndent indent ); 00036 00039 static vtkSphericalDirectionEncoder *New(); 00040 00041 00043 int GetEncodedDirection( float n[3] ); 00044 00046 float *GetDecodedGradient( int value ); 00047 00049 int GetNumberOfEncodedDirections( void ) { return 65536; } 00050 00052 00056 float *GetDecodedGradientTable( void ) 00057 { 00058 return &(this->DecodedGradientTable[0]); 00059 } 00061 00062 00063 protected: 00064 vtkSphericalDirectionEncoder(); 00065 ~vtkSphericalDirectionEncoder(); 00066 00067 static float DecodedGradientTable[65536*3]; 00068 00070 00071 static void InitializeDecodedGradientTable(); 00072 static int DecodedGradientTableInitialized; 00074 00075 private: 00076 vtkSphericalDirectionEncoder(const vtkSphericalDirectionEncoder&); // Not implemented. 00077 void operator=(const vtkSphericalDirectionEncoder&); // Not implemented. 00078 }; 00079 00080 00081 #endif 00082 00083