VTK  9.4.20241219
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
16VTK_ABI_NAMESPACE_BEGIN
19class vtkWindow;
20
21class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkOpenGLVolumeLookupTable : public vtkObject
22{
23public:
25 void PrintSelf(ostream& os, vtkIndent indent) override;
26
27 // static vtkOpenGLVolumeLookupTable* New();
28
33
38 void Activate();
39 void Deactivate();
41
46
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
68protected:
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
97 vtkObject* func, int& width, int& height, vtkOpenGLRenderWindow* renWin);
98
102 virtual void AllocateTable();
103
104private:
106 void operator=(const vtkOpenGLVolumeLookupTable&) = delete;
107};
108
109VTK_ABI_NAMESPACE_END
110#endif // vtkOpenGLVolumeLookupTable_h
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
OpenGL rendering window.
Base class for OpenGL texture management of scalar color, opacity and gradient opacity lookup tables.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void ComputeIdealTextureSize(vtkObject *func, int &width, int &height, vtkOpenGLRenderWindow *renWin)
Compute ideal width and height for the texture based on function provided.
virtual void InternalUpdate(vtkObject *func, int blendMode, double sampleDistance, double unitDistance, int filterValue)
Internal method to actually update the texture object.
virtual bool NeedsUpdate(vtkObject *func, double scalarRange[2], int blendMode, double sampleDistance)
Test whether the internal function needs to be updated.
int GetMaximumSupportedTextureWidth(vtkOpenGLRenderWindow *renWin, int idealWidth)
Get the maximum supported texture width for the target OpenGL environment.
virtual void AllocateTable()
Allocate internal data table.
void ReleaseGraphicsResources(vtkWindow *window)
Release graphics resources.
void Deactivate()
Activate / deactivate the internal texture object.
~vtkOpenGLVolumeLookupTable() override
int GetTextureUnit()
Get the texture unit associated with the managed texture object.
void Activate()
Activate / deactivate the internal texture object.
vtkOpenGLVolumeLookupTable()=default
virtual void Update(vtkObject *func, double scalarRange[2], int blendMode, double sampleDistance, double unitDistance, int filterValue, vtkOpenGLRenderWindow *renWin)
Update the internal texture object using the transfer function provided.
abstracts an OpenGL texture object.
record modification and/or execution time
window superclass for vtkRenderWindow
Definition vtkWindow.h:48