]> Creatis software - crea.git/blobdiff - src/creawxVTKRenderWindowInteractor.cxx
#3374 crea Bug New Normal - vtk8itk5wx3-mingw64
[crea.git] / src / creawxVTKRenderWindowInteractor.cxx
index 251a7cd8233a558e831503ecec8bd2ce267f4119..ab565eed6bf64ca4b4435615db9b2d537585dff8 100644 (file)
@@ -43,6 +43,8 @@
 
 =========================================================================*/
 
+
+
 #include <assert.h>
 
 #include "creawxVTKRenderWindowInteractor.h"
@@ -61,7 +63,8 @@
 
 // AKT: wxOSX 2.9.x defines __WXOSX_COCOA__ rather than __WXCOCOA__
 #ifdef __WXOSX_COCOA__
-#define __WXCOCOA__
+ #import <Cocoa/Cocoa.h>
+ #define __WXCOCOA__
 #endif
 
 #if defined(__WXMAC__) && wxCHECK_VERSION(2,9,0)
@@ -77,6 +80,7 @@
 #endif
 #endif
 
+
 //=======================================================================
 // LG : NAMESPACE IS NECESSARY TO AVOID CONFLICTING SYMBOLS IN DYN LIBS
 namespace crea
@@ -99,7 +103,7 @@ wxWindow* wxGetTopLevelParent(wxWindow *win)
 // To access objc calls on cocoa
 #ifdef __WXCOCOA__
 #ifdef VTK_USE_COCOA
-#import <Cocoa/Cocoa.h>
+//EED #import <Cocoa/Cocoa.h>
 // This trick is no longer need in VTK CVS, should get rid of that:
 #define id Id
 #else
@@ -220,7 +224,7 @@ namespace crea
   EVT_SIZE        (wxVTKRenderWindowInteractor::OnSize)
 END_EVENT_TABLE()
 
-vtkCxxRevisionMacro(wxVTKRenderWindowInteractor, "$Revision$")
+//EED win Compilation why??:  vtkCxxRevisionMacro(wxVTKRenderWindowInteractor, "$Revision$")
 vtkInstantiatorNewMacro(wxVTKRenderWindowInteractor)
 
 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
@@ -504,7 +508,19 @@ void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
   if(!Handle)
   {
     Handle = GetHandleHack();
+       
+#ifdef __WXCOCOA__
+       vtkCocoaRenderWindow    *rwin           = vtkCocoaRenderWindow::SafeDownCast(RenderWindow);
+    NSView                                     *nvsview        = (NSView* )Handle;
+       NSWindow                                *nswindow       = nvsview.window;
+    rwin->SetRootWindow( nswindow );
+    rwin->SetWindowId(  reinterpret_cast<void *>(nvsview) );
+#else  
     RenderWindow->SetWindowId(reinterpret_cast<void *>(Handle));
+#endif
+
+               
+       
 // Cocoa
 // this->GetNSView() <-> DisplayId
 // this->GetTopLevel()->GetNSWindow() <-> WindowId
@@ -923,6 +939,7 @@ void wxVTKRenderWindowInteractor::Render()
       RenderWindow->Render();
       }
 #endif
+
     }
 }
 //---------------------------------------------------------------------------