|  | VTK
    9.0.1
    | 
 
 
 
Go to the documentation of this file.
   25 #ifndef vtkOpenGLRenderWindow_h 
   26 #define vtkOpenGLRenderWindow_h 
   30 #include "vtkRenderingOpenGL2Module.h"  
   39 class vtkOpenGLHardwareSupport;
 
   60   void Start(
void) 
override;
 
   66   void Frame() 
override;
 
   77   static void SetGlobalMaximumNumberOfMultiSamples(
int val);
 
   78   static int GetGlobalMaximumNumberOfMultiSamples();
 
   85   unsigned char* 
GetPixelData(
int x, 
int y, 
int x2, 
int y2, 
int front, 
int right) 
override;
 
   89     int x, 
int y, 
int x2, 
int y2, 
unsigned char* 
data, 
int front, 
int right) 
override;
 
   98   float* 
GetRGBAPixelData(
int x, 
int y, 
int x2, 
int y2, 
int front, 
int right = 0) 
override;
 
  100     int x, 
int y, 
int x2, 
int y2, 
int front, 
vtkFloatArray* 
data, 
int right = 0) 
override;
 
  102     int x, 
int y, 
int x2, 
int y2, 
float* 
data, 
int front, 
int blend = 0, 
int right = 0) 
override;
 
  104     int right = 0) 
override;
 
  107     int x, 
int y, 
int x2, 
int y2, 
int front, 
int right = 0) 
override;
 
  111     int blend = 0, 
int right = 0) 
override;
 
  113     int blend = 0, 
int right = 0) 
override;
 
  121   int GetZbufferData(
int x1, 
int y1, 
int x2, 
int y2, 
float* z) 
override;
 
  123   int SetZbufferData(
int x1, 
int y1, 
int x2, 
int y2, 
float* buffer) 
override;
 
  150   bool GetUsingSRGBColorSpace();
 
  163   int GetColorBufferInternalFormat(
int attachmentPoint);
 
  181   virtual void OpenGLInit();
 
  184   virtual void OpenGLInitState();
 
  187   virtual void OpenGLInitContext();
 
  194   void GetOpenGLVersion(
int& major, 
int& minor);
 
  203   unsigned int GetBackLeftBuffer();
 
  212   unsigned int GetBackRightBuffer();
 
  221   unsigned int GetFrontLeftBuffer();
 
  230   unsigned int GetFrontRightBuffer();
 
  236   unsigned int GetBackBuffer();
 
  242   unsigned int GetFrontBuffer();
 
  281   virtual void DrawPixels(
 
  282     int x1, 
int y1, 
int x2, 
int y2, 
int numComponents, 
int dataType, 
void* 
data);
 
  288   virtual void DrawPixels(
int dstXmin, 
int dstYmin, 
int dstXmax, 
int dstYmax, 
int srcXmin,
 
  289     int srcYmin, 
int srcXmax, 
int srcYmax, 
int srcWidth, 
int srcHeight, 
int numComponents,
 
  290     int dataType, 
void* 
data);
 
  296   virtual void DrawPixels(
int srcWidth, 
int srcHeight, 
int numComponents, 
int dataType, 
void* 
data);
 
  316   int GetDefaultTextureInternalFormat(
 
  317     int vtktype, 
int numComponents, 
bool needInteger, 
bool needFloat, 
bool needSRGB);
 
  344   std::set<vtkGenericOpenGLResourceFreeCallback*> 
Resources;
 
  348     std::set<vtkGenericOpenGLResourceFreeCallback*>::iterator it = this->Resources.find(cb);
 
  349     if (it == this->Resources.end())
 
  351       this->Resources.insert(cb);
 
  357     std::set<vtkGenericOpenGLResourceFreeCallback*>::iterator it = this->Resources.find(cb);
 
  358     if (it != this->Resources.end())
 
  360       this->Resources.erase(it);
 
  389   vtkGetMacro(DefaultFrameBufferId, 
unsigned int);
 
  415   int GetNoiseTextureUnit();
 
  434   bool GetBufferNeedsResolving();
 
  452   virtual int ReadPixels(
 
  453     const vtkRecti& rect, 
int front, 
int glFormat, 
int glType, 
void* 
data, 
int right = 0);
 
  463   int CreateOffScreenFramebuffer(
int width, 
int height);
 
  469   virtual void CreateAWindow() = 0;
 
  474   virtual void DestroyWindow() = 0;
 
  484   void RestoreGLState();
 
  
