Go to the documentation of this file.
16 #ifndef vtkOpenGLTransferFunction2D_h
17 #define vtkOpenGLTransferFunction2D_h
88 if (dims[0] != width || dims[1] !=
height)
123 vtkErrorMacro(
"vtkTextureObject not initialized!");
132 vtkErrorMacro(
"Failed to query max texture size! using default 1024.");
136 if (maxWidth >= idealWidth)
142 vtkWarningMacro(
"This OpenGL implementation does not support the required "
143 "texture size of " << idealWidth <<
", falling back to maximum allowed, "
144 << maxWidth <<
"." <<
"This may cause an incorrect color table mapping.");
222 this->Tables.reserve(static_cast<size_t>(numberOfTables));
224 for (
unsigned int i = 0; i < numberOfTables; i++)
227 this->Tables.push_back(table);
234 size_t const size = this->Tables.size();
235 for (
size_t i = 0; i <
size; i++)
237 this->Tables[i]->Delete();
244 if (i >= this->Tables.size())
248 return this->Tables[i];
254 return this->Tables.size();
260 size_t const size = this->Tables.size();
261 for (
size_t i = 0; i <
size; ++i)
263 this->Tables[i]->ReleaseGraphicsResources(window);
275 std::vector<vtkOpenGLTransferFunction2D*> Tables;
279 #endif // vtkOpenGLTransferFunction2D_h
void ReleaseGraphicsResources(vtkWindow *window)
void ReleaseGraphicsResources(vtkWindow *win)
Deactivate and UnBind the texture.
virtual void Update(int port)
Bring this algorithm's outputs up-to-date.
void ReleaseGraphicsResources(vtkWindow *window)
static int NearestPowerOfTwo(int x)
Compute the nearest power of two that is not less than x.
virtual void SetMinificationFilter(int)
static vtkOpenGLTransferFunction2D * New()
static T Max(const T &a, const T &b)
Returns the maximum of the two arguments provided.
virtual void SetWrapS(int)
vtkNew< vtkImageResize > ResizeFilter
record modification and/or execution time
void SetContext(vtkOpenGLRenderWindow *)
Get/Set the context.
abstract base class for most VTK objects
int GetMaximumSupportedTextureWidth(vtkOpenGLRenderWindow *renWin, int idealWidth)
static int GetMaximumTextureSize(vtkOpenGLRenderWindow *context)
Query and return maximum texture size (dimension) supported by the OpenGL driver for a particular con...
virtual void SetOutputDimensions(int, int, int)
The desired output dimensions.
virtual void Delete()
Delete a VTK object.
virtual int * GetDimensions()
Get dimensions of this structured points dataset.
int GetTextureUnit()
Return the texture unit used for this texture.
window superclass for vtkRenderWindow
~vtkOpenGLTransferFunction2D() override
virtual void * GetVoidPointer(vtkIdType valueIdx)=0
Return a void pointer.
void Update(vtkImageData *transfer2D, int interpolation, vtkOpenGLRenderWindow *renWin)
vtkOpenGLTransferFunction2D()
void SetInputData(vtkDataObject *)
Assign a data object as input.
virtual void SetWrapT(int)
vtkTextureObject * TextureObject
void Modified()
Set this objects time to the current time.
void Create(unsigned int numberOfTables)
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkMTimeType GetMTime() override
Datasets are composite objects and need to check each part for MTime THIS METHOD IS THREAD SAFE.
vtkPointData * GetPointData()
Return a pointer to this dataset's point data.
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
void Deactivate()
Deactivate and UnBind the texture.
topologically and geometrically regular array of data
abstracts an OpenGL texture object.
static vtkTextureObject * New()
void SetResizeMethodToOutputDimensions()
vtkDataArray * GetScalars()
virtual void SetMagnificationFilter(int)
~vtkOpenGLTransferFunctions2D()
vtkOpenGLTransferFunctions2D()=default
static vtkOpenGLTransferFunctions2D * New()
virtual unsigned int GetHandle()
Returns the OpenGL handle.
2D Transfer function container.
vtkOpenGLTransferFunction2D * GetTable(unsigned int i)
bool Create2DFromRaw(unsigned int width, unsigned int height, int numComps, int dataType, void *data)
Create a 2D texture from client memory numComps must be in [1-4].
size_t GetNumberOfTables()
Container for a set of TransferFunction2D instances.
void Activate()
Activate and Bind the texture.