]> Creatis software - crea.git/commitdiff
#3385 macOS compatibility
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Thu, 9 Sep 2021 08:41:33 +0000 (10:41 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Thu, 9 Sep 2021 08:41:33 +0000 (10:41 +0200)
src/creawxVTKRenderWindowInteractor.cxx

index 4eff58db93a11f0b7a46ca854fa32862a0a42112..6bc66c2f2df9f15d6c850d60dd77f9d99c83e92a 100644 (file)
@@ -63,8 +63,8 @@
 
 // AKT: wxOSX 2.9.x defines __WXOSX_COCOA__ rather than __WXCOCOA__
 #ifdef __WXOSX_COCOA__
- #import <Cocoa/Cocoa.h>
- #define __WXCOCOA__
  #import <Cocoa/Cocoa.h>
  #define __WXCOCOA__
 #endif
 
 #if defined(__WXMAC__) && wxCHECK_VERSION(2,9,0)
@@ -103,7 +103,6 @@ wxWindow* wxGetTopLevelParent(wxWindow *win)
 // To access objc calls on cocoa
 #ifdef __WXCOCOA__
 #ifdef VTK_USE_COCOA
-//EED #import <Cocoa/Cocoa.h>
 // This trick is no longer need in VTK CVS, should get rid of that:
 #define id Id
 #else
@@ -224,7 +223,11 @@ namespace crea
 END_EVENT_TABLE()
 
 //EED win Compilation why??:  vtkCxxRevisionMacro(wxVTKRenderWindowInteractor, "$Revision$")
-vtkInstantiatorNewMacro(wxVTKRenderWindowInteractor)
+
+//EED2020-04-10
+#if VTK_MAJOR_VERSION < 8 
+    vtkInstantiatorNewMacro(wxVTKRenderWindowInteractor)
+#endif
 
 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
 static int wxvtk_attributes[]={
@@ -391,12 +394,20 @@ void wxVTKRenderWindowInteractor::UpdateSize(int x, int y)
       Size[0] = x;
       Size[1] = y;
       // and our RenderWindow's size
+
+#ifdef __WXCOCOA__
+  #ifdef VTK_USE_COCOA
+  #else
+  #endif //VTK_USE_COCOA
+#else
       RenderWindow->SetSize(x, y);
+#endif //__WXCOCOA__
+      
 #if defined(__WXMSW__)
       this->Refresh();
 #endif //__WXMSW__
-    }
-  }
+    } // if x y
+  } // if RenderWindow
 }
 //---------------------------------------------------------------------------
 int wxVTKRenderWindowInteractor::CreateTimer(int WXUNUSED(timertype))
@@ -501,7 +512,11 @@ long wxVTKRenderWindowInteractor::GetHandleHack()
 void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
   //must always be here
-  wxPaintDC pDC(this);
+//EED2021-08-26  
+#ifdef __WXCOCOA__
+#else
+       wxPaintDC pDC(this);
+#endif
 
   //do it here rather than in the cstor: this is safer.
   if(!Handle)
@@ -517,8 +532,6 @@ void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
 #else  
     RenderWindow->SetWindowId(reinterpret_cast<void *>(Handle));
 #endif
-
-               
        
 // Cocoa
 // this->GetNSView() <-> DisplayId