VTK
dox/Rendering/vtkWin32RenderWindowInteractor.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkWin32RenderWindowInteractor.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00035 #ifndef __vtkWin32RenderWindowInteractor_h
00036 #define __vtkWin32RenderWindowInteractor_h
00037 
00038 #include "vtkRenderWindowInteractor.h"
00039 #include "vtkWindows.h" // For windows API.
00040 
00041 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
00042 #ifdef VTK_USE_TDX
00043 class vtkTDxWinDevice;
00044 #endif
00045 
00046 class VTK_RENDERING_EXPORT vtkWin32RenderWindowInteractor : public vtkRenderWindowInteractor 
00047 {
00048 public:
00050   static vtkWin32RenderWindowInteractor *New();
00051 
00052   vtkTypeMacro(vtkWin32RenderWindowInteractor,vtkRenderWindowInteractor);
00053   void PrintSelf(ostream& os, vtkIndent indent);
00054 
00056   virtual void Initialize();
00057 
00059 
00066   virtual void Enable();
00067   virtual void Disable();
00069 
00073   virtual void Start();
00074 
00076 
00081   vtkSetMacro(InstallMessageProc,int);
00082   vtkGetMacro(InstallMessageProc,int);
00083   vtkBooleanMacro(InstallMessageProc,int);
00085 
00090   void TerminateApp(void);
00091 
00092   //BTX
00093   friend VTK_RENDERING_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
00094   friend VTK_RENDERING_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me);
00095 
00097 
00099   virtual void OnMouseMove  (HWND wnd, UINT nFlags, int X, int Y);
00100   virtual void OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
00101   virtual void OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
00102   virtual void OnRButtonUp  (HWND wnd, UINT nFlags, int X, int Y);
00103   virtual void OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
00104   virtual void OnMButtonUp  (HWND wnd, UINT nFlags, int X, int Y);
00105   virtual void OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
00106   virtual void OnLButtonUp  (HWND wnd, UINT nFlags, int X, int Y);
00107   virtual void OnSize       (HWND wnd, UINT nType,  int X, int Y);
00108   virtual void OnTimer      (HWND wnd, UINT nIDEvent);
00109   virtual void OnKeyDown    (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
00110   virtual void OnKeyUp      (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
00111   virtual void OnChar       (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
00112   virtual void OnMouseWheelForward (HWND wnd, UINT nFlags, int X, int Y);
00113   virtual void OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
00114   virtual void OnFocus(HWND wnd, UINT nFlags);
00115   virtual void OnKillFocus(HWND wnd, UINT nFlags);
00116   //ETX
00118 
00120 
00124   static void SetClassExitMethod(void (*f)(void *), void *arg);
00125   static void SetClassExitMethodArgDelete(void (*f)(void *));
00127 
00130   virtual void ExitCallback();
00131 
00132 protected:
00133   vtkWin32RenderWindowInteractor();
00134   ~vtkWin32RenderWindowInteractor();
00135 
00136   HWND    WindowId;
00137   WNDPROC OldProc;
00138   int     InstallMessageProc;
00139   int     MouseInWindow;
00140   int     StartedMessageLoop;
00141 
00142   //BTX
00144 
00147   static void (*ClassExitMethod)(void *);
00148   static void (*ClassExitMethodArgDelete)(void *);
00149   static void *ClassExitMethodArg;
00150   //ETX
00152 
00154 
00156   virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
00157   virtual int InternalDestroyTimer(int platformTimerId);
00159 
00160 #ifdef VTK_USE_TDX
00161   vtkTDxWinDevice *Device;
00162 #endif
00163   
00164 private:
00165   vtkWin32RenderWindowInteractor(const vtkWin32RenderWindowInteractor&);  // Not implemented.
00166   void operator=(const vtkWin32RenderWindowInteractor&);  // Not implemented.
00167 };
00168 
00169 #endif
00170