|
virtual vtkTypeBool | IsA (const char *type) |
| Return 1 if this class is the same type of (or a subclass of) the named class. More...
|
|
vtkOpenGLState * | NewInstance () const |
|
void | GetBlendFuncState (int *) |
|
bool | GetEnumState (unsigned int name) |
|
void | SetEnumState (unsigned int name, bool value) |
|
void | ResetEnumState (unsigned int name) |
| convenience method to reset an enum state from current openGL context More...
|
|
void | ActivateTexture (vtkTextureObject *) |
| Activate a texture unit for this texture. More...
|
|
void | DeactivateTexture (vtkTextureObject *) |
| Deactivate a previously activated texture. More...
|
|
int | GetTextureUnitForTexture (vtkTextureObject *) |
| Get the texture unit for a given texture object. More...
|
|
void | VerifyNoActiveTextures () |
| Check to make sure no textures have been left active. More...
|
|
void | Initialize (vtkOpenGLRenderWindow *) |
| Initialize OpenGL context using current state. More...
|
|
void | SetTextureUnitManager (vtkTextureUnitManager *textureUnitManager) |
| Set the texture unit manager. More...
|
|
vtkTextureUnitManager * | GetTextureUnitManager () |
| Returns its texture unit manager object. More...
|
|
virtual vtkOpenGLShaderCache * | GetShaderCache () |
|
virtual vtkOpenGLVertexBufferObjectCache * | GetVBOCache () |
|
void | SetVBOCache (vtkOpenGLVertexBufferObjectCache *val) |
|
int | GetDefaultTextureInternalFormat (int vtktype, int numComponents, bool needInteger, bool needFloat, bool needSRGB) |
| Get a mapping of vtk data types to native texture formats for this window we put this on the RenderWindow so that every texture does not have to build these structures themselves. More...
|
|
|
void | vtkglClearColor (float red, float green, float blue, float alpha) |
|
void | vtkglClearDepth (double depth) |
|
void | vtkglDepthFunc (unsigned int val) |
|
void | vtkglDepthMask (unsigned char flag) |
|
void | vtkglColorMask (unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
|
void | vtkglViewport (int x, int y, int width, int height) |
|
void | vtkglScissor (int x, int y, int width, int height) |
|
void | vtkglEnable (unsigned int cap) |
|
void | vtkglDisable (unsigned int cap) |
|
void | vtkglBlendFunc (unsigned int sfactor, unsigned int dfactor) |
|
void | vtkglBlendFuncSeparate (unsigned int sfactorRGB, unsigned int dfactorRGB, unsigned int sfactorAlpha, unsigned int dfactorAlpha) |
|
void | vtkglBlendEquation (unsigned int val) |
|
void | vtkglBlendEquationSeparate (unsigned int col, unsigned int alpha) |
|
void | vtkglCullFace (unsigned int val) |
|
void | vtkglActiveTexture (unsigned int) |
|
void | vtkglBindFramebuffer (unsigned int target, unsigned int fb) |
|
void | vtkglDrawBuffer (unsigned int) |
|
void | vtkglDrawBuffers (unsigned int n, unsigned int *) |
|
void | vtkglReadBuffer (unsigned int) |
|
void | vtkBindFramebuffer (unsigned int target, vtkOpenGLFramebufferObject *fo) |
|
void | vtkDrawBuffers (unsigned int n, unsigned int *, vtkOpenGLFramebufferObject *) |
|
void | vtkReadBuffer (unsigned int, vtkOpenGLFramebufferObject *) |
|
|
void | ResetGLClearColorState () |
|
void | ResetGLClearDepthState () |
|
void | ResetGLDepthFuncState () |
|
void | ResetGLDepthMaskState () |
|
void | ResetGLColorMaskState () |
|
void | ResetGLViewportState () |
|
void | ResetGLScissorState () |
|
void | ResetGLBlendFuncState () |
|
void | ResetGLBlendEquationState () |
|
void | ResetGLCullFaceState () |
|
void | ResetGLActiveTexture () |
|
|
void | vtkglClear (unsigned int mask) |
|
|
void | vtkglGetBooleanv (unsigned int pname, unsigned char *params) |
|
void | vtkglGetIntegerv (unsigned int pname, int *params) |
|
void | vtkglGetDoublev (unsigned int pname, double *params) |
|
void | vtkglGetFloatv (unsigned int pname, float *params) |
|
|
void | PushFramebufferBindings () |
| Store/Restore the current framebuffer bindings and buffers. More...
|
|
void | PushDrawFramebufferBinding () |
| Store/Restore the current framebuffer bindings and buffers. More...
|
|
void | PushReadFramebufferBinding () |
| Store/Restore the current framebuffer bindings and buffers. More...
|
|
void | PopFramebufferBindings () |
| Store/Restore the current framebuffer bindings and buffers. More...
|
|
void | PopDrawFramebufferBinding () |
| Store/Restore the current framebuffer bindings and buffers. More...
|
|
void | PopReadFramebufferBinding () |
| Store/Restore the current framebuffer bindings and buffers. More...
|
|
void | ResetFramebufferBindings () |
| Store/Restore the current framebuffer bindings and buffers. More...
|
|
| vtkBaseTypeMacro (vtkObject, vtkObjectBase) |
|
virtual void | DebugOn () |
| Turn debugging output on. More...
|
|
virtual void | DebugOff () |
| Turn debugging output off. More...
|
|
bool | GetDebug () |
| Get the value of the debug flag. More...
|
|
void | SetDebug (bool debugFlag) |
| Set the value of the debug flag. More...
|
|
virtual void | Modified () |
| Update the modification time for this object. More...
|
|
virtual vtkMTimeType | GetMTime () |
| Return this object's modified time. More...
|
|
void | PrintSelf (ostream &os, vtkIndent indent) override |
| Methods invoked by print to print information about the object including superclasses. More...
|
|
void | RemoveObserver (unsigned long tag) |
|
void | RemoveObservers (unsigned long event) |
|
void | RemoveObservers (const char *event) |
|
void | RemoveAllObservers () |
|
vtkTypeBool | HasObserver (unsigned long event) |
|
vtkTypeBool | HasObserver (const char *event) |
|
int | InvokeEvent (unsigned long event) |
|
int | InvokeEvent (const char *event) |
|
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
|
|
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
|
|
vtkCommand * | GetCommand (unsigned long tag) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
|
|
void | RemoveObserver (vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
|
|
void | RemoveObservers (unsigned long event, vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
|
|
void | RemoveObservers (const char *event, vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
|
|
vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
|
|
vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
|
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
| Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
|
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
| Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
|
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
| Allow user to set the AbortFlagOn() with the return value of the callback method. More...
|
|
int | InvokeEvent (unsigned long event, void *callData) |
| This method invokes an event and return whether the event was aborted or not. More...
|
|
int | InvokeEvent (const char *event, void *callData) |
| This method invokes an event and return whether the event was aborted or not. More...
|
|
const char * | GetClassName () const |
| Return the class name as a string. More...
|
|
virtual vtkIdType | GetNumberOfGenerationsFromBase (const char *name) |
| Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). More...
|
|
virtual void | Delete () |
| Delete a VTK object. More...
|
|
virtual void | FastDelete () |
| Delete a reference to this object. More...
|
|
void | InitializeObjectBase () |
|
void | Print (ostream &os) |
| Print an object to an ostream. More...
|
|
virtual void | Register (vtkObjectBase *o) |
| Increase the reference count (mark as used by another object). More...
|
|
virtual void | UnRegister (vtkObjectBase *o) |
| Decrease the reference count (release by another object). More...
|
|
int | GetReferenceCount () |
| Return the current reference count of this object. More...
|
|
void | SetReferenceCount (int) |
| Sets the reference count. More...
|
|
void | PrintRevisions (ostream &) |
| Legacy. More...
|
|
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
| Methods invoked by print to print information about the object including superclasses. More...
|
|
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
| Methods invoked by print to print information about the object including superclasses. More...
|
|
OpenGL state storage.
vtkOpenGLState is a class designed to keep track of the state of an OpenGL context. Applications using VTK have so much control over the rendering process that is can be difficult in VTK code to know if the OpenGL state is correct for your code. The two traditional solutions have been to set everything yourself and to save and restore OpenGL state that you change. The former makes your code work, the latter helps prevent your code from breaking something else. The problem is that the former results in tons of redundant OpenGL calls and the later is done by querying the OpenGL state which can cause a pipeline sync/stall which is very slow.
To address these issues this class stores OpenGL state for commonly used functions. Requests made to change state to the current state become no-ops. Queries of state can be done by querying the state stored in this class without impacting the OpenGL driver.
This class is designed to hold all context related values and could just as well be considered a representation of the OpenGL context.
To facilitate saving state and restoring it this class contains a number of nested classes named Scoped<glFunction> that store the state of that glFunction and when they go out of scope they restore it. This is useful when you want to change the OpenGL state and then automatically restore it when done. They can be used as follows
{ vtkOpenGLState *ostate = renWin->GetState(); vtkOpenGLState::ScopedglDepthMask dmsaved(ostate); // the prior state is now saved ... ostate->glDepthMask(GL_TRUE); // maybe change the state ... etc } // prior state will be restored here as it goes out of scope
You must use this class to make state changing OpenGL class otherwise the results will be undefined.
For convenience some OpenGL calls that do not impact state are also provided.
Definition at line 79 of file vtkOpenGLState.h.