]> Creatis software - crea.git/commitdiff
to use Cocoa (MacOsX)
authorFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Tue, 12 Jul 2011 09:38:09 +0000 (09:38 +0000)
committerFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Tue, 12 Jul 2011 09:38:09 +0000 (09:38 +0000)
src/creawxVTKRenderWindowInteractor.cxx

index fa9d6842f4c11ec103d23ab2239349e175b363ae..eeb123ac24518c34b792ddacf7f722fd62a88dbc 100644 (file)
@@ -3,8 +3,8 @@
   Program:   Visualization Toolkit
   Module:    $RCSfile: creawxVTKRenderWindowInteractor.cxx,v $
   Language:  C++
-  Date:      $Date: 2011/02/22 08:26:24 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2011/07/12 09:38:09 $
+  Version:   $Revision: 1.8 $
 
   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
   All rights reserved.
 #include "vtkDebugLeaks.h"
 
 #ifdef __WXMAC__
-#include "vtkCarbonRenderWindow.h"
+#ifdef VTK_USE_COCOA 
+       #include "vtkCocoaRenderWindow.h"
+#else
+       #include "vtkCarbonRenderWindow.h"
+#endif
+
 #endif
 
 //Keep this for compatibilty reason, this was introduced in wxGTK 2.4.0
@@ -134,7 +139,7 @@ BEGIN_EVENT_TABLE(creawxVTKRenderWindowInteractor, wxWindow)
   EVT_SIZE        (creawxVTKRenderWindowInteractor::OnSize)
 END_EVENT_TABLE()
 
-//EED win Compilation why??: vtkCxxRevisionMacro(creawxVTKRenderWindowInteractor, "$Revision: 1.7 $")
+//EED win Compilation why??: vtkCxxRevisionMacro(creawxVTKRenderWindowInteractor, "$Revision: 1.8 $")
 vtkInstantiatorNewMacro(creawxVTKRenderWindowInteractor)
 
 //---------------------------------------------------------------------------
@@ -375,7 +380,15 @@ void creawxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
   // get vtk to render to the wxWindows
   Render();
 #ifdef __WXMAC__
-  // This solves a problem with repainting after a window resize
+
+#ifdef VTK_USE_COCOA
+  vtkCocoaRenderWindow* rwin = vtkCocoaRenderWindow::SafeDownCast(RenderWindow);
+  if( rwin )
+  {
+    rwin->UpdateContext();
+  }
+#else
+    // This solves a problem with repainting after a window resize
   // See also: http://sourceforge.net/mailarchive/forum.php?thread_id=31690967&forum_id=41789
   vtkCarbonRenderWindow* rwin = vtkCarbonRenderWindow::SafeDownCast(RenderWindow);
   if( rwin )
@@ -383,6 +396,7 @@ void creawxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
     rwin->UpdateGLRegion();
   }
 #endif
+#endif
 }
 //---------------------------------------------------------------------------
 void creawxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event)