VTK: Rendering/Volume/vtkRecursiveSphereDirectionEncoder.h Source File

| VTK 9.3.1

vtkRecursiveSphereDirectionEncoder.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3
17 #ifndef vtkRecursiveSphereDirectionEncoder_h
18 #define vtkRecursiveSphereDirectionEncoder_h
19
20 #include "vtkDirectionEncoder.h"
21 #include "vtkRenderingVolumeModule.h" // For export macro
22
23 VTK_ABI_NAMESPACE_BEGIN
24 class VTKRENDERINGVOLUME_EXPORT vtkRecursiveSphereDirectionEncoder : public vtkDirectionEncoder
25 {
26 public:
27 vtkTypeMacro(vtkRecursiveSphereDirectionEncoder, vtkDirectionEncoder);
28 void PrintSelf(ostream& os, vtkIndent indent) override;
29
35 static vtkRecursiveSphereDirectionEncoder* New();
36
40 int GetEncodedDirection(float n[3]) override;
41
45 float* GetDecodedGradient(int value) VTK_SIZEHINT(3) override;
46
50 int GetNumberOfEncodedDirections() override;
51
58 float* GetDecodedGradientTable() override;
59
61
76 vtkSetClampMacro(RecursionDepth, int, 0, 6);
77 vtkGetMacro(RecursionDepth, int);
79
80 protected:
81 vtkRecursiveSphereDirectionEncoder();
82 ~vtkRecursiveSphereDirectionEncoder() override;
83
84 // How far to recursively divide the sphere
85 int RecursionDepth;
86
87 // The index table which maps (x,y) position in the rotated grid
88 // to an encoded normal
89 // int IndexTable[2*NORM_SQR_SIZE - 1][2*NORM_SQR_SIZE -1];
90 int* IndexTable;
91
92 // This is a table that maps encoded normal (2 byte value) to a
93 // normal (dx, dy, dz)
94 // float DecodedNormal[3*(1 + 2*(NORM_SQR_SIZE*NORM_SQR_SIZE+
95 // (NORM_SQR_SIZE-1)*(NORM_SQR_SIZE-1)))];
96 float* DecodedNormal;
97
98 // Method to initialize the index table and variable that
99 // stored the recursion depth the last time the table was
100 // built
101 void InitializeIndexTable();
102 int IndexTableRecursionDepth;
103
104 int OuterSize;
105 int InnerSize;
106 int GridSize;
107
108 private:
109 vtkRecursiveSphereDirectionEncoder(const vtkRecursiveSphereDirectionEncoder&) = delete;
110 void operator=(const vtkRecursiveSphereDirectionEncoder&) = delete;
111 };
112
113 VTK_ABI_NAMESPACE_END
114 #endif
vtkDirectionEncoder
encode a direction into a one or two byte value
Definition: vtkDirectionEncoder.h:29
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkRecursiveSphereDirectionEncoder
A direction encoder based on the recursive subdivision of an octahedron.
Definition: vtkRecursiveSphereDirectionEncoder.h:25
vtkRecursiveSphereDirectionEncoder::DecodedNormal
float * DecodedNormal
Definition: vtkRecursiveSphereDirectionEncoder.h:96
vtkRecursiveSphereDirectionEncoder::GetNumberOfEncodedDirections
int GetNumberOfEncodedDirections() override
Return the number of encoded directions.
vtkRecursiveSphereDirectionEncoder::GetEncodedDirection
int GetEncodedDirection(float n[3]) override
Given a normal vector n, return the encoded direction.
vtkRecursiveSphereDirectionEncoder::InitializeIndexTable
void InitializeIndexTable()
vtkRecursiveSphereDirectionEncoder::New
static vtkRecursiveSphereDirectionEncoder * New()
Construct the object.
vtkRecursiveSphereDirectionEncoder::~vtkRecursiveSphereDirectionEncoder
~vtkRecursiveSphereDirectionEncoder() override
vtkRecursiveSphereDirectionEncoder::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Get the name of this class.
vtkRecursiveSphereDirectionEncoder::InnerSize
int InnerSize
Definition: vtkRecursiveSphereDirectionEncoder.h:105
vtkRecursiveSphereDirectionEncoder::OuterSize
int OuterSize
Definition: vtkRecursiveSphereDirectionEncoder.h:104
vtkRecursiveSphereDirectionEncoder::GridSize
int GridSize
Definition: vtkRecursiveSphereDirectionEncoder.h:106
vtkRecursiveSphereDirectionEncoder::IndexTableRecursionDepth
int IndexTableRecursionDepth
Definition: vtkRecursiveSphereDirectionEncoder.h:102
vtkRecursiveSphereDirectionEncoder::IndexTable
int * IndexTable
Definition: vtkRecursiveSphereDirectionEncoder.h:90
vtkRecursiveSphereDirectionEncoder::GetDecodedGradientTable
float * GetDecodedGradientTable() override
Get the decoded gradient table.
vtkRecursiveSphereDirectionEncoder::RecursionDepth
int RecursionDepth
Definition: vtkRecursiveSphereDirectionEncoder.h:85
vtkRecursiveSphereDirectionEncoder::GetDecodedGradient
float * GetDecodedGradient(int value) override
/ Given an encoded value, return a pointer to the normal vector
vtkRecursiveSphereDirectionEncoder::vtkRecursiveSphereDirectionEncoder
vtkRecursiveSphereDirectionEncoder()
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkDirectionEncoder.h
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:36