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 "vtkRenderingVolumeModule.h" // For export macro
32 #include "vtkDirectionEncoder.h"
33 
35 {
36 public:
38  void PrintSelf( ostream& os, vtkIndent indent );
39 
43 
44 
46  int GetEncodedDirection( float n[3] );
47 
49  float *GetDecodedGradient( int value );
50 
52  int GetNumberOfEncodedDirections( void );
53 
58  float *GetDecodedGradientTable( void );
59 
61 
73  vtkSetClampMacro( RecursionDepth, int, 0, 6 );
74  vtkGetMacro( RecursionDepth, int );
76 
77 protected:
80 
81  // How far to recursively divide the sphere
83 
84  // The index table which maps (x,y) position in the rotated grid
85  // to an encoded normal
86  //int IndexTable[2*NORM_SQR_SIZE - 1][2*NORM_SQR_SIZE -1];
87  int *IndexTable;
88 
89  // This is a table that maps encoded normal (2 byte value) to a
90  // normal (dx, dy, dz)
91  //float DecodedNormal[3*(1 + 2*(NORM_SQR_SIZE*NORM_SQR_SIZE+
92  // (NORM_SQR_SIZE-1)*(NORM_SQR_SIZE-1)))];
93  float *DecodedNormal;
94 
95  // Method to initialize the index table and variable that
96  // stored the recursion depth the last time the table was
97  // built
98  void InitializeIndexTable( void );
100 
103  int GridSize;
104 private:
106  void operator=(const vtkRecursiveSphereDirectionEncoder&); // Not implemented.
107 };
108 
109 
110 #endif
111 
encode a direction into a one or two byte value
#define VTKRENDERINGVOLUME_EXPORT
A direction encoder based on the recursive subdivision of an octahedron.
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual float * GetDecodedGradient(int value)=0
virtual int GetEncodedDirection(float n[3])=0
static vtkObject * New()
virtual float * GetDecodedGradientTable(void)=0
virtual int GetNumberOfEncodedDirections(void)=0