]> Creatis software - bbtk.git/blobdiff - packages/wxvtk/src/wxVTKRenderWindowInteractor.h
#3127 BBTK Feature New Normal - branch changeWx28to30 compilation with wxWidgets3
[bbtk.git] / packages / wxvtk / src / wxVTKRenderWindowInteractor.h
index 12f33f88b272156d3ebb14bed6576f387548c589..c7f60514cb2842929846979775cadaa2ebebaf4a 100644 (file)
 /*=========================================================================
 
   Program:   Visualization Toolkit
-  Module:    $RCSfile: wxVTKRenderWindowInteractor.h,v $
+  Module:    $RCSfile$
   Language:  C++
-  Date:      $Date: 2012/11/16 08:52:36 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date$
+  Version:   $Revision$
+
+  Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
+  All rights reserved.
+  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
+
+     This software is distributed WITHOUT ANY WARRANTY; without even 
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+     PURPOSE.  See the above copyright notice for more information.
+
 =========================================================================*/
 
 // .NAME  wxVTKRenderWindowInteractor - class to enable VTK to render to 
 #include "vtkRenderWindowInteractor.h"
 #include "vtkRenderWindow.h"
 
-// Apparently since wxGTK 2.8.0 one can finally use wxWindow (just as in any
-// other port):
-// MM: tested on 2008/04/08: experienced some heavy flickering with wx-widget 2.6.0
-// using a wxWindow instead of wxGLCanvas fixed the symptoms
-//#if (!wxCHECK_VERSION(2, 6, 0))
-#if (!wxCHECK_VERSION(2, 8, 0))
 #define USE_WXGLCANVAS
-#endif
 
 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
 #  if wxUSE_GLCANVAS
@@ -115,7 +116,12 @@ class wxVTKRenderWindowInteractor : public wxGLCanvas, public vtkRenderWindowInt
 class wxVTKRenderWindowInteractor : public wxWindow, public vtkRenderWindowInteractor
 #endif //__WXGTK__
 {
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
   DECLARE_DYNAMIC_CLASS(wxVTKRenderWindowInteractor)
+#else
+  wxDECLARE_DYNAMIC_CLASS(wxVTKRenderWindowInteractor);
+#endif
   
   public:
     //constructors
@@ -155,13 +161,16 @@ class wxVTKRenderWindowInteractor : public wxWindow, public vtkRenderWindowInter
 #if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
     void OnEnter(wxMouseEvent &event);
     void OnLeave(wxMouseEvent &event);
+    void OnMouseWheel(wxMouseEvent& event);
+#if wxCHECK_VERSION(2, 8, 0)
+    void OnMouseCaptureLost(wxMouseCaptureLostEvent& event);
+#endif
     void OnKeyDown(wxKeyEvent &event);
     void OnKeyUp(wxKeyEvent &event);
     void OnChar(wxKeyEvent &event);
 #endif
     void OnTimer(wxTimerEvent &event);
     void OnSize(wxSizeEvent &event);
-    void OnMouseWheel(wxMouseEvent& event);
 
     void Render();
     void SetRenderWhenDisabled(int newValue);
@@ -180,10 +189,18 @@ class wxVTKRenderWindowInteractor : public wxWindow, public vtkRenderWindowInter
     vtkSetMacro(UseCaptureMouse,int);
     vtkBooleanMacro(UseCaptureMouse,int);
 
+#if VTK_MAJOR_VERSION > 5 || (VTK_MAJOR_VERSION == 5 && VTK_MINOR_VERSION >= 2)
   protected:
+    virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
+    virtual int InternalDestroyTimer(int platformTimerId);
+#endif
+
+  protected:
+#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
+    wxGLContext *context;
+#endif
     wxTimer timer;
     int ActiveButton;
-    int RenderAllowed;
     long GetHandleHack();
     int Stereo;