From: Afeef Date: Mon, 12 Apr 2021 11:00:45 +0000 (+0200) Subject: Bypass to old method for Polyhedron datat: X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=96be80d230e64be67141274fdbfd06e499305eab;p=modules%2Fgui.git 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. --- 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);