Go to the documentation of this file.
16 #ifndef vtkOpenGLVolumeRGBTable_h
17 #define vtkOpenGLVolumeRGBTable_h
63 bool needUpdate =
false;
90 delete [] this->
Table;
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.");
181 this->
Table =
nullptr;
193 delete[] this->
Table;
223 this->Tables.reserve(static_cast<size_t>(numberOfTables));
225 for (
unsigned int i = 0; i < numberOfTables; i++)
228 this->Tables.push_back(table);
235 size_t const size = this->Tables.size();
236 for (
size_t i = 0; i <
size; i++)
238 this->Tables[i]->Delete();
246 if (i >= this->Tables.size())
250 return this->Tables[i];
257 return this->Tables.size();
263 size_t const size = this->Tables.size();
264 for (
size_t i = 0; i <
size; ++i)
266 this->Tables[i]->ReleaseGraphicsResources(window);
274 std::vector<vtkOpenGLVolumeRGBTable*> Tables;
284 #endif // vtkOpenGLVolumeRGBTable_h
void ReleaseGraphicsResources(vtkWindow *win)
Deactivate and UnBind the texture.
int NumberOfColorComponents
~vtkOpenGLVolumeRGBTables()
static int NearestPowerOfTwo(int x)
Compute the nearest power of two that is not less than x.
virtual void SetMinificationFilter(int)
static T Max(const T &a, const T &b)
Returns the maximum of the two arguments provided.
virtual void SetWrapS(int)
record modification and/or execution time
void SetContext(vtkOpenGLRenderWindow *)
Get/Set the context.
abstract base class for most VTK objects
void GetTable(double x1, double x2, int n, double *table)
Fills in a table of n colors mapped from values mapped with even spacing between x1 and x2,...
static int GetMaximumTextureSize(vtkOpenGLRenderWindow *context)
Query and return maximum texture size (dimension) supported by the OpenGL driver for a particular con...
virtual void Delete()
Delete a VTK object.
void ReleaseGraphicsResources(vtkWindow *window)
~vtkOpenGLVolumeRGBTable() override
Defines a transfer function for mapping a property to an RGB color value.
int GetTextureUnit()
Return the texture unit used for this texture.
window superclass for vtkRenderWindow
virtual void SetWrapT(int)
void Modified()
Set this objects time to the current time.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
void Deactivate()
Deactivate and UnBind the texture.
abstracts an OpenGL texture object.
void Update(vtkColorTransferFunction *scalarRGB, double range[2], int filterValue, vtkOpenGLRenderWindow *renWin)
static vtkTextureObject * New()
virtual void SetMagnificationFilter(int)
vtkTextureObject * TextureObject
static vtkOpenGLVolumeRGBTable * New()
virtual unsigned int GetHandle()
Returns the OpenGL handle.
vtkOpenGLVolumeRGBTable()
int GetMaximumSupportedTextureWidth(vtkOpenGLRenderWindow *renWin, int idealWidth)
int EstimateMinNumberOfSamples(double const &x1, double const &x2)
Estimates the minimum size of a table such that it would correctly sample this function.
vtkOpenGLVolumeRGBTable * GetTable(unsigned int i)
void Create(unsigned int numberOfTables)
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()
void ReleaseGraphicsResources(vtkWindow *window)
static vtkOpenGLVolumeRGBTables * New()
void Activate()
Activate and Bind the texture.
vtkOpenGLVolumeRGBTables()=default