From 96be80d230e64be67141274fdbfd06e499305eab Mon Sep 17 00:00:00 2001 From: Afeef Date: Mon, 12 Apr 2021 13:00:45 +0200 Subject: [PATCH] Bypass to old method for Polyhedron datat: Multi-threding of VTK causes problems for Polyhedron data, the code at the moment does not seem stable. To be investigated in future, if VTK can be patched. --- src/VTKViewer/VTKViewer_GeometryFilter.cxx | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.cxx b/src/VTKViewer/VTKViewer_GeometryFilter.cxx index ca245728f..169d7d803 100644 --- a/src/VTKViewer/VTKViewer_GeometryFilter.cxx +++ b/src/VTKViewer/VTKViewer_GeometryFilter.cxx @@ -184,7 +184,7 @@ VTKViewer_GeometryFilter if (delegateToVtk) { - + // get the info objects excluded faces vtkInformation* excInfo = inputVector[1]->GetInformationObject(0); @@ -207,20 +207,21 @@ VTKViewer_GeometryFilter case VTK_UNSTRUCTURED_GRID: { vtkUnstructuredGrid* inputUnstrctured = static_cast(input); - bool Contains1D2DQuads = false; + bool NotFitForDelegation = false; if ( vtkUnsignedCharArray* types = inputUnstrctured->GetCellTypesArray() ) { - std::set quad1D2DTypes; - quad1D2DTypes.insert( VTK_QUADRATIC_EDGE ); - quad1D2DTypes.insert( VTK_QUADRATIC_TRIANGLE ); - quad1D2DTypes.insert( VTK_BIQUADRATIC_TRIANGLE ); - quad1D2DTypes.insert( VTK_QUADRATIC_QUAD ); - quad1D2DTypes.insert( VTK_BIQUADRATIC_QUAD ); - quad1D2DTypes.insert( VTK_QUADRATIC_POLYGON ); - for ( int i = 0; i < types->GetNumberOfTuples() && !Contains1D2DQuads; ++i ) - Contains1D2DQuads = quad1D2DTypes.count( types->GetValue(i) ); + std::set ElementsNotFitToDelegate; + ElementsNotFitToDelegate.insert( VTK_QUADRATIC_EDGE ); + ElementsNotFitToDelegate.insert( VTK_QUADRATIC_TRIANGLE ); + ElementsNotFitToDelegate.insert( VTK_BIQUADRATIC_TRIANGLE ); + ElementsNotFitToDelegate.insert( VTK_QUADRATIC_QUAD ); + ElementsNotFitToDelegate.insert( VTK_BIQUADRATIC_QUAD ); + ElementsNotFitToDelegate.insert( VTK_QUADRATIC_POLYGON ); + ElementsNotFitToDelegate.insert( VTK_POLYHEDRON ); + for ( int i = 0; i < types->GetNumberOfTuples() && !NotFitForDelegation; ++i ) + NotFitForDelegation = ElementsNotFitToDelegate.count( types->GetValue(i) ); } - if ( Contains1D2DQuads ) + if ( NotFitForDelegation ) return this->UnstructuredGridExecute(input, output, outInfo); else return this->vtkGeometryFilter::UnstructuredGridExecute(input, output, nullptr, &exc); -- 2.39.2