Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/Rendering/vtkRecursiveSphereDirectionEncoder.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkRecursiveSphereDirectionEncoder.h,v $ 00005 Language: C++ 00006 00007 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00016 00032 #ifndef __vtkRecursiveSphereDirectionEncoder_h 00033 #define __vtkRecursiveSphereDirectionEncoder_h 00034 00035 #include "vtkDirectionEncoder.h" 00036 00037 class VTK_RENDERING_EXPORT vtkRecursiveSphereDirectionEncoder : public vtkDirectionEncoder 00038 { 00039 public: 00040 vtkTypeRevisionMacro(vtkRecursiveSphereDirectionEncoder,vtkDirectionEncoder); 00041 void PrintSelf( ostream& os, vtkIndent indent ); 00042 00045 static vtkRecursiveSphereDirectionEncoder *New(); 00046 00047 00049 int GetEncodedDirection( float n[3] ); 00050 00052 float *GetDecodedGradient( int value ); 00053 00055 int GetNumberOfEncodedDirections( void ); 00056 00061 float *GetDecodedGradientTable( void ); 00062 00064 00076 vtkSetClampMacro( RecursionDepth, int, 0, 6 ); 00077 vtkGetMacro( RecursionDepth, int ); 00079 00080 protected: 00081 vtkRecursiveSphereDirectionEncoder(); 00082 ~vtkRecursiveSphereDirectionEncoder(); 00083 00084 // How far to recursively divide the sphere 00085 int RecursionDepth; 00086 00087 // The index table which maps (x,y) position in the rotated grid 00088 // to an encoded normal 00089 //int IndexTable[2*NORM_SQR_SIZE - 1][2*NORM_SQR_SIZE -1]; 00090 int *IndexTable; 00091 00092 // This is a table that maps encoded normal (2 byte value) to a 00093 // normal (dx, dy, dz) 00094 //float DecodedNormal[3*(1 + 2*(NORM_SQR_SIZE*NORM_SQR_SIZE+ 00095 // (NORM_SQR_SIZE-1)*(NORM_SQR_SIZE-1)))]; 00096 float *DecodedNormal; 00097 00098 // Method to initialize the index table and variable that 00099 // stored the recursion depth the last time the table was 00100 // built 00101 void InitializeIndexTable( void ); 00102 int IndexTableRecursionDepth; 00103 00104 int OuterSize; 00105 int InnerSize; 00106 int GridSize; 00107 private: 00108 vtkRecursiveSphereDirectionEncoder(const vtkRecursiveSphereDirectionEncoder&); // Not implemented. 00109 void operator=(const vtkRecursiveSphereDirectionEncoder&); // Not implemented. 00110 }; 00111 00112 00113 #endif 00114