VTK  9.1.0
vtkOpenGLVolumeLookupTable.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkOpenGLVolumeLookupTable.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=========================================================================*/
15/*=============================================================================
16Copyright and License information
17=============================================================================*/
24#ifndef vtkOpenGLVolumeLookupTable_h
25#define vtkOpenGLVolumeLookupTable_h
26#ifndef __VTK_WRAP__
27
28#include "vtkObject.h"
29#include "vtkRenderingVolumeOpenGL2Module.h" // For export macro
30
31// Forward declarations
34class vtkWindow;
35
36class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkOpenGLVolumeLookupTable : public vtkObject
37{
38public:
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
42 // static vtkOpenGLVolumeLookupTable* New();
43
48
53 void Activate();
54 void Deactivate();
56
61
66
70 virtual void Update(vtkObject* func, double scalarRange[2], int blendMode, double sampleDistance,
71 double unitDistance, int filterValue, vtkOpenGLRenderWindow* renWin);
72
76 vtkGetMacro(TextureHeight, int);
77
81 vtkGetMacro(TextureWidth, int);
82
83protected:
86
87 double LastRange[2] = { 0.0, 0.0 };
88 float* Table = nullptr;
89 int LastInterpolation = -1;
90 int NumberOfColorComponents = 1;
91 int TextureWidth = 1024;
92 int TextureHeight = 1;
93 vtkTextureObject* TextureObject = nullptr;
95
99 virtual bool NeedsUpdate(
100 vtkObject* func, double scalarRange[2], int blendMode, double sampleDistance);
101
105 virtual void InternalUpdate(
106 vtkObject* func, int blendMode, double sampleDistance, double unitDistance, int filterValue);
107
112 vtkObject* func, int& width, int& height, vtkOpenGLRenderWindow* renWin);
113
117 virtual void AllocateTable();
118
119private:
121 void operator=(const vtkOpenGLVolumeLookupTable&) = delete;
122};
123
124#endif //__VTK_WRAP__
125#endif // vtkOpenGLVolumeLookupTable_h
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
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
Definition: vtkTimeStamp.h:52
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
@ height
Definition: vtkX3D.h:260