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=========================================================================*/
26#ifndef vtkWindow_h
27#define vtkWindow_h
28
29#include "vtkCommonCoreModule.h" // For export macro
30#include "vtkObject.h"
31
32class vtkImageData;
34
35class VTKCOMMONCORE_EXPORT vtkWindow : public vtkObject
36{
37public:
38 vtkTypeMacro(vtkWindow, vtkObject);
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
42
46 virtual void SetDisplayId(void*) {}
47 virtual void SetWindowId(void*) {}
48 virtual void SetParentId(void*) {}
49 virtual void* GetGenericDisplayId() { return nullptr; }
50 virtual void* GetGenericWindowId() { return nullptr; }
51 virtual void* GetGenericParentId() { return nullptr; }
52 virtual void* GetGenericContext() { return nullptr; }
53 virtual void* GetGenericDrawable() { return nullptr; }
54 virtual void SetWindowInfo(const char*) {}
55 virtual void SetParentInfo(const char*) {}
57
59
63 virtual int* GetPosition() VTK_SIZEHINT(2);
64
70 virtual void SetPosition(int x, int y);
71 virtual void SetPosition(int a[2]);
73
75
79 virtual int* GetSize() VTK_SIZEHINT(2);
80
89 virtual void SetSize(int width, int height);
90 virtual void SetSize(int a[2]);
92
97 int* GetActualSize() VTK_SIZEHINT(2);
98
102 virtual int* GetScreenSize() VTK_SIZEHINT(2) { return nullptr; }
103
105
108 vtkGetMacro(Mapped, vtkTypeBool);
110
112
115 vtkGetMacro(ShowWindow, bool);
116 vtkSetMacro(ShowWindow, bool);
117 vtkBooleanMacro(ShowWindow, bool);
119
121
126 vtkSetMacro(UseOffScreenBuffers, bool);
127 vtkGetMacro(UseOffScreenBuffers, bool);
128 vtkBooleanMacro(UseOffScreenBuffers, bool);
130
132
138 vtkSetMacro(Erase, vtkTypeBool);
139 vtkGetMacro(Erase, vtkTypeBool);
140 vtkBooleanMacro(Erase, vtkTypeBool);
142
144
147 vtkSetMacro(DoubleBuffer, vtkTypeBool);
148 vtkGetMacro(DoubleBuffer, vtkTypeBool);
149 vtkBooleanMacro(DoubleBuffer, vtkTypeBool);
151
153
156 vtkGetStringMacro(WindowName);
157 vtkSetStringMacro(WindowName);
159
164 virtual void SetIcon(vtkImageData*) {}
165
170 virtual void Render() {}
171
178
180
192 virtual unsigned char* GetPixelData(
193 int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, int /*front*/, int /*right*/ = 0)
194 {
195 return nullptr;
196 }
197 virtual int GetPixelData(int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, int /*front*/,
198 vtkUnsignedCharArray* /*data*/, int /*right*/ = 0)
199 {
200 return 0;
201 }
203
205
209 vtkGetMacro(DPI, int);
210 vtkSetClampMacro(DPI, int, 1, VTK_INT_MAX);
212
219 virtual bool DetectDPI() { return false; }
220
222
226 {
227 this->SetShowWindow(val == 0);
228 this->SetUseOffScreenBuffers(val != 0);
229 }
230 vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
232
237 vtkTypeBool GetOffScreenRendering() { return this->GetShowWindow() ? 0 : 1; }
238
243 virtual void MakeCurrent() {}
244
249 virtual void ReleaseCurrent() {}
250
252
258 vtkSetVector2Macro(TileScale, int);
259 vtkGetVector2Macro(TileScale, int);
260 void SetTileScale(int s) { this->SetTileScale(s, s); }
261 vtkSetVector4Macro(TileViewport, double);
262 vtkGetVector4Macro(TileViewport, double);
264
265protected:
267 ~vtkWindow() override;
268
270 int Size[2];
271 int Position[2];
277 int DPI;
278
279 double TileViewport[4];
280 int TileSize[2];
281 int TileScale[2];
282
283private:
284 vtkWindow(const vtkWindow&) = delete;
285 void operator=(const vtkWindow&) = delete;
286};
287
288#endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
dynamic, self-adjusting array of unsigned char
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
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:53
virtual unsigned char * GetPixelData(int, int, int, int, int, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
Definition: vtkWindow.h:192
bool UseOffScreenBuffers
Definition: vtkWindow.h:274
virtual bool DetectDPI()
Attempt to detect and set the DPI of the display device by querying the system.
Definition: vtkWindow.h:219
vtkTypeBool GetOffScreenRendering()
Deprecated, directly use GetShowWindow and GetOffScreenBuffers instead.
Definition: vtkWindow.h:237
virtual void SetIcon(vtkImageData *)
Set the icon used in title bar and task bar.
Definition: vtkWindow.h:164
virtual void * GetGenericWindowId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:50
virtual void SetWindowInfo(const char *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:54
virtual void ReleaseCurrent()
Release the current context.
Definition: vtkWindow.h:249
virtual void * GetGenericContext()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:52
vtkTypeBool DoubleBuffer
Definition: vtkWindow.h:276
~vtkWindow() override
virtual void * GetGenericParentId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:51
virtual int GetPixelData(int, int, int, int, int, vtkUnsignedCharArray *, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
Definition: vtkWindow.h:197
virtual void * GetGenericDisplayId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:49
virtual void SetDisplayId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:46
void SetOffScreenRendering(vtkTypeBool val)
Convenience to set SHowWindow and UseOffScreenBuffers in one call.
Definition: vtkWindow.h:225
vtkTypeBool Mapped
Definition: vtkWindow.h:272
vtkTypeBool Erase
Definition: vtkWindow.h:275
bool ShowWindow
Definition: vtkWindow.h:273
char * WindowName
Definition: vtkWindow.h:269
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:55
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
Definition: vtkWindow.h:177
virtual void Render()
Ask each viewport owned by this Window to render its image and synchronize this process.
Definition: vtkWindow.h:170
virtual void SetParentId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:48
void SetTileScale(int s)
These methods are used by vtkWindowToImageFilter to tell a VTK window to simulate a larger window by ...
Definition: vtkWindow.h:260
virtual void MakeCurrent()
Make the window current.
Definition: vtkWindow.h:243
virtual void SetWindowId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:47
@ height
Definition: vtkX3D.h:260
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_INT_MAX
Definition: vtkType.h:155
#define VTK_SIZEHINT(...)