From 7db93b7e3afbd3f22074d570a51ab206fd9ff5e4 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Thu, 28 Jul 2022 11:55:06 +0200 Subject: [PATCH] #3488 Bug with segmentation fault with VTK 9.2 ( SupportsOpenGL ) --- .../wxWindows/widgets/wxVtk2DBaseView.cxx | 1 + .../wxWindows/widgets/wxVtk3DBaseView.cxx | 37 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx index 941b3ef..61ad9f6 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx @@ -289,6 +289,7 @@ void wxVtk2DBaseView::Configure(bool okimage) } // okimage } // imageData + } //------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx index 05ccfb1..280f791 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx @@ -150,32 +150,34 @@ void wxVtk3DBaseView::Configure() //wxVtkBaseView::Configure(); _aRenderer = vtkRenderer::New(); _renWin = vtkRenderWindow::New(); - - - int supportopengl=_renWin->SupportsOpenGL(); - printf("EED wxVtk3DBaseView::Configure >>>>> vtkRenderWindow SupportsOpenGL %d\n", supportopengl ); - printf("EED wxVtk3DBaseView::Configure >>>>> vtkRenderWindow IsDirect %d\n", _renWin->IsDirect() ); - if (supportopengl==0) - { + + + printf("EED wxVtk3DBaseView::Configure >>>>> vtkRenderWindow IsDirect %d\n", _renWin->IsDirect() ); + + /* EED 2022-07-26 Segmentation fault with VTK9.2 Macos + int supportopengl=_renWin->SupportsOpenGL(); + printf("EED wxVtk3DBaseView::Configure >>>>> vtkRenderWindow SupportsOpenGL %d\n", supportopengl ); + if (supportopengl==0) + { #if defined(_WIN32) - printf(" OpenGL 3 not detected.\n Try to install opengl drivers or use de opengl-mesa version.\n Copy from \\CreaTools\\crea_TPdlls-4.0.0\\bin\\opengl-mesa\n the file: opengl32.dll\n to \\CreaTools\\CreaTools-3.0.0\\bin \n"); + printf(" OpenGL 3 not detected.\n Try to install opengl drivers or use de opengl-mesa version.\n Copy from \\CreaTools\\crea_TPdlls-4.0.0\\bin\\opengl-mesa\n the file: opengl32.dll\n to \\CreaTools\\CreaTools-3.0.0\\bin \n"); #else - printf(" OpenGL 3 not detected.\n Try to install opengl drivers or use de opengl-mesa version.\n"); + printf(" OpenGL 3 not detected.\n Try to install opengl drivers or use de opengl-mesa version.\n"); #endif - exit(0); - } - + exit(0); + } + */ + + + _renWin->AddRenderer(_aRenderer); _aRenderer->GradientBackgroundOn(); _aRenderer->SetBackground( 0.33 , 0.33 , 0.33 ); _aRenderer->SetBackground2( 0.66 , 0.66 , 0.66 ); - - // _aRenderer->GradientBackgroundOff(); // _aRenderer->SetBackground(0,0,0 ); - SetStereo(0); @@ -231,7 +233,9 @@ void wxVtk3DBaseView::Configure() // this->Peel(); // } // Or CurrentPeel >= MaximumNumberOfPeels || TranslucentWrittenPixels <= OcclusionThreshold not coherent. Why ?? - _aRenderer->UseDepthPeelingOff(); + + //EED 2021-07-25 +// _aRenderer->UseDepthPeelingOff(); /* @@ -242,6 +246,7 @@ _renWin -> SetStereoTypeToSplitViewportHorizontal(); } // if _configure + } //------------------------------------------------------------------- -- 2.47.1