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 =========================================================================*/
30 #ifndef vtkWin32RenderWindowInteractor_h
31 #define vtkWin32RenderWindowInteractor_h
32 
33 #include "vtkRenderingOpenGLModule.h" // For export macro
35 #include "vtkWindows.h" // For windows API.
36 
37 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
38 #ifdef VTK_USE_TDX
39 class vtkTDxWinDevice;
40 #endif
41 
42 class VTKRENDERINGOPENGL_EXPORT vtkWin32RenderWindowInteractor : public vtkRenderWindowInteractor
43 {
44 public:
49 
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
56  virtual void Initialize();
57 
59 
68  virtual void Enable();
69  virtual void Disable();
71 
73 
79  vtkSetMacro(InstallMessageProc,int);
80  vtkGetMacro(InstallMessageProc,int);
81  vtkBooleanMacro(InstallMessageProc,int);
83 
89  void TerminateApp(void);
90 
91  friend VTKRENDERINGOPENGL_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
92  friend VTKRENDERINGOPENGL_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me);
93 
95 
99  virtual int OnMouseMove(HWND wnd, UINT nFlags, int X, int Y);
100  virtual int OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
101  virtual int OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
102  virtual int OnRButtonUp(HWND wnd, UINT nFlags, int X, int Y);
103  virtual int OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
104  virtual int OnMButtonUp(HWND wnd, UINT nFlags, int X, int Y);
105  virtual int OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
106  virtual int OnLButtonUp(HWND wnd, UINT nFlags, int X, int Y);
107  virtual int OnSize(HWND wnd, UINT nType, int X, int Y);
108  virtual int OnTimer(HWND wnd, UINT nIDEvent);
109  virtual int OnKeyDown(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
110  virtual int OnKeyUp(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
111  virtual int OnChar(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
112  virtual int OnMouseWheelForward(HWND wnd, UINT nFlags, int X, int Y);
113  virtual int OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
114  virtual int OnFocus(HWND wnd, UINT nFlags);
115  virtual int OnKillFocus(HWND wnd, UINT nFlags);
117 
119 
125  static void SetClassExitMethod(void (*f)(void *), void *arg);
126  static void SetClassExitMethodArgDelete(void (*f)(void *));
128 
133  virtual void ExitCallback();
134 
135 protected:
138 
139  HWND WindowId;
140  WNDPROC OldProc;
144 
146 
151  static void (*ClassExitMethod)(void *);
152  static void (*ClassExitMethodArgDelete)(void *);
153  static void *ClassExitMethodArg;
155 
157 
161  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
162  virtual int InternalDestroyTimer(int platformTimerId);
164 
170  virtual void StartEventLoop();
171 
172 #ifdef VTK_USE_TDX
173  vtkTDxWinDevice *Device;
174 #endif
175 
176 private:
178  void operator=(const vtkWin32RenderWindowInteractor&) VTK_DELETE_FUNCTION;
179 };
180 
181 #endif
182 
vtkWin32RenderWindowInteractor::StartEventLoop
virtual void StartEventLoop()
This will start up the event loop and never return.
vtkWin32RenderWindowInteractor::OnSize
virtual int OnSize(HWND wnd, UINT nType, int X, int Y)
vtkWin32RenderWindowInteractor::~vtkWin32RenderWindowInteractor
~vtkWin32RenderWindowInteractor()
vtkWin32RenderWindowInteractor::InternalCreateTimer
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
Win32-specific internal timer methods.
vtkTDxWinDevice
Implementation of vtkTDxDevice on Windows.
Definition: vtkTDxWinDevice.h:42
vtkWin32RenderWindowInteractor::StartedMessageLoop
int StartedMessageLoop
Definition: vtkWin32RenderWindowInteractor.h:143
vtkWin32RenderWindowInteractor::vtkWin32RenderWindowInteractor
vtkWin32RenderWindowInteractor()
vtkWin32RenderWindowInteractor::OnKillFocus
virtual int OnKillFocus(HWND wnd, UINT nFlags)
vtkWin32RenderWindowInteractor::Initialize
virtual void Initialize()
Initialize the event handler.
vtkWin32RenderWindowInteractor
implements Win32 specific functions required by vtkRenderWindowInteractor.
Definition: vtkWin32RenderWindowInteractor.h:43
vtkWin32RenderWindowInteractor::OnNCMouseMove
virtual int OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y)
vtkWin32RenderWindowInteractor::OnTimer
virtual int OnTimer(HWND wnd, UINT nIDEvent)
vtkWin32RenderWindowInteractor::TerminateApp
void TerminateApp(void)
Win32 specific application terminate, calls ClassExitMethod then calls PostQuitMessage(0) to terminat...
vtkWin32RenderWindowInteractor::OnChar
virtual int OnChar(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags)
vtkWin32RenderWindowInteractor::OnMouseMove
virtual int OnMouseMove(HWND wnd, UINT nFlags, int X, int Y)
Various methods that a Win32 window can redirect to this class to be handled.
vtkWin32RenderWindowInteractor::SetClassExitMethod
static void SetClassExitMethod(void(*f)(void *), void *arg)
Methods to set the default exit method for the class.
vtkWin32RenderWindowInteractor::OldProc
WNDPROC OldProc
Definition: vtkWin32RenderWindowInteractor.h:140
vtkWin32RenderWindowInteractor::OnKeyUp
virtual int OnKeyUp(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags)
vtkWin32RenderWindowInteractor::OnMButtonDown
virtual int OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0)
vtkWin32RenderWindowInteractor::MouseInWindow
int MouseInWindow
Definition: vtkWin32RenderWindowInteractor.h:142
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkWin32RenderWindowInteractor::InternalDestroyTimer
virtual int InternalDestroyTimer(int platformTimerId)
vtkWin32RenderWindowInteractor::OnLButtonDown
virtual int OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0)
vtkWin32RenderWindowInteractor::SetClassExitMethodArgDelete
static void SetClassExitMethodArgDelete(void(*f)(void *))
vtkWin32RenderWindowInteractor::vtkHandleMessage2
friend VTKRENDERINGOPENGL_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd, UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me)
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:79
vtkWin32RenderWindowInteractor::OnKeyDown
virtual int OnKeyDown(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags)
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkWin32RenderWindowInteractor::OnFocus
virtual int OnFocus(HWND wnd, UINT nFlags)
vtkWin32RenderWindowInteractor::ClassExitMethodArg
static void * ClassExitMethodArg
Definition: vtkWin32RenderWindowInteractor.h:153
vtkWin32RenderWindowInteractor::OnMouseWheelBackward
virtual int OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y)
vtkWin32RenderWindowInteractor::OnMouseWheelForward
virtual int OnMouseWheelForward(HWND wnd, UINT nFlags, int X, int Y)
vtkWin32RenderWindowInteractor::OnRButtonUp
virtual int OnRButtonUp(HWND wnd, UINT nFlags, int X, int Y)
vtkWin32RenderWindowInteractor::ExitCallback
virtual void ExitCallback()
These methods correspond to the the Exit, User and Pick callbacks.
vtkWin32RenderWindowInteractor::OnMButtonUp
virtual int OnMButtonUp(HWND wnd, UINT nFlags, int X, int Y)
vtkWin32RenderWindowInteractor::InstallMessageProc
int InstallMessageProc
Definition: vtkWin32RenderWindowInteractor.h:141
vtkRenderWindowInteractor.h
vtkWin32RenderWindowInteractor::OnRButtonDown
virtual int OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0)
vtkWin32RenderWindowInteractor::Enable
virtual void Enable()
Enable/Disable interactions.
vtkWin32RenderWindowInteractor::OnLButtonUp
virtual int OnLButtonUp(HWND wnd, UINT nFlags, int X, int Y)
vtkWin32RenderWindowInteractor::vtkHandleMessage
friend VTKRENDERINGOPENGL_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd, UINT uMsg, WPARAM w, LPARAM l)
vtkWin32RenderWindowInteractor::New
static vtkWin32RenderWindowInteractor * New()
Construct object so that light follows camera motion.
vtkWin32RenderWindowInteractor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkWin32RenderWindowInteractor::Disable
virtual void Disable()
vtkWin32RenderWindowInteractor::WindowId
HWND WindowId
Definition: vtkWin32RenderWindowInteractor.h:139