VTK
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 
33 
34 class VTKCOMMONCORE_EXPORT vtkWindow : public vtkObject
35 {
36 public:
37  vtkTypeMacro(vtkWindow,vtkObject);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
41 
45  virtual void SetDisplayId(void *) = 0;
46  virtual void SetWindowId(void *) = 0;
47  virtual void SetParentId(void *) = 0;
48  virtual void *GetGenericDisplayId() = 0;
49  virtual void *GetGenericWindowId() = 0;
50  virtual void *GetGenericParentId() = 0;
51  virtual void *GetGenericContext() = 0;
52  virtual void *GetGenericDrawable() = 0;
53  virtual void SetWindowInfo(const char *) = 0;
54  virtual void SetParentInfo(const char *) = 0;
56 
58 
62  virtual int *GetPosition() VTK_SIZEHINT(2);
63  virtual void SetPosition(int,int);
64  virtual void SetPosition(int a[2]);
66 
68 
71  virtual int *GetSize() VTK_SIZEHINT(2);
72  virtual void SetSize(int,int);
73  virtual void SetSize(int a[2]);
75 
80  int *GetActualSize() VTK_SIZEHINT(2);
81 
85  virtual int *GetScreenSize() VTK_SIZEHINT(2) = 0;
86 
88 
91  vtkGetMacro(Mapped,vtkTypeBool);
93 
95 
98  vtkGetMacro(ShowWindow, bool);
99  vtkSetMacro(ShowWindow, bool);
100  vtkBooleanMacro(ShowWindow, bool);
102 
104 
109  vtkSetMacro(UseOffScreenBuffers, bool);
110  vtkGetMacro(UseOffScreenBuffers, bool);
111  vtkBooleanMacro(UseOffScreenBuffers, bool);
113 
115 
121  vtkSetMacro(Erase,vtkTypeBool);
122  vtkGetMacro(Erase,vtkTypeBool);
123  vtkBooleanMacro(Erase,vtkTypeBool);
125 
127 
130  vtkSetMacro(DoubleBuffer,vtkTypeBool);
131  vtkGetMacro(DoubleBuffer,vtkTypeBool);
132  vtkBooleanMacro(DoubleBuffer,vtkTypeBool);
134 
136 
139  vtkGetStringMacro(WindowName);
140  vtkSetStringMacro(WindowName);
142 
147  virtual void Render() = 0;
148 
150 
162  virtual unsigned char *GetPixelData(int x, int y, int x2, int y2,
163  int front, int right=0) = 0;
164  virtual int GetPixelData(int x, int y, int x2, int y2, int front,
165  vtkUnsignedCharArray *data, int right=0) = 0;
167 
169 
173  vtkGetMacro(DPI,int);
174  vtkSetClampMacro(DPI,int,1,VTK_INT_MAX);
176 
183  virtual bool DetectDPI() { return false; }
184 
186 
190  {
191  this->SetShowWindow(val == 0);
192  this->SetUseOffScreenBuffers(val != 0);
193  }
194  vtkBooleanMacro(OffScreenRendering,vtkTypeBool);
196 
202  {
203  return this->GetShowWindow() ? 0 : 1;
204  }
205 
210  virtual void MakeCurrent() {}
211 
213 
219  vtkSetVector2Macro(TileScale,int);
220  vtkGetVector2Macro(TileScale,int);
221  void SetTileScale(int s) {this->SetTileScale(s,s);}
222  vtkSetVector4Macro(TileViewport,double);
223  vtkGetVector4Macro(TileViewport,double);
225 
226 protected:
227  vtkWindow();
228  ~vtkWindow() override;
229 
230  char *WindowName;
231  int Size[2];
232  int Position[2];
238  int DPI;
239 
240  double TileViewport[4];
241  int TileSize[2];
242  int TileScale[2];
243 
244 private:
245  vtkWindow(const vtkWindow&) = delete;
246  void operator=(const vtkWindow&) = delete;
247 };
248 
249 #endif
250 
251 
vtkTypeBool Mapped
Definition: vtkWindow.h:233
char * WindowName
Definition: vtkWindow.h:230
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetTileScale(int s)
These methods are used by vtkWindowToImageFilter to tell a VTK window to simulate a larger window by ...
Definition: vtkWindow.h:221
#define VTK_INT_MAX
Definition: vtkType.h:161
int vtkTypeBool
Definition: vtkABI.h:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
bool ShowWindow
Definition: vtkWindow.h:234
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void MakeCurrent()
Make the window current.
Definition: vtkWindow.h:210
#define VTK_SIZEHINT(...)
dynamic, self-adjusting array of unsigned char
vtkTypeBool GetOffScreenRendering()
Deprecated, directly use GetShowWindow and GetOffScreenBuffers instead.
Definition: vtkWindow.h:201
vtkTypeBool Erase
Definition: vtkWindow.h:236
vtkTypeBool DoubleBuffer
Definition: vtkWindow.h:237
bool UseOffScreenBuffers
Definition: vtkWindow.h:235
void SetOffScreenRendering(vtkTypeBool val)
Convenience to set SHowWindow and UseOffScreenBuffers in one call.
Definition: vtkWindow.h:189