VTK  9.3.20240424
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
20VTK_ABI_NAMESPACE_BEGIN
21class VTKRENDERINGVOLUME_EXPORT vtkSphericalDirectionEncoder : public vtkDirectionEncoder
22{
23public:
25 void PrintSelf(ostream& os, vtkIndent indent) override;
26
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 {
58 }
59
60protected:
63
64 static float DecodedGradientTable[65536 * 3];
65
67
73
74private:
76 void operator=(const vtkSphericalDirectionEncoder&) = delete;
77};
78
79VTK_ABI_NAMESPACE_END
80#endif
encode a direction into a one or two byte value
a simple class to control print indentation
Definition vtkIndent.h:108
A direction encoder based on spherical coordinates.
static int DecodedGradientTableInitialized
Initialize the table at startup.
static void InitializeDecodedGradientTable()
Initialize the table at startup.
float * GetDecodedGradient(int value) override
/ Given an encoded value, return a pointer to the normal vector
static vtkSphericalDirectionEncoder * New()
Construct the object.
int GetEncodedDirection(float n[3]) override
Given a normal vector n, return the encoded direction.
float * GetDecodedGradientTable() override
Get the decoded gradient table.
~vtkSphericalDirectionEncoder() override
int GetNumberOfEncodedDirections() override
Return the number of encoded directions.
void PrintSelf(ostream &os, vtkIndent indent) override
Get the name of this class.
#define VTK_SIZEHINT(...)