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 
29 #ifndef vtkRecursiveSphereDirectionEncoder_h
30 #define vtkRecursiveSphereDirectionEncoder_h
31 
32 #include "vtkRenderingVolumeModule.h" // For export macro
33 #include "vtkDirectionEncoder.h"
34 
35 class VTKRENDERINGVOLUME_EXPORT vtkRecursiveSphereDirectionEncoder : public vtkDirectionEncoder
36 {
37 public:
39  void PrintSelf( ostream& os, vtkIndent indent ) override;
40 
47 
48 
52  int GetEncodedDirection( float n[3] ) override;
53 
57  float *GetDecodedGradient( int value ) VTK_SIZEHINT(3) override;
58 
62  int GetNumberOfEncodedDirections( void ) override;
63 
70  float *GetDecodedGradientTable( void ) override;
71 
73 
88  vtkSetClampMacro( RecursionDepth, int, 0, 6 );
89  vtkGetMacro( RecursionDepth, int );
91 
92 protected:
95 
96  // How far to recursively divide the sphere
98 
99  // The index table which maps (x,y) position in the rotated grid
100  // to an encoded normal
101  //int IndexTable[2*NORM_SQR_SIZE - 1][2*NORM_SQR_SIZE -1];
103 
104  // This is a table that maps encoded normal (2 byte value) to a
105  // normal (dx, dy, dz)
106  //float DecodedNormal[3*(1 + 2*(NORM_SQR_SIZE*NORM_SQR_SIZE+
107  // (NORM_SQR_SIZE-1)*(NORM_SQR_SIZE-1)))];
109 
110  // Method to initialize the index table and variable that
111  // stored the recursion depth the last time the table was
112  // built
113  void InitializeIndexTable( void );
115 
118  int GridSize;
119 private:
121  void operator=(const vtkRecursiveSphereDirectionEncoder&) = delete;
122 };
123 
124 
125 #endif
126 
encode a direction into a one or two byte value
A direction encoder based on the recursive subdivision of an octahedron.
a simple class to control print indentation
Definition: vtkIndent.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Get the name of this class.
#define VTK_SIZEHINT(...)
virtual float * GetDecodedGradient(int value)=0
/ Given an encoded value, return a pointer to the normal vector
virtual int GetEncodedDirection(float n[3])=0
Given a normal vector n, return the encoded direction.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual float * GetDecodedGradientTable(void)=0
Get the decoded gradient table.
virtual int GetNumberOfEncodedDirections(void)=0
Return the number of encoded directions.