X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreawxVTKRenderWindowInteractor.mm;fp=src%2FcreawxVTKRenderWindowInteractor.mm;h=aa05b20a639bd87ae2900ca6cad674bd7e2bec52;hb=d8c00b0ffcd89eee151a38169a82f252454549e1;hp=6efc47c4c9f94e5b745522a9f7c5ac279d0b3a50;hpb=13746b9e3318f71af2cf48a8da8bbe487d84355e;p=crea.git diff --git a/src/creawxVTKRenderWindowInteractor.mm b/src/creawxVTKRenderWindowInteractor.mm index 6efc47c..aa05b20 100644 --- a/src/creawxVTKRenderWindowInteractor.mm +++ b/src/creawxVTKRenderWindowInteractor.mm @@ -508,30 +508,39 @@ printf("EED wxVTKRenderWindowInteractor::GetHandleHack End BBB handle_tmp %ld \ //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event)) { + +printf("EED wxVTKRenderWindowInteractor::OnPaint Start \n"); //must always be here - wxPaintDC pDC(this); +//EED2021-08-26 wxPaintDC pDC(this); + +printf("EED wxVTKRenderWindowInteractor::OnPaint 1 \n"); //do it here rather than in the cstor: this is safer. if(!Handle) { +printf("EED wxVTKRenderWindowInteractor::OnPaint 2 \n"); Handle = GetHandleHack(); #ifdef __WXCOCOA__ +printf("EED wxVTKRenderWindowInteractor::OnPaint 3 \n"); vtkCocoaRenderWindow *rwin = vtkCocoaRenderWindow::SafeDownCast(RenderWindow); NSView *nvsview = (NSView* )Handle; NSWindow *nswindow = nvsview.window; rwin->SetRootWindow( nswindow ); rwin->SetWindowId( reinterpret_cast(nvsview) ); #else +printf("EED wxVTKRenderWindowInteractor::OnPaint 4 \n"); RenderWindow->SetWindowId(reinterpret_cast(Handle)); #endif +printf("EED wxVTKRenderWindowInteractor::OnPaint 5 \n"); // Cocoa // this->GetNSView() <-> DisplayId // this->GetTopLevel()->GetNSWindow() <-> WindowId #ifdef __WXMSW__ +printf("EED wxVTKRenderWindowInteractor::OnPaint 6 \n"); RenderWindow->SetParentId(reinterpret_cast(this->GetParent()->GetHWND())); #endif //__WXMSW__ @@ -546,30 +555,45 @@ void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event)) #endif } // get vtk to render to the wxWindows + +printf("EED wxVTKRenderWindowInteractor::OnPaint 7 \n"); + Render(); #ifdef __WXMAC__ +printf("EED wxVTKRenderWindowInteractor::OnPaint 8 \n"); // This solves a problem with repainting after a window resize // See also: http://sourceforge.net/mailarchive/forum.php?thread_id=31690967&forum_id=41789 #ifdef __WXCOCOA__ +printf("EED wxVTKRenderWindowInteractor::OnPaint 9 \n"); #if !wxCHECK_VERSION(2, 9, 0) // this doesn't seem necessary with wxOSX 2.9.x +printf("EED wxVTKRenderWindowInteractor::OnPaint 10 \n"); vtkCocoaRenderWindow * rwin = vtkCocoaRenderWindow::SafeDownCast(RenderWindow); if( rwin ) { +printf("EED wxVTKRenderWindowInteractor::OnPaint 11 \n"); rwin->UpdateContext(); } #endif #else +printf("EED wxVTKRenderWindowInteractor::OnPaint 12 \n"); vtkCarbonRenderWindow* rwin = vtkCarbonRenderWindow::SafeDownCast(RenderWindow); if( rwin ) { +printf("EED wxVTKRenderWindowInteractor::OnPaint 13 \n"); #if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 4) // Must be somewhere after VTK 4.4 +printf("EED wxVTKRenderWindowInteractor::OnPaint 14 \n"); rwin->UpdateGLRegion(); #endif } #endif #endif + +printf("EED wxVTKRenderWindowInteractor::OnPaint 15 \n"); + +printf("EED wxVTKRenderWindowInteractor::OnPaint End \n"); + } //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event)