VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkCocoaRenderWindow.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkCocoaRenderWindow.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 =========================================================================*/
42 #ifndef __vtkCocoaRenderWindow_h
43 #define __vtkCocoaRenderWindow_h
44 
45 #include "vtkRenderingOpenGLModule.h" // For export macro
46 #include "vtkOpenGLRenderWindow.h"
47 
49 {
50 public:
51  static vtkCocoaRenderWindow *New();
53  void PrintSelf(ostream& os, vtkIndent indent);
54 
56  virtual void Start();
57 
59  virtual void Frame();
60 
62  virtual void WindowConfigure();
63 
67  virtual void Initialize();
68 
73  virtual void SetFullScreen(int);
74 
77  virtual void WindowRemap();
78 
81  virtual void PrefFullScreen();
82 
84 
85  virtual void SetSize(int a[2]);
86  virtual void SetSize(int,int);
88 
90  virtual int *GetSize();
91 
93 
94  virtual void SetPosition(int a[2]);
95  virtual void SetPosition(int,int);
97 
99  virtual int *GetScreenSize();
100 
102  virtual int *GetPosition();
103 
106  virtual void SetWindowName(const char *);
107 
108  void SetNextWindowInfo(char *)
109  {
110  vtkWarningMacro("SetNextWindowInfo not implemented (WindowRemap not implemented).");
111  }
112  virtual void* GetGenericDrawable()
113  {
114  vtkWarningMacro("Method not implemented.");
115  return 0;
116  }
117  virtual void SetDisplayId(void*)
118  {
119  vtkWarningMacro("Method not implemented.");
120  }
121  virtual void *GetGenericDisplayId()
122  {
123  vtkWarningMacro("Method not implemented.");
124  return 0;
125  }
126 
130  virtual void SetWindowInfo(char*);
131 
135  virtual void SetParentInfo(char*);
136 
137  void SetNextWindowId(void*)
138  {
139  vtkWarningMacro("SetNextWindowId not implemented (WindowRemap not implemented).");
140  }
141 
144  virtual bool InitializeFromCurrentContext();
145 
147  virtual void StereoUpdate();
148 
153  virtual void SetStereoCapableWindow(int capable);
154 
156  virtual void MakeCurrent();
157 
160  virtual bool IsCurrent();
161 
166  virtual bool IsDrawable();
167 
169  void UpdateContext();
170 
172  const char *ReportCapabilities();
173 
175  int SupportsOpenGL();
176 
178  int IsDirect();
179 
183  virtual void SetForceMakeCurrent();
184 
187  virtual int GetEventPending();
188 
190 
191  virtual void SetupPalette(void *hDC);
192  virtual void SetupPixelFormat(void *hDC, void *dwFlags, int debug,
193  int bpp=16, int zbpp=16);
195 
197  void Finalize();
198 
200  int GetDepthBufferSize();
201 
203 
206  virtual void HideCursor();
207  virtual void ShowCursor();
208  virtual void SetCursorPosition(int x, int y);
210 
212  virtual void SetCurrentCursor(int);
213 
216  virtual int GetWindowCreated();
217 
219 
220  void SetContextId(void *);
221  void *GetContextId();
222  virtual void *GetGenericContext() {return this->GetContextId();}
224 
233  virtual void SetRootWindow(void *);
234 
236  virtual void *GetRootWindow();
237 
246  virtual void SetWindowId(void *);
247 
249 
250  virtual void *GetWindowId();
251  virtual void *GetGenericWindowId() {return this->GetWindowId();}
253 
258  virtual void SetParentId(void *nsview);
259 
261 
264  virtual void *GetParentId();
265  virtual void *GetGenericParentId() { return this->GetParentId(); }
267 
269 
271  void SetPixelFormat(void *pixelFormat);
272  void *GetPixelFormat();
274 
275 protected:
278 
279  void CreateGLContext();
280 
281  void CreateAWindow();
282  void DestroyWindow();
283  void DestroyOffScreenWindow();
284 
287 
289 
291  void SetCocoaManager(void *manager);
292  void *GetCocoaManager();
294 
295 private:
296  vtkCocoaRenderWindow(const vtkCocoaRenderWindow&); // Not implemented.
297  void operator=(const vtkCocoaRenderWindow&); // Not implemented.
298 
299 private:
300  // Important: this class cannot contain Objective-C instance
301  // variables for 2 reasons:
302  // 1) C++ files include this header
303  // 2) because of garbage collection (the GC scanner does not scan objects create by C++'s new)
304  // Instead, use the CocoaManager dictionary to keep a collection
305  // of what would otherwise be Objective-C instance variables.
306  void *CocoaManager; // Really an NSMutableDictionary*
307 
308  int WindowCreated;
309  int ViewCreated;
310  int CursorHidden;
311 
312  int ForceMakeCurrent;
313  char *Capabilities;
314 };
315 
316 #endif
OpenGL rendering window.
virtual void Finalize()=0
virtual void SetForceMakeCurrent()
virtual void SetWindowInfo(char *)=0
virtual void WindowRemap()=0
void PrintSelf(ostream &os, vtkIndent indent)
virtual void HideCursor()=0
virtual void * GetGenericParentId()
Cocoa OpenGL rendering window.
static vtkRenderWindow * New()
virtual int * GetScreenSize()=0
virtual void SetWindowId(void *)=0
virtual void * GetGenericDrawable()
virtual void SetCurrentCursor(int)
virtual void SetFullScreen(int)=0
#define vtkWarningMacro(x)
Definition: vtkSetGet.h:461
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
virtual void * GetGenericDisplayId()
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
virtual int GetEventPending()=0
virtual void SetSize(int, int)
virtual void SetStereoCapableWindow(int capable)
virtual const char * ReportCapabilities()
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
virtual int IsDirect()
virtual int SupportsOpenGL()
virtual void SetParentInfo(char *)=0
virtual bool IsCurrent()=0
virtual void SetParentId(void *)=0
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void DestroyWindow()=0
#define VTKRENDERINGOPENGL_EXPORT
virtual void MakeCurrent()=0
virtual void SetDisplayId(void *)
virtual void SetCursorPosition(int, int)
virtual int * GetPosition()
virtual void Frame()=0
virtual int * GetSize()
virtual void * GetGenericContext()
GLboolean GLboolean GLboolean GLboolean a
Definition: vtkgl.h:12312
virtual bool InitializeFromCurrentContext()
virtual void Start()=0
virtual void SetWindowName(const char *)
virtual void SetPosition(int, int)
virtual void StereoUpdate()
virtual void CreateAWindow()=0
virtual void * GetGenericWindowId()
virtual void ShowCursor()=0
virtual bool IsDrawable()