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
static vtkOpenGLTransferFunction2D * New()
void Create(unsigned int numberOfTables)
int GetMaximumSupportedTextureWidth(vtkOpenGLRenderWindow *renWin, int idealWidth)
vtkNew< vtkImageResize > ResizeFilter
virtual void SetOutputDimensions(int, int, int)
The desired output dimensions.
abstract base class for most VTK objects
Container for a set of TransferFunction2D instances.
virtual void * GetVoidPointer(vtkIdType valueIdx)=0
Return a void pointer.
~vtkOpenGLTransferFunctions2D()
~vtkOpenGLTransferFunction2D() override
record modification and/or execution time
void Modified()
Set this objects time to the current time.
void Activate()
Activate and Bind the texture.
void SetInputData(vtkDataObject *)
Assign a data object as input.
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].
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
vtkPointData * GetPointData()
Return a pointer to this dataset's point data.
window superclass for vtkRenderWindow
size_t GetNumberOfTables()
vtkOpenGLTransferFunction2D * GetTable(unsigned int i)
static int NearestPowerOfTwo(int x)
Compute the nearest power of two that is not less than x.
vtkDataArray * GetScalars()
Set/Get the scalar data.
virtual int * GetDimensions()
Get dimensions of this structured points dataset.
2D Transfer function container.
topologically and geometrically regular array of data
void ReleaseGraphicsResources(vtkWindow *window)
virtual void SetMinificationFilter(int)
Minification filter mode.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
void ReleaseGraphicsResources(vtkWindow *window)
vtkMTimeType GetMTime() override
Datasets are composite objects and need to check each part for MTime THIS METHOD IS THREAD SAFE...
virtual unsigned int GetHandle()
Returns the OpenGL handle.
virtual void Update(int port)
Bring this algorithm's outputs up-to-date.
abstracts an OpenGL texture object.
static int GetMaximumTextureSize(vtkOpenGLRenderWindow *context)
Query and return maximum texture size (dimension) supported by the OpenGL driver for a particular con...
void ReleaseGraphicsResources(vtkWindow *win)
Deactivate and UnBind the texture.
void Deactivate()
Deactivate and UnBind the texture.
void SetResizeMethodToOutputDimensions()
The resizing method to use.
static vtkTextureObject * New()
virtual void SetWrapS(int)
Wrap mode for the first texture coordinate "s" Valid values are:
void Update(vtkImageData *transfer2D, int interpolation, vtkOpenGLRenderWindow *renWin)
int GetTextureUnit()
Return the texture unit used for this texture.
virtual void SetWrapT(int)
Wrap mode for the first texture coordinate "t" Valid values are:
vtkOpenGLTransferFunction2D()
static T Max(const T &a, const T &b)
Returns the maximum of the two arguments provided.
virtual void Delete()
Delete a VTK object.
void SetContext(vtkOpenGLRenderWindow *)
Get/Set the context.
vtkTextureObject * TextureObject
virtual void SetMagnificationFilter(int)
Magnification filter mode.