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
23#ifndef vtkWindow_h
24#define vtkWindow_h
25
26#include "vtkCommonCoreModule.h" // For export macro
27#include "vtkObject.h"
28
29VTK_ABI_NAMESPACE_BEGIN
30class vtkImageData;
32
33class VTKCOMMONCORE_EXPORT vtkWindow : public vtkObject
34{
35public:
36 vtkTypeMacro(vtkWindow, vtkObject);
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
40
44 virtual void SetDisplayId(void*) {}
45 virtual void SetWindowId(void*) {}
46 virtual void SetParentId(void*) {}
47 virtual void* GetGenericDisplayId() { return nullptr; }
48 virtual void* GetGenericWindowId() { return nullptr; }
49 virtual void* GetGenericParentId() { return nullptr; }
50 virtual void* GetGenericContext() { return nullptr; }
51 virtual void* GetGenericDrawable() { return nullptr; }
52 virtual void SetWindowInfo(const char*) {}
53 virtual void SetParentInfo(const char*) {}
55
57
61 virtual int* GetPosition() VTK_SIZEHINT(2);
62
68 virtual void SetPosition(int x, int y);
69 virtual void SetPosition(int a[2]);
71
73
77 virtual int* GetSize() VTK_SIZEHINT(2);
78
87 virtual void SetSize(int width, int height);
88 virtual void SetSize(int a[2]);
90
95 int* GetActualSize() VTK_SIZEHINT(2);
96
100 virtual int* GetScreenSize() VTK_SIZEHINT(2) { return nullptr; }
101
103
106 vtkGetMacro(Mapped, vtkTypeBool);
108
110
113 vtkGetMacro(ShowWindow, bool);
114 vtkSetMacro(ShowWindow, bool);
115 vtkBooleanMacro(ShowWindow, bool);
117
119
124 vtkSetMacro(UseOffScreenBuffers, bool);
125 vtkGetMacro(UseOffScreenBuffers, bool);
126 vtkBooleanMacro(UseOffScreenBuffers, bool);
128
130
136 vtkSetMacro(Erase, vtkTypeBool);
137 vtkGetMacro(Erase, vtkTypeBool);
138 vtkBooleanMacro(Erase, vtkTypeBool);
140
142
145 vtkSetMacro(DoubleBuffer, vtkTypeBool);
146 vtkGetMacro(DoubleBuffer, vtkTypeBool);
147 vtkBooleanMacro(DoubleBuffer, vtkTypeBool);
149
151
154 vtkGetStringMacro(WindowName);
155 vtkSetStringMacro(WindowName);
157
162 virtual void SetIcon(vtkImageData*) {}
163
168 virtual void Render() {}
169
176
178
190 virtual unsigned char* GetPixelData(
191 int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, int /*front*/, int /*right*/ = 0)
192 {
193 return nullptr;
194 }
195 virtual int GetPixelData(int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, int /*front*/,
196 vtkUnsignedCharArray* /*data*/, int /*right*/ = 0)
197 {
198 return 0;
199 }
201
203
207 vtkGetMacro(DPI, int);
208 vtkSetClampMacro(DPI, int, 1, VTK_INT_MAX);
210
217 virtual bool DetectDPI() { return false; }
218
220
224 {
225 this->SetShowWindow(val == 0);
226 this->SetUseOffScreenBuffers(val != 0);
227 }
228 vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
230
235 vtkTypeBool GetOffScreenRendering() { return this->GetShowWindow() ? 0 : 1; }
236
241 virtual void MakeCurrent() {}
242
247 virtual void ReleaseCurrent() {}
248
250
256 vtkSetVector2Macro(TileScale, int);
257 vtkGetVector2Macro(TileScale, int);
258 void SetTileScale(int s) { this->SetTileScale(s, s); }
259 vtkSetVector4Macro(TileViewport, double);
260 vtkGetVector4Macro(TileViewport, double);
262
263protected:
265 ~vtkWindow() override;
266
268 int Size[2];
269 int Position[2];
275 int DPI;
276
277 double TileViewport[4];
278 int TileSize[2];
279 int TileScale[2];
280
281private:
282 vtkWindow(const vtkWindow&) = delete;
283 void operator=(const vtkWindow&) = delete;
284};
285
286VTK_ABI_NAMESPACE_END
287#endif
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:38
abstract base class for most VTK objects
Definition vtkObject.h:58
dynamic, self-adjusting array of unsigned char
window superclass for vtkRenderWindow
Definition vtkWindow.h:34
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:51
virtual unsigned char * GetPixelData(int, int, int, int, int, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
Definition vtkWindow.h:190
bool UseOffScreenBuffers
Definition vtkWindow.h:272
virtual bool DetectDPI()
Attempt to detect and set the DPI of the display device by querying the system.
Definition vtkWindow.h:217
vtkTypeBool GetOffScreenRendering()
Deprecated, directly use GetShowWindow and GetOffScreenBuffers instead.
Definition vtkWindow.h:235
virtual void SetIcon(vtkImageData *)
Set the icon used in title bar and task bar.
Definition vtkWindow.h:162
virtual void * GetGenericWindowId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:48
virtual void SetWindowInfo(const char *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:52
virtual void ReleaseCurrent()
Release the current context.
Definition vtkWindow.h:247
virtual void * GetGenericContext()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:50
vtkTypeBool DoubleBuffer
Definition vtkWindow.h:274
~vtkWindow() override
virtual void * GetGenericParentId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:49
virtual int GetPixelData(int, int, int, int, int, vtkUnsignedCharArray *, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
Definition vtkWindow.h:195
virtual void * GetGenericDisplayId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:47
virtual void SetDisplayId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:44
void SetOffScreenRendering(vtkTypeBool val)
Convenience to set SHowWindow and UseOffScreenBuffers in one call.
Definition vtkWindow.h:223
vtkTypeBool Mapped
Definition vtkWindow.h:270
vtkTypeBool Erase
Definition vtkWindow.h:273
bool ShowWindow
Definition vtkWindow.h:271
char * WindowName
Definition vtkWindow.h:267
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:53
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
Definition vtkWindow.h:175
virtual void Render()
Ask each viewport owned by this Window to render its image and synchronize this process.
Definition vtkWindow.h:168
virtual void SetParentId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:46
void SetTileScale(int s)
These methods are used by vtkWindowToImageFilter to tell a VTK window to simulate a larger window by ...
Definition vtkWindow.h:258
virtual void MakeCurrent()
Make the window current.
Definition vtkWindow.h:241
virtual void SetWindowId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition vtkWindow.h:45
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_INT_MAX
Definition vtkType.h:144
#define VTK_SIZEHINT(...)