virtual int SetPixelData(int, int, int, int, unsigned char *, int, int=0)
Set/Get the pixel data of an image, transmitted as RGBRGBRGB.
void SetSize(int a[2]) override
virtual float GetMaximumHardwareLineWidth()
Return the largest line width supported by the hardware.
void RegisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
unsigned int DefaultFrameBufferId
float MaximumHardwareLineWidth
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
dynamic, self-adjusting array of unsigned char
Internal class which encapsulates OpenGL FramebufferObject.
void UnregisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
vtkTextureObject * DrawPixelsTextureObject
virtual int SetRGBACharPixelData(int, int, int, int, unsigned char *, int, int=0, int=0)
unsigned int FrontRightBuffer
virtual void WaitForCompletion()
Block the thread until the actual rendering is finished().
std::string OpenGLSupportMessage
virtual int SetZbufferData(int, int, int, int, float *)
virtual void PopContext()
window superclass for vtkRenderWindow
virtual float * GetZbufferData(int, int, int, int)
Set/Get the zbuffer data from the frame buffer.
virtual void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
vtkTimeStamp ContextCreationTime
handles properties associated with a texture map
allocate/free texture units.
virtual unsigned char * GetRGBACharPixelData(int, int, int, int, int, int=0)
virtual void StereoMidpoint()
Intermediate method performs operations required between the rendering of the left and right eye.
virtual void ReleaseRGBAPixelData(float *)
virtual int GetColorBufferSizes(int *)
Get the size of the color buffer.
The ShaderProgram uses one or more Shader objects.
int OwnContext
Flag telling if the context has been created here or was inherited.
void MakeCurrent() override
Attempt to make this window the current graphics context for the calling thread.
a simple class to control print indentation
abstracts an OpenGL texture object.
void Render() override
Ask each renderer owned by this RenderWindow to render its image and synchronize this process.
unsigned int FrontLeftBuffer
vtkTextureObject * NoiseTextureObject
list of point or cell ids
virtual vtkOpenGLState * GetState()
virtual float * GetRGBAPixelData(int, int, int, int, int, int=0)
Same as Get/SetPixelData except that the image also contains an alpha component.
manage Shader Programs within a context
virtual const char * ReportCapabilities()
Get report of capabilities for the render window.
virtual bool IsPointSpriteBugPresent()
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
virtual void Frame()
A termination method performed at the end of the rendering process to do things like swapping buffers...
virtual int GetDepthBufferSize()
This method should be defined by the subclass.
virtual void End()
Update the system, if needed, at end of render process.
virtual void Start()
Start the rendering process for a frame.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned int BackRightBuffer
manage vertex buffer objects shared within a context
std::map< std::string, int > GLStateIntegers
virtual unsigned char * GetPixelData(int, int, int, int, int, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
unsigned int BackLeftBuffer
virtual int SupportsOpenGL()
Does this render window support OpenGL? 0-false, 1-true.
virtual int SetRGBAPixelData(int, int, int, int, float *, int, int=0, int=0)
create a window for renderers to draw into
virtual bool InitializeFromCurrentContext()
Initialize the render window from the information associated with the currently activated OpenGL cont...
vtkOpenGLFramebufferObject * OffScreenFramebuffer
virtual const char * GetRenderingBackend()
What rendering backend has the user requested.
Wrapper around std::string to keep symbols short.
vtkOpenGLBufferObject * TQuad2DVBO
virtual void PushContext()
Ability to push and pop this window's context as the current context.
std::set< vtkGenericOpenGLResourceFreeCallback * > Resources
The VertexArrayObject class uses, or emulates, vertex array objects.
virtual void Initialize(void)
Initialize the rendering window.
vtkTypeUInt32 vtkMTimeType