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=========================================================================*/
38#ifndef vtkWindow_h
39#define vtkWindow_h
40
41#include "vtkCommonCoreModule.h" // For export macro
42#include "vtkObject.h"
43
44class vtkImageData;
46
47class VTKCOMMONCORE_EXPORT vtkWindow : public vtkObject
48{
49public:
50 vtkTypeMacro(vtkWindow, vtkObject);
51 void PrintSelf(ostream& os, vtkIndent indent) override;
52
54
58 virtual void SetDisplayId(void*) {}
59 virtual void SetWindowId(void*) {}
60 virtual void SetParentId(void*) {}
61 virtual void* GetGenericDisplayId() { return nullptr; }
62 virtual void* GetGenericWindowId() { return nullptr; }
63 virtual void* GetGenericParentId() { return nullptr; }
64 virtual void* GetGenericContext() { return nullptr; }
65 virtual void* GetGenericDrawable() { return nullptr; }
66 virtual void SetWindowInfo(const char*) {}
67 virtual void SetParentInfo(const char*) {}
69
71
75 virtual int* GetPosition() VTK_SIZEHINT(2);
76
82 virtual void SetPosition(int x, int y);
83 virtual void SetPosition(int a[2]);
85
87
91 virtual int* GetSize() VTK_SIZEHINT(2);
92
101 virtual void SetSize(int width, int height);
102 virtual void SetSize(int a[2]);
104
109 int* GetActualSize() VTK_SIZEHINT(2);
110
114 virtual int* GetScreenSize() VTK_SIZEHINT(2) { return nullptr; }
115
117
120 vtkGetMacro(Mapped, vtkTypeBool);
122
124
127 vtkGetMacro(ShowWindow, bool);
128 vtkSetMacro(ShowWindow, bool);
129 vtkBooleanMacro(ShowWindow, bool);
131
133
138 vtkSetMacro(UseOffScreenBuffers, bool);
139 vtkGetMacro(UseOffScreenBuffers, bool);
140 vtkBooleanMacro(UseOffScreenBuffers, bool);
142
144
150 vtkSetMacro(Erase, vtkTypeBool);
151 vtkGetMacro(Erase, vtkTypeBool);
152 vtkBooleanMacro(Erase, vtkTypeBool);
154
156
159 vtkSetMacro(DoubleBuffer, vtkTypeBool);
160 vtkGetMacro(DoubleBuffer, vtkTypeBool);
161 vtkBooleanMacro(DoubleBuffer, vtkTypeBool);
163
165
168 vtkGetStringMacro(WindowName);
169 vtkSetStringMacro(WindowName);
171
176 virtual void SetIcon(vtkImageData*) {}
177
182 virtual void Render() {}
183
190
192
204 virtual unsigned char* GetPixelData(
205 int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, int /*front*/, int /*right*/ = 0)
206 {
207 return nullptr;
208 }
209 virtual int GetPixelData(int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, int /*front*/,
210 vtkUnsignedCharArray* /*data*/, int /*right*/ = 0)
211 {
212 return 0;
213 }
215
217
221 vtkGetMacro(DPI, int);
222 vtkSetClampMacro(DPI, int, 1, VTK_INT_MAX);
224
231 virtual bool DetectDPI() { return false; }
232
234
238 {
239 this->SetShowWindow(val == 0);
240 this->SetUseOffScreenBuffers(val != 0);
241 }
242 vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
244
249 vtkTypeBool GetOffScreenRendering() { return this->GetShowWindow() ? 0 : 1; }
250
255 virtual void MakeCurrent() {}
256
261 virtual void ReleaseCurrent() {}
262
264
270 vtkSetVector2Macro(TileScale, int);
271 vtkGetVector2Macro(TileScale, int);
272 void SetTileScale(int s) { this->SetTileScale(s, s); }
273 vtkSetVector4Macro(TileViewport, double);
274 vtkGetVector4Macro(TileViewport, double);
276
277protected:
279 ~vtkWindow() override;
280
282 int Size[2];
283 int Position[2];
289 int DPI;
290
291 double TileViewport[4];
292 int TileSize[2];
293 int TileScale[2];
294
295private:
296 vtkWindow(const vtkWindow&) = delete;
297 void operator=(const vtkWindow&) = delete;
298};
299
300#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:72
dynamic, self-adjusting array of unsigned char
window superclass for vtkRenderWindow
Definition: vtkWindow.h:48
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:65
virtual unsigned char * GetPixelData(int, int, int, int, int, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
Definition: vtkWindow.h:204
bool UseOffScreenBuffers
Definition: vtkWindow.h:286
virtual bool DetectDPI()
Attempt to detect and set the DPI of the display device by querying the system.
Definition: vtkWindow.h:231
vtkTypeBool GetOffScreenRendering()
Deprecated, directly use GetShowWindow and GetOffScreenBuffers instead.
Definition: vtkWindow.h:249
virtual void SetIcon(vtkImageData *)
Set the icon used in title bar and task bar.
Definition: vtkWindow.h:176
virtual void * GetGenericWindowId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:62
virtual void SetWindowInfo(const char *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:66
virtual void ReleaseCurrent()
Release the current context.
Definition: vtkWindow.h:261
virtual void * GetGenericContext()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:64
vtkTypeBool DoubleBuffer
Definition: vtkWindow.h:288
~vtkWindow() override
virtual void * GetGenericParentId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:63
virtual int GetPixelData(int, int, int, int, int, vtkUnsignedCharArray *, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
Definition: vtkWindow.h:209
virtual void * GetGenericDisplayId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:61
virtual void SetDisplayId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:58
void SetOffScreenRendering(vtkTypeBool val)
Convenience to set SHowWindow and UseOffScreenBuffers in one call.
Definition: vtkWindow.h:237
vtkTypeBool Mapped
Definition: vtkWindow.h:284
vtkTypeBool Erase
Definition: vtkWindow.h:287
bool ShowWindow
Definition: vtkWindow.h:285
char * WindowName
Definition: vtkWindow.h:281
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:67
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
Definition: vtkWindow.h:189
virtual void Render()
Ask each viewport owned by this Window to render its image and synchronize this process.
Definition: vtkWindow.h:182
virtual void SetParentId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:60
void SetTileScale(int s)
These methods are used by vtkWindowToImageFilter to tell a VTK window to simulate a larger window by ...
Definition: vtkWindow.h:272
virtual void MakeCurrent()
Make the window current.
Definition: vtkWindow.h:255
virtual void SetWindowId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:59
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_INT_MAX
Definition: vtkType.h:155
#define VTK_SIZEHINT(...)