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=========================================================================*/
29#ifndef vtkWindow_h
30#define vtkWindow_h
31
32#include "vtkCommonCoreModule.h" // For export macro
33#include "vtkObject.h"
34
35class vtkImageData;
37
38class VTKCOMMONCORE_EXPORT vtkWindow : public vtkObject
39{
40public:
41 vtkTypeMacro(vtkWindow, vtkObject);
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
45
49 virtual void SetDisplayId(void*) {}
50 virtual void SetWindowId(void*) {}
51 virtual void SetParentId(void*) {}
52 virtual void* GetGenericDisplayId() { return nullptr; }
53 virtual void* GetGenericWindowId() { return nullptr; }
54 virtual void* GetGenericParentId() { return nullptr; }
55 virtual void* GetGenericContext() { return nullptr; }
56 virtual void* GetGenericDrawable() { return nullptr; }
57 virtual void SetWindowInfo(const char*) {}
58 virtual void SetParentInfo(const char*) {}
60
62
66 virtual int* GetPosition() VTK_SIZEHINT(2);
67
73 virtual void SetPosition(int x, int y);
74 virtual void SetPosition(int a[2]);
76
78
82 virtual int* GetSize() VTK_SIZEHINT(2);
83
92 virtual void SetSize(int width, int height);
93 virtual void SetSize(int a[2]);
95
100 int* GetActualSize() VTK_SIZEHINT(2);
101
105 virtual int* GetScreenSize() VTK_SIZEHINT(2) { return nullptr; }
106
108
111 vtkGetMacro(Mapped, vtkTypeBool);
113
115
118 vtkGetMacro(ShowWindow, bool);
119 vtkSetMacro(ShowWindow, bool);
120 vtkBooleanMacro(ShowWindow, bool);
122
124
129 vtkSetMacro(UseOffScreenBuffers, bool);
130 vtkGetMacro(UseOffScreenBuffers, bool);
131 vtkBooleanMacro(UseOffScreenBuffers, bool);
133
135
141 vtkSetMacro(Erase, vtkTypeBool);
142 vtkGetMacro(Erase, vtkTypeBool);
143 vtkBooleanMacro(Erase, vtkTypeBool);
145
147
150 vtkSetMacro(DoubleBuffer, vtkTypeBool);
151 vtkGetMacro(DoubleBuffer, vtkTypeBool);
152 vtkBooleanMacro(DoubleBuffer, vtkTypeBool);
154
156
159 vtkGetStringMacro(WindowName);
160 vtkSetStringMacro(WindowName);
162
167 virtual void SetIcon(vtkImageData*) {}
168
173 virtual void Render() {}
174
181
183
195 virtual unsigned char* GetPixelData(
196 int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, int /*front*/, int /*right*/ = 0)
197 {
198 return nullptr;
199 }
200 virtual int GetPixelData(int /*x*/, int /*y*/, int /*x2*/, int /*y2*/, int /*front*/,
201 vtkUnsignedCharArray* /*data*/, int /*right*/ = 0)
202 {
203 return 0;
204 }
206
208
212 vtkGetMacro(DPI, int);
213 vtkSetClampMacro(DPI, int, 1, VTK_INT_MAX);
215
222 virtual bool DetectDPI() { return false; }
223
225
229 {
230 this->SetShowWindow(val == 0);
231 this->SetUseOffScreenBuffers(val != 0);
232 }
233 vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
235
240 vtkTypeBool GetOffScreenRendering() { return this->GetShowWindow() ? 0 : 1; }
241
246 virtual void MakeCurrent() {}
247
252 virtual void ReleaseCurrent() {}
253
255
261 vtkSetVector2Macro(TileScale, int);
262 vtkGetVector2Macro(TileScale, int);
263 void SetTileScale(int s) { this->SetTileScale(s, s); }
264 vtkSetVector4Macro(TileViewport, double);
265 vtkGetVector4Macro(TileViewport, double);
267
268protected:
270 ~vtkWindow() override;
271
273 int Size[2];
274 int Position[2];
280 int DPI;
281
282 double TileViewport[4];
283 int TileSize[2];
284 int TileScale[2];
285
286private:
287 vtkWindow(const vtkWindow&) = delete;
288 void operator=(const vtkWindow&) = delete;
289};
290
291#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:82
dynamic, self-adjusting array of unsigned char
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
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:56
virtual unsigned char * GetPixelData(int, int, int, int, int, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
Definition: vtkWindow.h:195
bool UseOffScreenBuffers
Definition: vtkWindow.h:277
virtual bool DetectDPI()
Attempt to detect and set the DPI of the display device by querying the system.
Definition: vtkWindow.h:222
vtkTypeBool GetOffScreenRendering()
Deprecated, directly use GetShowWindow and GetOffScreenBuffers instead.
Definition: vtkWindow.h:240
virtual void SetIcon(vtkImageData *)
Set the icon used in title bar and task bar.
Definition: vtkWindow.h:167
virtual void * GetGenericWindowId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:53
virtual void SetWindowInfo(const char *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:57
virtual void ReleaseCurrent()
Release the current context.
Definition: vtkWindow.h:252
virtual void * GetGenericContext()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:55
vtkTypeBool DoubleBuffer
Definition: vtkWindow.h:279
~vtkWindow() override
virtual void * GetGenericParentId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:54
virtual int GetPixelData(int, int, int, int, int, vtkUnsignedCharArray *, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
Definition: vtkWindow.h:200
virtual void * GetGenericDisplayId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:52
virtual void SetDisplayId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:49
void SetOffScreenRendering(vtkTypeBool val)
Convenience to set SHowWindow and UseOffScreenBuffers in one call.
Definition: vtkWindow.h:228
vtkTypeBool Mapped
Definition: vtkWindow.h:275
vtkTypeBool Erase
Definition: vtkWindow.h:278
bool ShowWindow
Definition: vtkWindow.h:276
char * WindowName
Definition: vtkWindow.h:272
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:58
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
Definition: vtkWindow.h:180
virtual void Render()
Ask each viewport owned by this Window to render its image and synchronize this process.
Definition: vtkWindow.h:173
virtual void SetParentId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:51
void SetTileScale(int s)
These methods are used by vtkWindowToImageFilter to tell a VTK window to simulate a larger window by ...
Definition: vtkWindow.h:263
virtual void MakeCurrent()
Make the window current.
Definition: vtkWindow.h:246
virtual void SetWindowId(void *)
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:50
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_INT_MAX
Definition: vtkType.h:155
#define VTK_SIZEHINT(...)