]> Creatis software - creaMaracasVisu.git/commitdiff
#3473 Stuck Render macOS
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 5 Nov 2021 07:10:04 +0000 (08:10 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 5 Nov 2021 07:10:04 +0000 (08:10 +0100)
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx

index c8cedd05ebcee7bf2e5c624a14cb1967dbc89481..b40c577960ab68b8c30cf1ab72ac7e50f0ec2ccd 100644 (file)
@@ -147,21 +147,10 @@ void vtkInteractorStyleBaseView::InsertInteractorStyleMaracas(int pos, Interacto
 //---------------------------------------------------------------------------
 void vtkInteractorStyleBaseView::CallLstInteractorStyleMaracas(int type)
 {
-printf("EED vtkInteractorStyleBaseView::CallLstInteractorStyleMaracas Start \n ");
        InteractorStyleMaracas *intStyMar;
 
        int i,size=_lstInteractorStyleMaracas.size();
 
-//EED Borrame
-//FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
-//fprintf(ff,"EED vtkInteractorStyleBaseView::CallLstInteractorStyleMaracas \n" );
-//for (i=0;i<size;i++)
-//{
-//fprintf(ff,"    %p\n" , _lstInteractorStyleMaracas[i] );
-//}
-//fclose(ff);
-
-
 
        for (i=0;i<size;i++)
        {
@@ -270,8 +259,6 @@ printf("EED vtkInteractorStyleBaseView::CallLstInteractorStyleMaracas Start \n "
        } // for
 
        EvaluateToRefresh();
-printf("EED vtkInteractorStyleBaseView::CallLstInteractorStyleMaracas End \n ");
-
 }
 //---------------------------------------------------------------------------
 void  vtkInteractorStyleBaseView::OnChar()  // virtual 
@@ -365,15 +352,12 @@ bool vtkInteractorStyleBaseView::GetParent_refresh_waiting()
 //---------------------------------------------------------------------------
 void vtkInteractorStyleBaseView::EvaluateToRefresh()
 {
-printf("EED vtkInteractorStyleBaseView::EvaluateToRefresh Start \n ");
        if  ( _blockRefresh==false )
        {
                if ( (_refresh_waiting==true) && (_parent_refresh_waiting==false))
                {
                        _refresh_waiting                = false;
-            printf("EED vtkInteractorStyleBaseView::EvaluateToRefresh 1.0 \n ");
                        this->_wxvtkbaseview->Refresh();
-            printf("EED vtkInteractorStyleBaseView::EvaluateToRefresh 1.1 \n ");
                }
                if (_parent_refresh_waiting==true)
                {
@@ -384,22 +368,17 @@ printf("EED vtkInteractorStyleBaseView::EvaluateToRefresh Start \n ");
 #if wxMAJOR_VERSION <= 2
                        this->_wxvtkbaseview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
 #else
-            printf("EED vtkInteractorStyleBaseView::EvaluateToRefresh 2.0 \n ");
                        this->_wxvtkbaseview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
-            printf("EED vtkInteractorStyleBaseView::EvaluateToRefresh 2.1 \n ");
 #endif
 
                        int i;
                        int size = _lstParentToReport.size();
                        for(i = 0; i<size; i++)
                        {       
-                printf("EED vtkInteractorStyleBaseView::EvaluateToRefresh 3.0 \n ");
                                _lstParentToReport[i]->ProcessEvent(newevent1);
-                printf("EED vtkInteractorStyleBaseView::EvaluateToRefresh 3.1 \n ");
                        }//for
                }//if
        }//if _blockRefresh
-printf("EED vtkInteractorStyleBaseView::EvaluateToRefresh End\n");
 }
 //---------------------------------------------------------------------------
 void vtkInteractorStyleBaseView::BlockRefresh()
index b27f41d1727125b0dc2de7b9cddc49d1a66709d2..e1e80e325a605d73311856c259d7a3e2a6fcd92a 100644 (file)
@@ -71,11 +71,9 @@ vtkRenderWindow* wxVtk3DBaseView::GetRenWin()  // virtual
 //-------------------------------------------------------------------
 void wxVtk3DBaseView::Refresh()
 {
-printf("EED wxVtk3DBaseView::Refresh Start\n");
 //     _renWin->Render();
        vtkRenderWindowInteractor *vri = GetWxVTKRenderWindowInteractor();
        vri->vtkRenderWindowInteractor::Render();
-printf("EED wxVtk3DBaseView::Refresh End\n");
 }
 
 //-------------------------------------------------------------------
@@ -217,6 +215,18 @@ void wxVtk3DBaseView::Configure()
                _aRenderer->SetMaximumNumberOfPeels(100);
                _renWin->SetMultiSamples(0);
                _renWin->SetAlphaBitPlanes(1);
+        
+//EED 2021-11-3
+// The Depth Peeling method have a bug in MacOs
+// In vtkDualDepthPeelingPass::Peel()   TranslucentWrittenPixels are incoherent  TOO BIG  some times. Why ??
+// So the comparition in vtkDualDepthPeelingPass::PeelingDone()  is not coherent.
+//   while (!this->PeelingDone())
+//        {
+//          this->Peel();
+//        }
+// Or CurrentPeel >= MaximumNumberOfPeels || TranslucentWrittenPixels <= OcclusionThreshold not coherent. Why ??
+        _aRenderer->UseDepthPeelingOff();
+        
        } // if _configure
 }
 
index 88a5cff541a4d943623f64107833dd0a4947d8b6..6c589886394c482446749aaa14f6726f947623c7 100644 (file)
@@ -80,8 +80,6 @@ void wxVtkBaseView::Configure()  // virtual
 //-------------------------------------------------------------------
 void wxVtkBaseView::Refresh()  // virtual 
 {
-printf("EED wxVtkBaseView::Refresh Start \n ");
-
 // EED 10 Oct 2007
        #if defined(WIN32)
                _iren->Refresh(true);
@@ -95,7 +93,6 @@ printf("EED wxVtkBaseView::Refresh Start \n ");
        vri->vtkRenderWindowInteractor::Render();
                //_iren->Refresh();
        #endif
-printf("EED wxVtkBaseView::Refresh End\n");
 }
 //-------------------------------------------------------------------
 void wxVtkBaseView::RefreshView()  // virtual