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
vtkOpenGLVolumeRGBTable()
size_t GetNumberOfTables()
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...
int GetMaximumSupportedTextureWidth(vtkOpenGLRenderWindow *renWin, int idealWidth)
abstract base class for most VTK objects
void ReleaseGraphicsResources(vtkWindow *window)
record modification and/or execution time
void Modified()
Set this objects time to the current time.
void Update(vtkColorTransferFunction *scalarRGB, double range[2], int filterValue, vtkOpenGLRenderWindow *renWin)
void Activate()
Activate and Bind the texture.
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].
window superclass for vtkRenderWindow
vtkTextureObject * TextureObject
static int NearestPowerOfTwo(int x)
Compute the nearest power of two that is not less than x.
~vtkOpenGLVolumeRGBTable() override
virtual void SetMinificationFilter(int)
Minification filter mode.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
~vtkOpenGLVolumeRGBTables()
virtual unsigned int GetHandle()
Returns the OpenGL handle.
vtkOpenGLVolumeRGBTable * GetTable(unsigned int i)
int EstimateMinNumberOfSamples(double const &x1, double const &x2)
Estimates the minimum size of a table such that it would correctly sample this function.
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...
Defines a transfer function for mapping a property to an RGB color value.
void ReleaseGraphicsResources(vtkWindow *win)
Deactivate and UnBind the texture.
void Deactivate()
Deactivate and UnBind the texture.
static vtkTextureObject * New()
virtual void SetWrapS(int)
Wrap mode for the first texture coordinate "s" Valid values are:
void ReleaseGraphicsResources(vtkWindow *window)
int NumberOfColorComponents
static vtkOpenGLVolumeRGBTable * New()
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:
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.
virtual void SetMagnificationFilter(int)
Magnification filter mode.