 |
VTK
9.1.0
|
Go to the documentation of this file.
54 #ifndef vtkOpenGLRenderWindow_h
55 #define vtkOpenGLRenderWindow_h
60 #include "vtkRenderingOpenGL2Module.h"
69 class vtkOpenGLHardwareSupport;
118 unsigned char*
GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right)
override;
122 int x,
int y,
int x2,
int y2,
unsigned char*
data,
int front,
int right)
override;
133 int x,
int y,
int x2,
int y2,
int front,
vtkFloatArray*
data,
int right = 0)
override;
135 int x,
int y,
int x2,
int y2,
float*
data,
int front,
int blend = 0,
int right = 0)
override;
137 int right = 0)
override;
140 int x,
int y,
int x2,
int y2,
int front,
int right = 0)
override;
144 int blend = 0,
int right = 0)
override;
146 int blend = 0,
int right = 0)
override;
218 unsigned
int GetBackLeftBuffer();
220 unsigned int GetBackRightBuffer();
222 unsigned int GetFrontLeftBuffer();
224 unsigned int GetFrontRightBuffer();
226 unsigned int GetBackBuffer();
228 unsigned int GetFrontBuffer();
276 int x1,
int y1,
int x2,
int y2,
int numComponents,
int dataType,
void*
data);
282 virtual void DrawPixels(
int dstXmin,
int dstYmin,
int dstXmax,
int dstYmax,
int srcXmin,
283 int srcYmin,
int srcXmax,
int srcYmax,
int srcWidth,
int srcHeight,
int numComponents,
284 int dataType,
void*
data);
290 virtual void DrawPixels(
int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void*
data);
311 int vtktype,
int numComponents,
bool needInteger,
bool needFloat,
bool needSRGB);
338 std::set<vtkGenericOpenGLResourceFreeCallback*>
Resources;
342 std::set<vtkGenericOpenGLResourceFreeCallback*>::iterator it = this->Resources.find(cb);
343 if (it == this->Resources.end())
345 this->Resources.insert(cb);
351 std::set<vtkGenericOpenGLResourceFreeCallback*>::iterator it = this->Resources.find(cb);
352 if (it != this->Resources.end())
354 this->Resources.erase(it);
436 int destY,
int destWidth,
int destHeight,
int bufferMode,
int interpolation);
445 int destY,
int destWidth,
int destHeight,
int bufferMode,
int interpolation);
485 int destX,
int destY,
int destX2,
int destY2);
511 const vtkRecti& rect,
int front,
int glFormat,
int glType,
void*
data,
int right = 0);
void StereoMidpoint() override
Intermediate method performs operations required between the rendering of the left and right eye.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void OpenGLInit()
Initialize OpenGL for this window.
vtkOpenGLFramebufferObject * DisplayFramebuffer
void GetOpenGLVersion(int &major, int &minor)
Get the major and minor version numbers of the OpenGL context we are using ala 3.2,...
virtual void BlitDisplayFramebuffersToHardware()
virtual float GetMaximumHardwareLineWidth()
Return the largest line width supported by the hardware.
void RegisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
void ActivateTexture(vtkTextureObject *)
Activate a texture unit for this texture.
virtual void DrawPixels(int x1, int y1, int x2, int y2, int numComponents, int dataType, void *data)
Replacement for the old glDrawPixels function.
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
int SetRGBAPixelData(int x, int y, int x2, int y2, vtkFloatArray *data, int front, int blend=0, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
vtkOpenGLBufferObject * GetTQuad2DVBO()
int GetColorBufferSizes(int *rgba) override
Get the size of the color buffer.
float MaximumHardwareLineWidth
virtual void DrawPixels(int srcWidth, int srcHeight, int numComponents, int dataType, void *data)
Replacement for the old glDrawPixels function.
dynamic, self-adjusting array of float
virtual bool SetSwapControl(int)
Set the number of vertical syncs required between frames.
std::string GetOpenGLSupportMessage()
Return a message profiding additional details about the results of calling SupportsOpenGL() This can ...
record modification and/or execution time
int CreateFramebuffers(int width, int height)
Create the offScreen framebuffer Return if the creation was successful or not.
vtkOpenGLQuadHelper * ResolveQuad
dynamic, self-adjusting array of unsigned char
void BlitToRenderFramebuffer(bool includeDepth)
Blit the currently bound read buffer to the renderbuffer.
Internal class which encapsulates OpenGL FramebufferObject.
virtual int ReadPixels(const vtkRecti &rect, int front, int glFormat, int glType, void *data, int right=0)
int SetPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int right) override
Set/Get the pixel data of an image, transmitted as RGBRGB...
int GetPixelData(int x, int y, int x2, int y2, int front, vtkUnsignedCharArray *data, int right) override
Set/Get the pixel data of an image, transmitted as RGBRGB...
void BlitDisplayFramebuffer()
Blit a display framebuffer into a currently bound draw destination.
#define VTK_DEPRECATED_IN_9_1_0(reason)
void UnregisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
vtkTextureObject * DrawPixelsTextureObject
Class to make rendering a full screen quad easier.
bool GetBufferNeedsResolving()
vtkOpenGLFramebufferObject * RenderFramebuffer
int GetDepthBufferSize() override
Get the size of the depth buffer.
std::string OpenGLSupportMessage
virtual void DrawPixels(int dstXmin, int dstYmin, int dstXmax, int dstYmax, int srcXmin, int srcYmin, int srcXmax, int srcYmax, int srcWidth, int srcHeight, int numComponents, int dataType, void *data)
Replacement for the old glDrawPixels function, but it allows for scaling the data and using only part...
const char * GetRenderingBackend() override
What rendering backend has the user requested.
virtual void PopContext()
window superclass for vtkRenderWindow
float * GetRGBAPixelData(int x, int y, int x2, int y2, int front, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
void ReleaseGraphicsResources(vtkWindow *) override
Free up any graphics resources associated with this window a value of NULL means the context may alre...
void SaveGLState()
Query and save OpenGL state.
vtkTimeStamp ContextCreationTime
handles properties associated with a texture map
allocate/free texture units.
void BlitDisplayFramebuffer(int right, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, int bufferMode, int interpolation)
Blit a display buffer into a currently bound draw destination.
void DeactivateTexture(vtkTextureObject *)
Deactivate a previously activated texture.
void End() override
Update the system, if needed, at end of render process.
void Render() override
Handle opengl specific code and calls superclass.
FrameBlitModes
Define how the resulting image should be blitted when at the end of the Frame() call if SwapBuffers i...
int GetTextureUnitForTexture(vtkTextureObject *)
Get the texture unit for a given texture object.
bool InitializeFromCurrentContext() override
Initialize the render window from the information associated with the currently activated OpenGL cont...
vtkOpenGLQuadHelper * DepthBlitQuad
virtual void OpenGLInitState()
The ShaderProgram uses one or more Shader objects.
vtkOpenGLFramebufferObject * ResolveFramebuffer
int GetZbufferData(int x1, int y1, int x2, int y2, float *z) override
Set/Get the zbuffer data from an image.
void BlitToRenderFramebuffer(int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, int bufferMode, int interpolation)
Blit the currently bound read buffer to the renderbuffer.
virtual void OpenGLInitContext()
virtual void TextureDepthBlit(vtkTextureObject *source)
a simple class to control print indentation
abstracts an OpenGL texture object.
float * GetZbufferData(int x1, int y1, int x2, int y2) override
Set/Get the zbuffer data from an image.
int SetRGBACharPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int blend=0, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
vtkTextureObject * NoiseTextureObject
list of point or cell ids
void SetFrameBlitModeToBlitToHardware()
SetGet how to handle blits at the end of a Frame() call.
virtual vtkOpenGLState * GetState()
void ReleaseRGBAPixelData(float *data) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
bool GetUsingSRGBColorSpace()
Is this window/fo in sRGB colorspace.
manage Shader Programs within a context
vtkTextureUnitManager * GetTextureUnitManager()
Returns its texture unit manager object.
virtual void TextureDepthBlit(vtkTextureObject *source, int srcX, int srcY, int srcX2, int srcY2, int destX, int destY, int destX2, int destY2)
virtual bool IsPointSpriteBugPresent()
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
unsigned char * GetPixelData(int x, int y, int x2, int y2, int front, int right) override
Set/Get the pixel data of an image, transmitted as RGBRGB...
virtual void TextureDepthBlit(vtkTextureObject *source, int srcX, int srcY, int srcX2, int srcY2)
void RestoreGLState()
Restore OpenGL state at end of the rendering.
const char * ReportCapabilities() override
Get report of capabilities for the render window.
int GetRGBAPixelData(int x, int y, int x2, int y2, int front, vtkFloatArray *data, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
FrameBlitModes FrameBlitMode
virtual void MakeCurrent()
Make the window current.
int SetPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray *data, int front, int right) override
Set/Get the pixel data of an image, transmitted as RGBRGB...
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
vtkTypeBool OwnContext
Flag telling if the context has been created here or was inherited.
int GetColorBufferInternalFormat(int attachmentPoint)
Get the internal format of current attached texture or render buffer.
unsigned char * GetRGBACharPixelData(int x, int y, int x2, int y2, int front, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray *data, int front, int blend=0, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
int GetNoiseTextureUnit()
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
manage vertex buffer objects shared within a context
void SetFrameBlitModeToNoBlit()
SetGet how to handle blits at the end of a Frame() call.
static int GetGlobalMaximumNumberOfMultiSamples()
Set/Get the maximum number of multisamples.
int SetZbufferData(int x1, int y1, int x2, int y2, float *buffer) override
Set/Get the zbuffer data from an image.
std::map< std::string, int > GLStateIntegers
int SetZbufferData(int x1, int y1, int x2, int y2, vtkFloatArray *buffer) override
Set/Get the zbuffer data from an image.
int GetRGBACharPixelData(int x, int y, int x2, int y2, int front, vtkUnsignedCharArray *data, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
create a window for renderers to draw into
Wrapper around std::string to keep symbols short.
void Start(void) override
Begin the rendering process.
vtkOpenGLBufferObject * TQuad2DVBO
int GetZbufferData(int x1, int y1, int x2, int y2, vtkFloatArray *buffer) override
Set/Get the zbuffer data from an image.
static void SetGlobalMaximumNumberOfMultiSamples(int val)
Set/Get the maximum number of multisamples.
virtual void PushContext()
Ability to push and pop this window's context as the current context.
std::set< vtkGenericOpenGLResourceFreeCallback * > Resources
~vtkOpenGLRenderWindow() override
void WaitForCompletion() override
Block the thread until the actual rendering is finished().
The VertexArrayObject class uses, or emulates, vertex array objects.
void SetFrameBlitModeToBlitToCurrent()
SetGet how to handle blits at the end of a Frame() call.
virtual void Initialize(void)
Initialize the rendering window.
virtual void CreateAWindow()=0
Create a not-off-screen window.
vtkTypeUInt32 vtkMTimeType
int SetRGBAPixelData(int x, int y, int x2, int y2, float *data, int front, int blend=0, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
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 RenderWi...