VTK  9.1.0
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 "vtkDirectionEncoder.h"
33#include "vtkRenderingVolumeModule.h" // For export macro
34
35class VTKRENDERINGVOLUME_EXPORT vtkRecursiveSphereDirectionEncoder : public vtkDirectionEncoder
36{
37public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
47
51 int GetEncodedDirection(float n[3]) override;
52
56 float* GetDecodedGradient(int value) VTK_SIZEHINT(3) override;
57
61 int GetNumberOfEncodedDirections(void) override;
62
69 float* GetDecodedGradientTable(void) override;
70
72
87 vtkSetClampMacro(RecursionDepth, int, 0, 6);
88 vtkGetMacro(RecursionDepth, int);
90
91protected:
94
95 // How far to recursively divide the sphere
97
98 // The index table which maps (x,y) position in the rotated grid
99 // to an encoded normal
100 // int IndexTable[2*NORM_SQR_SIZE - 1][2*NORM_SQR_SIZE -1];
102
103 // This is a table that maps encoded normal (2 byte value) to a
104 // normal (dx, dy, dz)
105 // float DecodedNormal[3*(1 + 2*(NORM_SQR_SIZE*NORM_SQR_SIZE+
106 // (NORM_SQR_SIZE-1)*(NORM_SQR_SIZE-1)))];
108
109 // Method to initialize the index table and variable that
110 // stored the recursion depth the last time the table was
111 // built
114
118
119private:
121 void operator=(const vtkRecursiveSphereDirectionEncoder&) = delete;
122};
123
124#endif
encode a direction into a one or two byte value
a simple class to control print indentation
Definition: vtkIndent.h:113
A direction encoder based on the recursive subdivision of an octahedron.
int GetEncodedDirection(float n[3]) override
Given a normal vector n, return the encoded direction.
float * GetDecodedGradient(int value) override
/ Given an encoded value, return a pointer to the normal vector
void PrintSelf(ostream &os, vtkIndent indent) override
Get the name of this class.
float * GetDecodedGradientTable(void) override
Get the decoded gradient table.
int GetNumberOfEncodedDirections(void) override
Return the number of encoded directions.
static vtkRecursiveSphereDirectionEncoder * New()
Construct the object.
@ value
Definition: vtkX3D.h:226
#define VTK_SIZEHINT(...)