X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreawxVTKRenderWindowInteractor.mm;fp=src%2FcreawxVTKRenderWindowInteractor.mm;h=6bc66c2f2df9f15d6c850d60dd77f9d99c83e92a;hb=0ec2144d3569d045ee5dfe886e3db723f400225a;hp=3047c9397e9c54ec980e4edfa0b30ad39ef665b9;hpb=ad89139d4d59c2ea606d45bcce1784ef5c7b187f;p=crea.git diff --git a/src/creawxVTKRenderWindowInteractor.mm b/src/creawxVTKRenderWindowInteractor.mm index 3047c93..6bc66c2 100644 --- a/src/creawxVTKRenderWindowInteractor.mm +++ b/src/creawxVTKRenderWindowInteractor.mm @@ -43,15 +43,12 @@ =========================================================================*/ -//#import + #include #include "creawxVTKRenderWindowInteractor.h" -#include - - //This is needed for vtk 3.1 : #ifndef VTK_MAJOR_VERSION # include "vtkVersion.h" @@ -66,7 +63,8 @@ // AKT: wxOSX 2.9.x defines __WXOSX_COCOA__ rather than __WXCOCOA__ #ifdef __WXOSX_COCOA__ -#define __WXCOCOA__ + #import + #define __WXCOCOA__ #endif #if defined(__WXMAC__) && wxCHECK_VERSION(2,9,0) @@ -105,7 +103,6 @@ wxWindow* wxGetTopLevelParent(wxWindow *win) // To access objc calls on cocoa #ifdef __WXCOCOA__ #ifdef VTK_USE_COCOA -#import // This trick is no longer need in VTK CVS, should get rid of that: #define id Id #else @@ -114,7 +111,6 @@ wxWindow* wxGetTopLevelParent(wxWindow *win) #endif //__WXCOCOA__ #if wxMAJOR_VERSION <= 2 - #ifdef __WXGTK__ #include // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0 #include "gdk/gdkprivate.h" @@ -515,9 +511,12 @@ long wxVTKRenderWindowInteractor::GetHandleHack() //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event)) { - //must always be here -//EED2021-08-26 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) @@ -526,9 +525,6 @@ void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event)) #ifdef __WXCOCOA__ vtkCocoaRenderWindow *rwin = vtkCocoaRenderWindow::SafeDownCast(RenderWindow); -//2021-08-30 -// rwin->SetWantsBestResolution(true); - NSView *nvsview = (NSView* )Handle; NSWindow *nswindow = nvsview.window; rwin->SetRootWindow( nswindow ); @@ -555,8 +551,7 @@ void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event)) #endif } // get vtk to render to the wxWindows - -Render(); + Render(); #ifdef __WXMAC__ // This solves a problem with repainting after a window resize // See also: http://sourceforge.net/mailarchive/forum.php?thread_id=31690967&forum_id=41789 @@ -570,7 +565,6 @@ Render(); } #endif #else - vtkCarbonRenderWindow* rwin = vtkCarbonRenderWindow::SafeDownCast(RenderWindow); if( rwin ) { @@ -582,7 +576,6 @@ Render(); #endif #endif } - //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event) { @@ -606,9 +599,7 @@ void wxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event)) #endif //this will check for Handle //Render(); - } - //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event) { @@ -617,7 +608,6 @@ void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event) return; } #if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) - SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);