VTK  9.3.0
vtkWindow.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
14#ifndef vtkWindow_h
15#define vtkWindow_h
16
17#include "vtkCommonCoreModule.h" // For export macro
18#include "vtkObject.h"
19
20VTK_ABI_NAMESPACE_BEGIN
21class vtkImageData;
23
24class VTKCOMMONCORE_EXPORT vtkWindow : public vtkObject
25{
26public:
27 vtkTypeMacro(vtkWindow, vtkObject);
28 void PrintSelf(ostream& os, vtkIndent indent) override;
29
31
35 virtual void SetDisplayId(void*) {}
36 virtual void SetWindowId(void*) {}
37 virtual void SetParentId(void*) {}
38 virtual void* GetGenericDisplayId() { return nullptr; }
39 virtual void* GetGenericWindowId() { return nullptr; }
40 virtual void* GetGenericParentId() { return nullptr; }
41 virtual void* GetGenericContext() { return nullptr; }
42 virtual void* GetGenericDrawable() { return nullptr; }
43 virtual void SetWindowInfo(const char*) {}
44 virtual void SetParentInfo(const char*) {}
46
48
52 virtual int* GetPosition() VTK_SIZEHINT(2);
53
59 virtual void SetPosition(int x, int y);
60 virtual void SetPosition(int a[2]);
62
64
68 virtual int* GetSize() VTK_SIZEHINT(2);
69
78 virtual void SetSize(int width, int height);
79 virtual void SetSize(int a[2]);
81
86 int* GetActualSize() VTK_SIZEHINT(2);
87
91 virtual int* GetScreenSize() VTK_SIZEHINT(2) { return nullptr; }
92
94
97 vtkGetMacro(Mapped, vtkTypeBool);
99
101
104 vtkGetMacro(ShowWindow, bool);
105 vtkSetMacro(ShowWindow, bool);
106 vtkBooleanMacro(ShowWindow, bool);
108
110
115 vtkSetMacro(UseOffScreenBuffers, bool);
116 vtkGetMacro(UseOffScreenBuffers, bool);
117 vtkBooleanMacro(UseOffScreenBuffers, bool);
119
121
127 vtkSetMacro(Erase, vtkTypeBool);
128 vtkGetMacro(Erase, vtkTypeBool);
129 vtkBooleanMacro(Erase, vtkTypeBool);
131
133
136 vtkSetMacro(DoubleBuffer, vtkTypeBool);
137 vtkGetMacro(DoubleBuffer, vtkTypeBool);
138 vtkBooleanMacro(DoubleBuffer, vtkTypeBool);
140
142
145 vtkGetStringMacro(WindowName);
146 vtkSetStringMacro(WindowName);
148
153 virtual void SetIcon(vtkImageData*) {}
154
159 virtual void Render() {}
160
167
169
181 virtual unsigned char* GetPixelData(
182 int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, int /*front*/, int /*right*/ = 0)
183 {
184 return nullptr;
185 }
186 virtual int GetPixelData(int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, int /*front*/,
187 vtkUnsignedCharArray* /*data*/, int /*right*/ = 0)
188 {
189 return 0;
190 }
192
194
198 vtkGetMacro(DPI, int);
199 vtkSetClampMacro(DPI, int, 1, VTK_INT_MAX);
201
208 virtual bool DetectDPI() { return false; }
209
211
215 {
216 this->SetShowWindow(val == 0);
217 this->SetUseOffScreenBuffers(val != 0);
218 }
219 vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
221
226 vtkTypeBool GetOffScreenRendering() { return this->GetShowWindow() ? 0 : 1; }
227
232 virtual void MakeCurrent() {}
233
238 virtual void ReleaseCurrent() {}
239
241
247 vtkSetVector2Macro(TileScale, int);
248 vtkGetVector2Macro(TileScale, int);
249 void SetTileScale(int s) { this->SetTileScale(s, s); }
250 vtkSetVector4Macro(TileViewport, double);
251 vtkGetVector4Macro(TileViewport, double);
253
254protected:
256 ~vtkWindow() override;
257
259 int Size[2];
260 int Position[2];
266 int DPI;
267
268 double TileViewport[4];
269 int TileSize[2];
270 int TileScale[2];
271
272private:
273 vtkWindow(const vtkWindow&) = delete;
274 void operator=(const vtkWindow&) = delete;
275};
276
277VTK_ABI_NAMESPACE_END
278#endif
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:29
abstract base class for most VTK objects
Definition vtkObject.h:49
dynamic, self-adjusting array of unsigned char
window superclass for vtkRenderWindow
Definition vtkWindow.h:25
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void * GetGenericDrawable()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:42
virtual unsigned char * GetPixelData(int, int, int, int, int, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
Definition vtkWindow.h:181
bool UseOffScreenBuffers
Definition vtkWindow.h:263
virtual bool DetectDPI()
Attempt to detect and set the DPI of the display device by querying the system.
Definition vtkWindow.h:208
vtkTypeBool GetOffScreenRendering()
Deprecated, directly use GetShowWindow and GetOffScreenBuffers instead.
Definition vtkWindow.h:226
virtual void SetIcon(vtkImageData *)
Set the icon used in title bar and task bar.
Definition vtkWindow.h:153
virtual void * GetGenericWindowId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:39
virtual void SetWindowInfo(const char *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:43
virtual void ReleaseCurrent()
Release the current context.
Definition vtkWindow.h:238
virtual void * GetGenericContext()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:41
vtkTypeBool DoubleBuffer
Definition vtkWindow.h:265
~vtkWindow() override
virtual void * GetGenericParentId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:40
virtual int GetPixelData(int, int, int, int, int, vtkUnsignedCharArray *, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
Definition vtkWindow.h:186
virtual void * GetGenericDisplayId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:38
virtual void SetDisplayId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:35
void SetOffScreenRendering(vtkTypeBool val)
Convenience to set SHowWindow and UseOffScreenBuffers in one call.
Definition vtkWindow.h:214
vtkTypeBool Mapped
Definition vtkWindow.h:261
vtkTypeBool Erase
Definition vtkWindow.h:264
bool ShowWindow
Definition vtkWindow.h:262
char * WindowName
Definition vtkWindow.h:258
virtual int * GetPosition()
Get the position (x and y) of the rendering window in screen coordinates (in pixels).
virtual void SetParentInfo(const char *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:44
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
Definition vtkWindow.h:166
virtual void Render()
Ask each viewport owned by this Window to render its image and synchronize this process.
Definition vtkWindow.h:159
virtual void SetParentId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:37
void SetTileScale(int s)
These methods are used by vtkWindowToImageFilter to tell a VTK window to simulate a larger window by ...
Definition vtkWindow.h:249
virtual void MakeCurrent()
Make the window current.
Definition vtkWindow.h:232
virtual void SetWindowId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:36
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_INT_MAX
Definition vtkType.h:144
#define VTK_SIZEHINT(...)