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 =========================================================================*/
29 #ifndef vtkWindow_h
30 #define vtkWindow_h
31 
32 #include "vtkCommonCoreModule.h" // For export macro
33 #include "vtkObject.h"
34 
36 
37 class VTKCOMMONCORE_EXPORT vtkWindow : public vtkObject
38 {
39 public:
40  vtkTypeMacro(vtkWindow,vtkObject);
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
48  virtual void SetDisplayId(void *) = 0;
49  virtual void SetWindowId(void *) = 0;
50  virtual void SetParentId(void *) = 0;
51  virtual void *GetGenericDisplayId() = 0;
52  virtual void *GetGenericWindowId() = 0;
53  virtual void *GetGenericParentId() = 0;
54  virtual void *GetGenericContext() = 0;
55  virtual void *GetGenericDrawable() = 0;
56  virtual void SetWindowInfo(const char *) = 0;
57  virtual void SetParentInfo(const char *) = 0;
59 
61 
65  virtual int *GetPosition() VTK_SIZEHINT(2);
66  virtual void SetPosition(int,int);
67  virtual void SetPosition(int a[2]);
69 
71 
74  virtual int *GetSize() VTK_SIZEHINT(2);
75  virtual void SetSize(int,int);
76  virtual void SetSize(int a[2]);
78 
83  int *GetActualSize() VTK_SIZEHINT(2);
84 
88  virtual int *GetScreenSize() VTK_SIZEHINT(2) = 0;
89 
91 
94  vtkSetMacro(Mapped,vtkTypeBool);
95  vtkGetMacro(Mapped,vtkTypeBool);
96  vtkBooleanMacro(Mapped,vtkTypeBool);
98 
100 
106  vtkSetMacro(Erase,vtkTypeBool);
107  vtkGetMacro(Erase,vtkTypeBool);
108  vtkBooleanMacro(Erase,vtkTypeBool);
110 
112 
115  vtkSetMacro(DoubleBuffer,vtkTypeBool);
116  vtkGetMacro(DoubleBuffer,vtkTypeBool);
117  vtkBooleanMacro(DoubleBuffer,vtkTypeBool);
119 
121 
124  vtkGetStringMacro(WindowName);
125  vtkSetStringMacro(WindowName);
127 
132  virtual void Render() = 0;
133 
135 
147  virtual unsigned char *GetPixelData(int x, int y, int x2, int y2,
148  int front, int right=0) = 0;
149  virtual int GetPixelData(int x, int y, int x2, int y2, int front,
150  vtkUnsignedCharArray *data, int right=0) = 0;
152 
154 
158  vtkGetMacro(DPI,int);
159  vtkSetClampMacro(DPI,int,1,VTK_INT_MAX);
161 
168  virtual bool DetectDPI() { return false; }
169 
171 
176  vtkSetMacro(OffScreenRendering,vtkTypeBool);
177  vtkGetMacro(OffScreenRendering,vtkTypeBool);
178  vtkBooleanMacro(OffScreenRendering,vtkTypeBool);
180 
185  virtual void MakeCurrent() {}
186 
188 
194  vtkSetVector2Macro(TileScale,int);
195  vtkGetVector2Macro(TileScale,int);
196  void SetTileScale(int s) {this->SetTileScale(s,s);}
197  vtkSetVector4Macro(TileViewport,double);
198  vtkGetVector4Macro(TileViewport,double);
200 
201 protected:
203  vtkWindow();
204  ~vtkWindow() override;
205 
206  char *WindowName;
207  int Size[2];
208  int Position[2];
212  int DPI;
213 
214  double TileViewport[4];
215  int TileSize[2];
216  int TileScale[2];
217 
218 private:
219  vtkWindow(const vtkWindow&) = delete;
220  void operator=(const vtkWindow&) = delete;
221 };
222 
223 #endif
224 
225 
vtkTypeBool Mapped
Definition: vtkWindow.h:209
char * WindowName
Definition: vtkWindow.h:206
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:196
#define VTK_INT_MAX
Definition: vtkType.h:159
int vtkTypeBool
Definition: vtkABI.h:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void MakeCurrent()
Make the window current.
Definition: vtkWindow.h:185
#define VTK_SIZEHINT(...)
dynamic, self-adjusting array of unsigned char
vtkTypeBool Erase
Definition: vtkWindow.h:210
vtkTypeBool DoubleBuffer
Definition: vtkWindow.h:211
vtkTypeBool OffScreenRendering
Definition: vtkWindow.h:198