VTK  9.3.20240419
vtkAbstractContextBufferId.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
26 #ifndef vtkAbstractContextBufferId_h
27 #define vtkAbstractContextBufferId_h
28 
29 #include "vtkObject.h"
30 #include "vtkRenderingContext2DModule.h" // For export macro
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkRenderWindow;
34 
35 class VTKRENDERINGCONTEXT2D_EXPORT vtkAbstractContextBufferId : public vtkObject
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
44 
47  vtkGetMacro(Width, int);
49 
51 
54  vtkSetMacro(Width, int);
56 
58 
61  vtkGetMacro(Height, int);
63 
65 
68  vtkSetMacro(Height, int);
70 
72 
75  virtual void SetContext(vtkRenderWindow* context) = 0;
76  virtual vtkRenderWindow* GetContext() = 0;
78 
83  virtual bool IsSupported() = 0;
84 
90  virtual void Allocate() = 0;
91 
95  virtual bool IsAllocated() const = 0;
96 
102  virtual void SetValues(int srcXmin, int srcYmin) = 0;
103 
112  virtual vtkIdType GetPickedItem(int x, int y) = 0;
113 
118  virtual void ReleaseGraphicsResources();
119 
120 protected:
123 
124  int Width;
125  int Height;
126 
127 private:
129  void operator=(const vtkAbstractContextBufferId&) = delete;
130 };
131 
132 VTK_ABI_NAMESPACE_END
133 #endif // #ifndef vtkAbstractContextBufferId_h
2D array of ids, used for picking.
virtual bool IsSupported()=0
Returns if the context supports the required extensions.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkIdType GetPickedItem(int x, int y)=0
Return item under abscissa x and ordinate y.
virtual void ReleaseGraphicsResources()
Release any graphics resources that are being consumed by this object.
virtual vtkRenderWindow * GetContext()=0
Set/Get the OpenGL context owning the texture object resource.
virtual void SetValues(int srcXmin, int srcYmin)=0
Copy the contents of the current read buffer to the internal structure starting at lower left corner ...
virtual bool IsAllocated() const =0
Tell if the buffer has been allocated.
~vtkAbstractContextBufferId() override
static vtkAbstractContextBufferId * New()
virtual void SetContext(vtkRenderWindow *context)=0
Set/Get the OpenGL context owning the texture object resource.
virtual void Allocate()=0
Allocate the memory for at least Width*Height elements.
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
create a window for renderers to draw into
int vtkIdType
Definition: vtkType.h:315