VTK  9.2.6
vtkSphericalDirectionEncoder.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSphericalDirectionEncoder.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 =========================================================================*/
26 #ifndef vtkSphericalDirectionEncoder_h
27 #define vtkSphericalDirectionEncoder_h
28 
29 #include "vtkDirectionEncoder.h"
30 #include "vtkRenderingVolumeModule.h" // For export macro
31 
32 class VTKRENDERINGVOLUME_EXPORT vtkSphericalDirectionEncoder : public vtkDirectionEncoder
33 {
34 public:
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
44 
48  int GetEncodedDirection(float n[3]) override;
49 
53  float* GetDecodedGradient(int value) VTK_SIZEHINT(3) override;
54 
58  int GetNumberOfEncodedDirections(void) override { return 65536; }
59 
66  float* GetDecodedGradientTable(void) override { return &(this->DecodedGradientTable[0]); }
67 
68 protected:
70  ~vtkSphericalDirectionEncoder() override;
71 
72  static float DecodedGradientTable[65536 * 3];
73 
75 
78  static void InitializeDecodedGradientTable();
81 
82 private:
84  void operator=(const vtkSphericalDirectionEncoder&) = delete;
85 };
86 
87 #endif
float * GetDecodedGradientTable(void) override
Get the decoded gradient table.
static int DecodedGradientTableInitialized
Initialize the table at startup.
encode a direction into a one or two byte value
int GetNumberOfEncodedDirections(void) override
Return the number of encoded directions.
a simple class to control print indentation
Definition: vtkIndent.h:39
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...