VTK
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 "vtkRenderingVolumeModule.h" // For export macro
30 #include "vtkDirectionEncoder.h"
31 
32 class VTKRENDERINGVOLUME_EXPORT vtkSphericalDirectionEncoder : public vtkDirectionEncoder
33 {
34 public:
36  void PrintSelf( ostream& os, vtkIndent indent ) override;
37 
44 
45 
49  int GetEncodedDirection( float n[3] ) override;
50 
54  float *GetDecodedGradient( int value ) VTK_SIZEHINT(3) override;
55 
59  int GetNumberOfEncodedDirections( void ) override { return 65536; }
60 
67  float *GetDecodedGradientTable( void ) override
68  {
69  return &(this->DecodedGradientTable[0]);
70  }
71 
72 
73 protected:
75  ~vtkSphericalDirectionEncoder() override;
76 
77  static float DecodedGradientTable[65536*3];
78 
80 
83  static void InitializeDecodedGradientTable();
86 
87 private:
89  void operator=(const vtkSphericalDirectionEncoder&) = delete;
90 };
91 
92 
93 #endif
94 
95 
vtkDirectionEncoder.h
vtkX3D::value
Definition: vtkX3D.h:220
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkDirectionEncoder::GetDecodedGradient
virtual float * GetDecodedGradient(int value)=0
/ Given an encoded value, return a pointer to the normal vector
vtkDirectionEncoder::GetEncodedDirection
virtual int GetEncodedDirection(float n[3])=0
Given a normal vector n, return the encoded direction.
vtkSphericalDirectionEncoder::GetDecodedGradientTable
float * GetDecodedGradientTable(void) override
Get the decoded gradient table.
Definition: vtkSphericalDirectionEncoder.h:67
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:42
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSphericalDirectionEncoder::DecodedGradientTableInitialized
static int DecodedGradientTableInitialized
Definition: vtkSphericalDirectionEncoder.h:84
vtkDirectionEncoder
encode a direction into a one or two byte value
Definition: vtkDirectionEncoder.h:39
vtkDirectionEncoder::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSphericalDirectionEncoder
A direction encoder based on spherical coordinates.
Definition: vtkSphericalDirectionEncoder.h:32
vtkSphericalDirectionEncoder::GetNumberOfEncodedDirections
int GetNumberOfEncodedDirections(void) override
Return the number of encoded directions.
Definition: vtkSphericalDirectionEncoder.h:59