VTK  9.0.1
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 
30 // Forward declarations
32 class vtkTextureObject;
33 class vtkWindow;
34 
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
41  // static vtkOpenGLVolumeLookupTable* New();
42 
46  int GetTextureUnit();
47 
52  void Activate();
53  void Deactivate();
55 
59  int GetMaximumSupportedTextureWidth(vtkOpenGLRenderWindow* renWin, int idealWidth);
60 
64  void ReleaseGraphicsResources(vtkWindow* window);
65 
69  virtual void Update(vtkObject* func, double scalarRange[2], int blendMode, double sampleDistance,
70  double unitDistance, int filterValue, vtkOpenGLRenderWindow* renWin);
71 
75  vtkGetMacro(TextureHeight, int);
76 
80  vtkGetMacro(TextureWidth, int);
81 
82 protected:
83  vtkOpenGLVolumeLookupTable() = default;
84  virtual ~vtkOpenGLVolumeLookupTable() override;
85 
86  double LastRange[2] = { 0.0, 0.0 };
87  float* Table = nullptr;
90  int TextureWidth = 1024;
91  int TextureHeight = 1;
94 
98  virtual bool NeedsUpdate(
99  vtkObject* func, double scalarRange[2], int blendMode, double sampleDistance);
100 
104  virtual void InternalUpdate(
105  vtkObject* func, int blendMode, double sampleDistance, double unitDistance, int filterValue);
106 
110  virtual void ComputeIdealTextureSize(
111  vtkObject* func, int& width, int& height, vtkOpenGLRenderWindow* renWin);
112 
116  virtual void AllocateTable();
117 
118 private:
120  void operator=(const vtkOpenGLVolumeLookupTable&) = delete;
121 };
122 
123 #endif //__VTK_WRAP__
124 #endif // vtkOpenGLVolumeLookupTable_h
125 // VTK-HeaderTest-Exclude: vtkOpenGLVolumeLookupTable.h
vtkOpenGLVolumeLookupTable::GetTextureUnit
int GetTextureUnit()
Get the texture unit associated with the managed texture object.
vtkOpenGLVolumeLookupTable::TextureWidth
int TextureWidth
Definition: vtkOpenGLVolumeLookupTable.h:90
vtkOpenGLVolumeLookupTable::GetMaximumSupportedTextureWidth
int GetMaximumSupportedTextureWidth(vtkOpenGLRenderWindow *renWin, int idealWidth)
Get the maximum supported texture width for the target OpenGL environment.
vtkOpenGLVolumeLookupTable::~vtkOpenGLVolumeLookupTable
virtual ~vtkOpenGLVolumeLookupTable() override
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkOpenGLVolumeLookupTable::Table
float * Table
Definition: vtkOpenGLVolumeLookupTable.h:87
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkOpenGLVolumeLookupTable::LastInterpolation
int LastInterpolation
Definition: vtkOpenGLVolumeLookupTable.h:88
vtkOpenGLVolumeLookupTable::LastRange
double LastRange[2]
Definition: vtkOpenGLVolumeLookupTable.h:86
vtkOpenGLVolumeLookupTable::AllocateTable
virtual void AllocateTable()
Allocate internal data table.
vtkOpenGLVolumeLookupTable::Deactivate
void Deactivate()
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkOpenGLVolumeLookupTable::TextureObject
vtkTextureObject * TextureObject
Definition: vtkOpenGLVolumeLookupTable.h:92
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::Activate
void Activate()
Activate / deactivate the internal texture object.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:40
vtkObject.h
vtkOpenGLVolumeLookupTable::TextureHeight
int TextureHeight
Definition: vtkOpenGLVolumeLookupTable.h:91
vtkOpenGLVolumeLookupTable
Base class for OpenGL texture management of scalar color, opacity and gradient opacity lookup tables.
Definition: vtkOpenGLVolumeLookupTable.h:35
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:93
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:51
vtkOpenGLVolumeLookupTable::NumberOfColorComponents
int NumberOfColorComponents
Definition: vtkOpenGLVolumeLookupTable.h:89
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.