VTK  9.3.1
vtkOpenGLVolumeLookupTable.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
9 #ifndef vtkOpenGLVolumeLookupTable_h
10 #define vtkOpenGLVolumeLookupTable_h
11 
12 #include "vtkObject.h"
13 #include "vtkRenderingVolumeOpenGL2Module.h" // For export macro
14 
15 // Forward declarations
16 VTK_ABI_NAMESPACE_BEGIN
18 class vtkTextureObject;
19 class vtkWindow;
20 
21 class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkOpenGLVolumeLookupTable : public vtkObject
22 {
23 public:
25  void PrintSelf(ostream& os, vtkIndent indent) override;
26 
27  // static vtkOpenGLVolumeLookupTable* New();
28 
32  int GetTextureUnit();
33 
37  void Activate();
39  void Deactivate();
41 
45  int GetMaximumSupportedTextureWidth(vtkOpenGLRenderWindow* renWin, int idealWidth);
46 
50  void ReleaseGraphicsResources(vtkWindow* window);
51 
55  virtual void Update(vtkObject* func, double scalarRange[2], int blendMode, double sampleDistance,
56  double unitDistance, int filterValue, vtkOpenGLRenderWindow* renWin);
57 
61  vtkGetMacro(TextureHeight, int);
62 
66  vtkGetMacro(TextureWidth, int);
67 
68 protected:
69  vtkOpenGLVolumeLookupTable() = default;
70  ~vtkOpenGLVolumeLookupTable() override;
71 
72  double LastRange[2] = { 0.0, 0.0 };
73  float* Table = nullptr;
74  int LastInterpolation = -1;
75  int NumberOfColorComponents = 1;
76  int TextureWidth = 1024;
77  int TextureHeight = 1;
78  vtkTextureObject* TextureObject = nullptr;
80 
84  virtual bool NeedsUpdate(
85  vtkObject* func, double scalarRange[2], int blendMode, double sampleDistance);
86 
90  virtual void InternalUpdate(
91  vtkObject* func, int blendMode, double sampleDistance, double unitDistance, int filterValue);
92 
96  virtual void ComputeIdealTextureSize(
97  vtkObject* func, int& width, int& height, vtkOpenGLRenderWindow* renWin);
98 
102  virtual void AllocateTable();
103 
104 private:
106  void operator=(const vtkOpenGLVolumeLookupTable&) = delete;
107 };
108 
109 VTK_ABI_NAMESPACE_END
110 #endif // vtkOpenGLVolumeLookupTable_h
OpenGL rendering window.
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Base class for OpenGL texture management of scalar color, opacity and gradient opacity lookup tables...
record modification and/or execution time
Definition: vtkTimeStamp.h:24
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
a simple class to control print indentation
Definition: vtkIndent.h:28
abstracts an OpenGL texture object.