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(char *) = 0;
54  virtual void SetParentInfo(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  vtkSetMacro(Mapped,vtkTypeBool);
92  vtkGetMacro(Mapped,vtkTypeBool);
93  vtkBooleanMacro(Mapped,vtkTypeBool);
95 
97 
103  vtkSetMacro(Erase,vtkTypeBool);
104  vtkGetMacro(Erase,vtkTypeBool);
105  vtkBooleanMacro(Erase,vtkTypeBool);
107 
109 
112  vtkSetMacro(DoubleBuffer,vtkTypeBool);
113  vtkGetMacro(DoubleBuffer,vtkTypeBool);
114  vtkBooleanMacro(DoubleBuffer,vtkTypeBool);
116 
118 
121  vtkGetStringMacro(WindowName);
122  vtkSetStringMacro(WindowName);
124 
129  virtual void Render() = 0;
130 
132 
144  virtual unsigned char *GetPixelData(int x, int y, int x2, int y2,
145  int front, int right=0) = 0;
146  virtual int GetPixelData(int x, int y, int x2, int y2, int front,
147  vtkUnsignedCharArray *data, int right=0) = 0;
149 
151 
155  vtkGetMacro(DPI,int);
156  vtkSetClampMacro(DPI,int,1,VTK_INT_MAX);
158 
165  virtual bool DetectDPI() { return false; }
166 
168 
173  vtkSetMacro(OffScreenRendering,vtkTypeBool);
174  vtkGetMacro(OffScreenRendering,vtkTypeBool);
175  vtkBooleanMacro(OffScreenRendering,vtkTypeBool);
177 
182  virtual void MakeCurrent() {}
183 
185 
191  vtkSetVector2Macro(TileScale,int);
192  vtkGetVector2Macro(TileScale,int);
193  void SetTileScale(int s) {this->SetTileScale(s,s);}
194  vtkSetVector4Macro(TileViewport,double);
195  vtkGetVector4Macro(TileViewport,double);
197 
198 protected:
200  vtkWindow();
201  ~vtkWindow() override;
202 
203  char *WindowName;
204  int Size[2];
205  int Position[2];
209  int DPI;
210 
211  double TileViewport[4];
212  int TileSize[2];
213  int TileScale[2];
214 
215 private:
216  vtkWindow(const vtkWindow&) = delete;
217  void operator=(const vtkWindow&) = delete;
218 };
219 
220 #endif
221 
222 
vtkTypeBool Mapped
Definition: vtkWindow.h:206
char * WindowName
Definition: vtkWindow.h:203
abstract base class for most VTK objects
Definition: vtkObject.h:53
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:193
#define VTK_INT_MAX
Definition: vtkType.h:157
int vtkTypeBool
Definition: vtkABI.h:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual void MakeCurrent()
Make the window current.
Definition: vtkWindow.h:182
#define VTK_SIZEHINT(...)
dynamic, self-adjusting array of unsigned char
vtkTypeBool Erase
Definition: vtkWindow.h:207
vtkTypeBool DoubleBuffer
Definition: vtkWindow.h:208
vtkTypeBool OffScreenRendering
Definition: vtkWindow.h:195