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 /*=============================================================================
16 Copyright 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
33 class vtkTextureObject;
34 class vtkWindow;
35 
36 class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkOpenGLVolumeLookupTable : public vtkObject
37 {
38 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
42  // static vtkOpenGLVolumeLookupTable* New();
43 
48 
52  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 
83 protected:
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 
119 private:
121  void operator=(const vtkOpenGLVolumeLookupTable&) = delete;
122 };
123 
124 #endif //__VTK_WRAP__
125 #endif // vtkOpenGLVolumeLookupTable_h
vtkOpenGLVolumeLookupTable::GetTextureUnit
int GetTextureUnit()
Get the texture unit associated with the managed texture object.
vtkOpenGLVolumeLookupTable::GetMaximumSupportedTextureWidth
int GetMaximumSupportedTextureWidth(vtkOpenGLRenderWindow *renWin, int idealWidth)
Get the maximum supported texture width for the target OpenGL environment.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:52
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkOpenGLVolumeLookupTable::AllocateTable
virtual void AllocateTable()
Allocate internal data table.
vtkOpenGLVolumeLookupTable::Deactivate
void Deactivate()
Activate / deactivate the internal texture object.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkX3D::height
@ height
Definition: vtkX3D.h:260
vtkOpenGLVolumeLookupTable::NeedsUpdate
virtual bool NeedsUpdate(vtkObject *func, double scalarRange[2], int blendMode, double sampleDistance)
Test whether the internal function needs to be updated.
vtkOpenGLVolumeLookupTable::vtkOpenGLVolumeLookupTable
vtkOpenGLVolumeLookupTable()=default
vtkOpenGLVolumeLookupTable::~vtkOpenGLVolumeLookupTable
~vtkOpenGLVolumeLookupTable() override
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:60
vtkObject.h
vtkOpenGLVolumeLookupTable
Base class for OpenGL texture management of scalar color, opacity and gradient opacity lookup tables.
Definition: vtkOpenGLVolumeLookupTable.h:37
vtkOpenGLVolumeLookupTable::Update
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.
vtkOpenGLVolumeLookupTable::BuildTime
vtkTimeStamp BuildTime
Definition: vtkOpenGLVolumeLookupTable.h:94
vtkOpenGLVolumeLookupTable::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOpenGLVolumeLookupTable::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *window)
Release graphics resources.
vtkOpenGLVolumeLookupTable::InternalUpdate
virtual void InternalUpdate(vtkObject *func, int blendMode, double sampleDistance, double unitDistance, int filterValue)
Internal method to actually update the texture object.
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:83
vtkOpenGLVolumeLookupTable::ComputeIdealTextureSize
virtual void ComputeIdealTextureSize(vtkObject *func, int &width, int &height, vtkOpenGLRenderWindow *renWin)
Compute ideal width and height for the texture based on function provided.