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
35class VTKRENDERINGVOLUME_EXPORT vtkRecursiveSphereDirectionEncoder : public vtkDirectionEncoder
36{
37public:
39 void PrintSelf( ostream& os, vtkIndent indent );
40
47
48
52 int GetEncodedDirection( float n[3] );
53
58
63
71
73
88 vtkSetClampMacro( RecursionDepth, int, 0, 6 );
89 vtkGetMacro( RecursionDepth, int );
91
92protected:
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
115
119private:
121 void operator=(const vtkRecursiveSphereDirectionEncoder&) VTK_DELETE_FUNCTION;
122};
123
124
125#endif
126
encode a direction into a one or two byte value
a simple class to control print indentation
Definition: vtkIndent.h:40
A direction encoder based on the recursive subdivision of an octahedron.
float * GetDecodedGradientTable(void)
Get the decoded gradient table.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
int GetEncodedDirection(float n[3])
Given a normal vector n, return the encoded direction.
float * GetDecodedGradient(int value)
/ Given an encoded value, return a pointer to the normal vector
int GetNumberOfEncodedDirections(void)
Return the number of encoded directions.
static vtkRecursiveSphereDirectionEncoder * New()
Construct the object.
@ value
Definition: vtkX3D.h:220