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:
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 
60 protected:
62  ~vtkSphericalDirectionEncoder() override;
63 
64  static float DecodedGradientTable[65536 * 3];
65 
67 
70  static void InitializeDecodedGradientTable();
73 
74 private:
76  void operator=(const vtkSphericalDirectionEncoder&) = delete;
77 };
78 
79 VTK_ABI_NAMESPACE_END
80 #endif
static int DecodedGradientTableInitialized
Initialize the table at startup.
encode a direction into a one or two byte value
int GetNumberOfEncodedDirections() override
Return the number of encoded directions.
a simple class to control print indentation
Definition: vtkIndent.h:28
A direction encoder based on spherical coordinates.
void PrintSelf(ostream &os, vtkIndent indent) override
Get the name of this class.
#define VTK_SIZEHINT(...)
virtual float * GetDecodedGradient(int value)=0
/ Given an encoded value, return a pointer to the normal vector
virtual int GetEncodedDirection(float n[3])=0
Given a normal vector n, return the encoded direction.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
float * GetDecodedGradientTable() override
Get the decoded gradient table.