VTK
vtkWin32RenderWindowInteractor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkWin32RenderWindowInteractor.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 vtkWin32RenderWindowInteractor_h
33 #define vtkWin32RenderWindowInteractor_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 
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, vtkWin32RenderWindowInteractor *me);
87 
89 
91  virtual int OnMouseMove(HWND wnd, UINT nFlags, int X, int Y);
92  virtual int OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
93  virtual int OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
94  virtual int OnRButtonUp(HWND wnd, UINT nFlags, int X, int Y);
95  virtual int OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
96  virtual int OnMButtonUp(HWND wnd, UINT nFlags, int X, int Y);
97  virtual int OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
98  virtual int OnLButtonUp(HWND wnd, UINT nFlags, int X, int Y);
99  virtual int OnSize(HWND wnd, UINT nType, int X, int Y);
100  virtual int OnTimer(HWND wnd, UINT nIDEvent);
101  virtual int OnKeyDown(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
102  virtual int OnKeyUp(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
103  virtual int OnChar(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
104  virtual int OnMouseWheelForward(HWND wnd, UINT nFlags, int X, int Y);
105  virtual int OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
106  virtual int OnFocus(HWND wnd, UINT nFlags);
107  virtual int OnKillFocus(HWND wnd, UINT nFlags);
108  virtual int 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;
130  int InstallMessageProc;
131  int MouseInWindow;
132  int StartedMessageLoop;
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 #ifdef VTK_USE_TDX
156  vtkTDxWinDevice *Device;
157 #endif
158 
159 private:
161  void operator=(const vtkWin32RenderWindowInteractor&); // Not implemented.
162 };
163 
164 #endif
Implementation of vtkTDxDevice on Windows.
virtual int InternalDestroyTimer(int platformTimerId)
void PrintSelf(ostream &os, vtkIndent indent)
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
#define VTKRENDERINGOPENGL2_EXPORT
implements Win32 specific functions required by vtkRenderWindowInteractor.
virtual void Initialize()
static vtkRenderWindowInteractor * New()
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void ExitCallback()