VTK
vtkWin32OpenGLRenderWindowInteractor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkWin32OpenGLRenderWindowInteractor.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 =========================================================================*/
32 #ifndef vtkWin32OpenGLRenderWindowInteractor_h
33 #define vtkWin32OpenGLRenderWindowInteractor_h
34 
35 #include "vtkRenderingOpenGL2Module.h" // For export macro
37 #include "vtkWindows.h" // For windows API.
38 
39 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
40 #ifdef VTK_USE_TDX
41 class vtkTDxWinDevice;
42 #endif
43 
44 class VTKRENDERINGOPENGL2_EXPORT vtkWin32OpenGLRenderWindowInteractor : public vtkRenderWindowInteractor
45 {
46 public:
49 
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
54  virtual void Initialize();
55 
57 
64  virtual void Enable();
65  virtual void Disable();
67 
69 
74  vtkSetMacro(InstallMessageProc,int);
75  vtkGetMacro(InstallMessageProc,int);
76  vtkBooleanMacro(InstallMessageProc,int);
78 
83  void TerminateApp(void);
84 
85  friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
86  friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32OpenGLRenderWindowInteractor *me);
87 
89 
91  virtual void OnMouseMove (HWND wnd, UINT nFlags, int X, int Y);
92  virtual void OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
93  virtual void OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
94  virtual void OnRButtonUp (HWND wnd, UINT nFlags, int X, int Y);
95  virtual void OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
96  virtual void OnMButtonUp (HWND wnd, UINT nFlags, int X, int Y);
97  virtual void OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
98  virtual void OnLButtonUp (HWND wnd, UINT nFlags, int X, int Y);
99  virtual void OnSize (HWND wnd, UINT nType, int X, int Y);
100  virtual void OnTimer (HWND wnd, UINT nIDEvent);
101  virtual void OnKeyDown (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
102  virtual void OnKeyUp (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
103  virtual void OnChar (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
104  virtual void OnMouseWheelForward (HWND wnd, UINT nFlags, int X, int Y);
105  virtual void OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
106  virtual void OnFocus(HWND wnd, UINT nFlags);
107  virtual void OnKillFocus(HWND wnd, UINT nFlags);
108  virtual void OnTouch(HWND wnd, UINT wParam, UINT lParam);
110 
112 
116  static void SetClassExitMethod(void (*f)(void *), void *arg);
117  static void SetClassExitMethodArgDelete(void (*f)(void *));
119 
122  virtual void ExitCallback();
123 
124 protected:
127 
128  HWND WindowId;
129  WNDPROC OldProc;
133 
135 
138  static void (*ClassExitMethod)(void *);
139  static void (*ClassExitMethodArgDelete)(void *);
140  static void *ClassExitMethodArg;
142 
144 
146  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
147  virtual int InternalDestroyTimer(int platformTimerId);
149 
153  virtual void StartEventLoop();
154 
155  int GetContactIndex(int id);
156  int IDLookup[VTKI_MAX_POINTERS];
157 
158 #ifdef VTK_USE_TDX
159  vtkTDxWinDevice *Device;
160 #endif
161 
162 private:
164  void operator=(const vtkWin32OpenGLRenderWindowInteractor&); // Not implemented.
165 };
166 
167 #endif
Implementation of vtkTDxDevice on Windows.
GLclampf f
Definition: vtkgl.h:14181
virtual int InternalDestroyTimer(int platformTimerId)
void PrintSelf(ostream &os, vtkIndent indent)
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:632
virtual void Initialize()
static vtkRenderWindowInteractor * New()
implements Win32 specific functions required by vtkRenderWindowInteractor.
platform-independent render window interaction including picking and frame rate control.
GLubyte GLubyte GLubyte GLubyte w
Definition: vtkgl.h:12054
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void ExitCallback()
#define VTKI_MAX_POINTERS
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69