From: Frederic Cervenansky Date: Tue, 12 Jul 2011 09:38:09 +0000 (+0000) Subject: to use Cocoa (MacOsX) X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=471c69fe690517ba3c5e35e19c998ff45d3be459;p=crea.git to use Cocoa (MacOsX) --- diff --git a/src/creawxVTKRenderWindowInteractor.cxx b/src/creawxVTKRenderWindowInteractor.cxx index fa9d684..eeb123a 100644 --- a/src/creawxVTKRenderWindowInteractor.cxx +++ b/src/creawxVTKRenderWindowInteractor.cxx @@ -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. @@ -36,7 +36,12 @@ #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)