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 
44 class VTKRENDERINGOPENGL2_EXPORT vtkWin32RenderWindowInteractor : 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, vtkWin32RenderWindowInteractor *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;
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  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 vtkWin32RenderWindowInteractor&); // Not implemented.
165 };
166 
167 #endif
vtkWin32RenderWindowInteractor::StartEventLoop
virtual void StartEventLoop()
vtkWin32RenderWindowInteractor::vtkHandleMessage2
friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd, UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me)
vtkWin32RenderWindowInteractor::vtkHandleMessage
friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd, UINT uMsg, WPARAM w, LPARAM l)
vtkWin32RenderWindowInteractor::OnRButtonUp
virtual void OnRButtonUp(HWND wnd, UINT nFlags, int X, int Y)
vtkWin32RenderWindowInteractor::~vtkWin32RenderWindowInteractor
~vtkWin32RenderWindowInteractor()
vtkWin32RenderWindowInteractor::OnMouseMove
virtual void OnMouseMove(HWND wnd, UINT nFlags, int X, int Y)
vtkWin32RenderWindowInteractor::OnTimer
virtual void OnTimer(HWND wnd, UINT nIDEvent)
vtkWin32RenderWindowInteractor::OnChar
virtual void OnChar(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags)
vtkWin32RenderWindowInteractor::InternalCreateTimer
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
vtkTDxWinDevice
Implementation of vtkTDxDevice on Windows.
Definition: vtkTDxWinDevice.h:44
vtkWin32RenderWindowInteractor::vtkWin32RenderWindowInteractor
vtkWin32RenderWindowInteractor()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkWin32RenderWindowInteractor::OnKeyDown
virtual void OnKeyDown(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags)
vtkWin32RenderWindowInteractor::Initialize
virtual void Initialize()
vtkWin32RenderWindowInteractor::OnMouseWheelBackward
virtual void OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y)
vtkWin32RenderWindowInteractor
implements Win32 specific functions required by vtkRenderWindowInteractor.
Definition: vtkWin32RenderWindowInteractor.h:45
vtkWin32RenderWindowInteractor::OnLButtonUp
virtual void OnLButtonUp(HWND wnd, UINT nFlags, int X, int Y)
vtkWin32RenderWindowInteractor::OnKillFocus
virtual void OnKillFocus(HWND wnd, UINT nFlags)
vtkWin32RenderWindowInteractor::TerminateApp
void TerminateApp(void)
vtkWin32RenderWindowInteractor::OnRButtonDown
virtual void OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0)
vtkWin32RenderWindowInteractor::OnFocus
virtual void OnFocus(HWND wnd, UINT nFlags)
vtkWin32RenderWindowInteractor::SetClassExitMethod
static void SetClassExitMethod(void(*f)(void *), void *arg)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkWin32RenderWindowInteractor::InternalDestroyTimer
virtual int InternalDestroyTimer(int platformTimerId)
vtkWin32RenderWindowInteractor::OnKeyUp
virtual void OnKeyUp(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags)
vtkWin32RenderWindowInteractor::SetClassExitMethodArgDelete
static void SetClassExitMethodArgDelete(void(*f)(void *))
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkWin32RenderWindowInteractor::OnSize
virtual void OnSize(HWND wnd, UINT nType, int X, int Y)
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:80
vtkgl::f
GLclampf f
Definition: vtkgl.h:14181
vtkWin32RenderWindowInteractor::OnTouch
virtual void OnTouch(HWND wnd, UINT wParam, UINT lParam)
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkWin32RenderWindowInteractor::OnMButtonDown
virtual void OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0)
vtkWin32RenderWindowInteractor::ExitCallback
virtual void ExitCallback()
vtkRenderWindowInteractor.h
VTKI_MAX_POINTERS
#define VTKI_MAX_POINTERS
Definition: vtkRenderWindowInteractor.h:67
vtkWin32RenderWindowInteractor::GetContactIndex
int GetContactIndex(int id)
vtkgl::void
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
vtkgl::w
GLubyte GLubyte GLubyte GLubyte w
Definition: vtkgl.h:12054
vtkTDxConfigure.h
vtkWin32RenderWindowInteractor::Enable
virtual void Enable()
vtkWin32RenderWindowInteractor::OnLButtonDown
virtual void OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0)
vtkWin32RenderWindowInteractor::New
static vtkWin32RenderWindowInteractor * New()
vtkWin32RenderWindowInteractor::OnMButtonUp
virtual void OnMButtonUp(HWND wnd, UINT nFlags, int X, int Y)
vtkWin32RenderWindowInteractor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkWin32RenderWindowInteractor::Disable
virtual void Disable()
vtkWindows.h
vtkWin32RenderWindowInteractor::OnMouseWheelForward
virtual void OnMouseWheelForward(HWND wnd, UINT nFlags, int X, int Y)
vtkWin32RenderWindowInteractor::OnNCMouseMove
virtual void OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y)