VTK
vtkRecursiveSphereDirectionEncoder.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkRecursiveSphereDirectionEncoder.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 
28 #ifndef __vtkRecursiveSphereDirectionEncoder_h
29 #define __vtkRecursiveSphereDirectionEncoder_h
30 
31 #include "vtkDirectionEncoder.h"
32 
34 {
35 public:
37  void PrintSelf( ostream& os, vtkIndent indent );
38 
42 
43 
45  int GetEncodedDirection( float n[3] );
46 
48  float *GetDecodedGradient( int value );
49 
51  int GetNumberOfEncodedDirections( void );
52 
57  float *GetDecodedGradientTable( void );
58 
60 
72  vtkSetClampMacro( RecursionDepth, int, 0, 6 );
73  vtkGetMacro( RecursionDepth, int );
75 
76 protected:
79 
80  // How far to recursively divide the sphere
82 
83  // The index table which maps (x,y) position in the rotated grid
84  // to an encoded normal
85  //int IndexTable[2*NORM_SQR_SIZE - 1][2*NORM_SQR_SIZE -1];
86  int *IndexTable;
87 
88  // This is a table that maps encoded normal (2 byte value) to a
89  // normal (dx, dy, dz)
90  //float DecodedNormal[3*(1 + 2*(NORM_SQR_SIZE*NORM_SQR_SIZE+
91  // (NORM_SQR_SIZE-1)*(NORM_SQR_SIZE-1)))];
92  float *DecodedNormal;
93 
94  // Method to initialize the index table and variable that
95  // stored the recursion depth the last time the table was
96  // built
97  void InitializeIndexTable( void );
99 
102  int GridSize;
103 private:
105  void operator=(const vtkRecursiveSphereDirectionEncoder&); // Not implemented.
106 };
107 
108 
109 #endif
110