00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkSphericalDirectionEncoder.h,v $ 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 "vtkDirectionEncoder.h" 00029 00030 class VTK_VOLUMERENDERING_EXPORT vtkSphericalDirectionEncoder : public vtkDirectionEncoder 00031 { 00032 public: 00033 vtkTypeRevisionMacro(vtkSphericalDirectionEncoder,vtkDirectionEncoder); 00034 void PrintSelf( ostream& os, vtkIndent indent ); 00035 00038 static vtkSphericalDirectionEncoder *New(); 00039 00040 00042 int GetEncodedDirection( float n[3] ); 00043 00045 float *GetDecodedGradient( int value ); 00046 00048 int GetNumberOfEncodedDirections( void ) { return 65536; } 00049 00051 00055 float *GetDecodedGradientTable( void ) 00056 { 00057 return &(this->DecodedGradientTable[0]); 00058 } 00060 00061 00062 protected: 00063 vtkSphericalDirectionEncoder(); 00064 ~vtkSphericalDirectionEncoder(); 00065 00066 static float DecodedGradientTable[65536*3]; 00067 00069 00070 static void InitializeDecodedGradientTable(); 00071 static int DecodedGradientTableInitialized; 00073 00074 private: 00075 vtkSphericalDirectionEncoder(const vtkSphericalDirectionEncoder&); // Not implemented. 00076 void operator=(const vtkSphericalDirectionEncoder&); // Not implemented. 00077 }; 00078 00079 00080 #endif 00081 00082