VTK: Rendering/Volume/vtkSphericalDirectionEncoder.h Source File

| VTK 9.3.1

vtkSphericalDirectionEncoder.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
14 #ifndef vtkSphericalDirectionEncoder_h
15 #define vtkSphericalDirectionEncoder_h
16
17 #include "vtkDirectionEncoder.h"
18 #include "vtkRenderingVolumeModule.h" // For export macro
19
20 VTK_ABI_NAMESPACE_BEGIN
21 class VTKRENDERINGVOLUME_EXPORT vtkSphericalDirectionEncoder : public vtkDirectionEncoder
22 {
23 public:
24 vtkTypeMacro(vtkSphericalDirectionEncoder, vtkDirectionEncoder);
25 void PrintSelf(ostream& os, vtkIndent indent) override;
26
32 static vtkSphericalDirectionEncoder* New();
33
37 int GetEncodedDirection(float n[3]) override;
38
42 float* GetDecodedGradient(int value) VTK_SIZEHINT(3) override;
43
47 int GetNumberOfEncodedDirections() override { return 65536; }
48
55 float* GetDecodedGradientTable() override
56 {
57 return &(vtkSphericalDirectionEncoder::DecodedGradientTable[0]);
58 }
59
60 protected:
61 vtkSphericalDirectionEncoder();
62 ~vtkSphericalDirectionEncoder() override;
63
64 static float DecodedGradientTable[65536 * 3];
65
67
70 static void InitializeDecodedGradientTable();
71 static int DecodedGradientTableInitialized;
73
74 private:
75 vtkSphericalDirectionEncoder(const vtkSphericalDirectionEncoder&) = delete;
76 void operator=(const vtkSphericalDirectionEncoder&) = delete;
77 };
78
79 VTK_ABI_NAMESPACE_END
80 #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
vtkSphericalDirectionEncoder
A direction encoder based on spherical coordinates.
Definition: vtkSphericalDirectionEncoder.h:22
vtkSphericalDirectionEncoder::New
static vtkSphericalDirectionEncoder * New()
Construct the object.
vtkSphericalDirectionEncoder::DecodedGradientTable
static float DecodedGradientTable[65536 *3]
Definition: vtkSphericalDirectionEncoder.h:64
vtkSphericalDirectionEncoder::DecodedGradientTableInitialized
static int DecodedGradientTableInitialized
Initialize the table at startup.
Definition: vtkSphericalDirectionEncoder.h:71
vtkSphericalDirectionEncoder::InitializeDecodedGradientTable
static void InitializeDecodedGradientTable()
Initialize the table at startup.
vtkSphericalDirectionEncoder::GetEncodedDirection
int GetEncodedDirection(float n[3]) override
Given a normal vector n, return the encoded direction.
vtkSphericalDirectionEncoder::GetDecodedGradientTable
float * GetDecodedGradientTable() override
Get the decoded gradient table.
Definition: vtkSphericalDirectionEncoder.h:55
vtkSphericalDirectionEncoder::vtkSphericalDirectionEncoder
vtkSphericalDirectionEncoder()
vtkSphericalDirectionEncoder::~vtkSphericalDirectionEncoder
~vtkSphericalDirectionEncoder() override
vtkSphericalDirectionEncoder::GetDecodedGradient
float * GetDecodedGradient(int value) override
/ Given an encoded value, return a pointer to the normal vector
vtkSphericalDirectionEncoder::GetNumberOfEncodedDirections
int GetNumberOfEncodedDirections() override
Return the number of encoded directions.
Definition: vtkSphericalDirectionEncoder.h:47
vtkSphericalDirectionEncoder::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Get the name of this class.
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkDirectionEncoder.h
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:36