VTK  9.1.0
vtkWindow.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkWindow.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
35#ifndef vtkWindow_h
36#define vtkWindow_h
37
38#include "vtkCommonCoreModule.h" // For export macro
39#include "vtkObject.h"
40
41class vtkImageData;
43
44class VTKCOMMONCORE_EXPORT vtkWindow : public vtkObject
45{
46public:
47 vtkTypeMacro(vtkWindow, vtkObject);
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
51
55 virtual void SetDisplayId(void*) {}
56 virtual void SetWindowId(void*) {}
57 virtual void SetParentId(void*) {}
58 virtual void* GetGenericDisplayId() { return nullptr; }
59 virtual void* GetGenericWindowId() { return nullptr; }
60 virtual void* GetGenericParentId() { return nullptr; }
61 virtual void* GetGenericContext() { return nullptr; }
62 virtual void* GetGenericDrawable() { return nullptr; }
63 virtual void SetWindowInfo(const char*) {}
64 virtual void SetParentInfo(const char*) {}
66
68
72 virtual int* GetPosition() VTK_SIZEHINT(2);
73
79 virtual void SetPosition(int x, int y);
80 virtual void SetPosition(int a[2]);
82
84
88 virtual int* GetSize() VTK_SIZEHINT(2);
89
98 virtual void SetSize(int width, int height);
99 virtual void SetSize(int a[2]);
101
106 int* GetActualSize() VTK_SIZEHINT(2);
107
111 virtual int* GetScreenSize() VTK_SIZEHINT(2) { return nullptr; }
112
114
117 vtkGetMacro(Mapped, vtkTypeBool);
119
121
124 vtkGetMacro(ShowWindow, bool);
125 vtkSetMacro(ShowWindow, bool);
126 vtkBooleanMacro(ShowWindow, bool);
128
130
135 vtkSetMacro(UseOffScreenBuffers, bool);
136 vtkGetMacro(UseOffScreenBuffers, bool);
137 vtkBooleanMacro(UseOffScreenBuffers, bool);
139
141
147 vtkSetMacro(Erase, vtkTypeBool);
148 vtkGetMacro(Erase, vtkTypeBool);
149 vtkBooleanMacro(Erase, vtkTypeBool);
151
153
156 vtkSetMacro(DoubleBuffer, vtkTypeBool);
157 vtkGetMacro(DoubleBuffer, vtkTypeBool);
158 vtkBooleanMacro(DoubleBuffer, vtkTypeBool);
160
162
165 vtkGetStringMacro(WindowName);
166 vtkSetStringMacro(WindowName);
168
173 virtual void SetIcon(vtkImageData*) {}
174
179 virtual void Render() {}
180
187
189
201 virtual unsigned char* GetPixelData(
202 int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, int /*front*/, int /*right*/ = 0)
203 {
204 return nullptr;
205 }
206 virtual int GetPixelData(int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, int /*front*/,
207 vtkUnsignedCharArray* /*data*/, int /*right*/ = 0)
208 {
209 return 0;
210 }
212
214
218 vtkGetMacro(DPI, int);
219 vtkSetClampMacro(DPI, int, 1, VTK_INT_MAX);
221
228 virtual bool DetectDPI() { return false; }
229
231
235 {
236 this->SetShowWindow(val == 0);
237 this->SetUseOffScreenBuffers(val != 0);
238 }
239 vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
241
246 vtkTypeBool GetOffScreenRendering() { return this->GetShowWindow() ? 0 : 1; }
247
252 virtual void MakeCurrent() {}
253
258 virtual void ReleaseCurrent() {}
259
261
267 vtkSetVector2Macro(TileScale, int);
268 vtkGetVector2Macro(TileScale, int);
269 void SetTileScale(int s) { this->SetTileScale(s, s); }
270 vtkSetVector4Macro(TileViewport, double);
271 vtkGetVector4Macro(TileViewport, double);
273
274protected:
276 ~vtkWindow() override;
277
279 int Size[2];
280 int Position[2];
286 int DPI;
287
288 double TileViewport[4];
289 int TileSize[2];
290 int TileScale[2];
291
292private:
293 vtkWindow(const vtkWindow&) = delete;
294 void operator=(const vtkWindow&) = delete;
295};
296
297#endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:57
a simple class to control print indentation
Definition: vtkIndent.h:43
abstract base class for most VTK objects
Definition: vtkObject.h:63
dynamic, self-adjusting array of unsigned char
window superclass for vtkRenderWindow
Definition: vtkWindow.h:45
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:62
virtual unsigned char * GetPixelData(int, int, int, int, int, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
Definition: vtkWindow.h:201
bool UseOffScreenBuffers
Definition: vtkWindow.h:283
virtual bool DetectDPI()
Attempt to detect and set the DPI of the display device by querying the system.
Definition: vtkWindow.h:228
vtkTypeBool GetOffScreenRendering()
Deprecated, directly use GetShowWindow and GetOffScreenBuffers instead.
Definition: vtkWindow.h:246
virtual void SetIcon(vtkImageData *)
Set the icon used in title bar and task bar.
Definition: vtkWindow.h:173
virtual void * GetGenericWindowId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:59
virtual void SetWindowInfo(const char *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:63
virtual void ReleaseCurrent()
Release the current context.
Definition: vtkWindow.h:258
virtual void * GetGenericContext()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:61
vtkTypeBool DoubleBuffer
Definition: vtkWindow.h:285
~vtkWindow() override
virtual void * GetGenericParentId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:60
virtual int GetPixelData(int, int, int, int, int, vtkUnsignedCharArray *, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
Definition: vtkWindow.h:206
virtual void * GetGenericDisplayId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:58
virtual void SetDisplayId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:55
void SetOffScreenRendering(vtkTypeBool val)
Convenience to set SHowWindow and UseOffScreenBuffers in one call.
Definition: vtkWindow.h:234
vtkTypeBool Mapped
Definition: vtkWindow.h:281
vtkTypeBool Erase
Definition: vtkWindow.h:284
bool ShowWindow
Definition: vtkWindow.h:282
char * WindowName
Definition: vtkWindow.h:278
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:64
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
Definition: vtkWindow.h:186
virtual void Render()
Ask each viewport owned by this Window to render its image and synchronize this process.
Definition: vtkWindow.h:179
virtual void SetParentId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:57
void SetTileScale(int s)
These methods are used by vtkWindowToImageFilter to tell a VTK window to simulate a larger window by ...
Definition: vtkWindow.h:269
virtual void MakeCurrent()
Make the window current.
Definition: vtkWindow.h:252
virtual void SetWindowId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:56
@ height
Definition: vtkX3D.h:260
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_INT_MAX
Definition: vtkType.h:155
#define VTK_SIZEHINT(...)