]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Bypass to old method for Polyhedron datat:
authorAfeef <afeef.badri@gmail.com>
Mon, 12 Apr 2021 11:00:45 +0000 (13:00 +0200)
committerAfeef <afeef.badri@gmail.com>
Mon, 12 Apr 2021 11:00:45 +0000 (13:00 +0200)
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

index ca245728fa5e84e496397463ffab5a9959e6d740..169d7d8034584963b2c93846868176e6b2325966 100644 (file)
@@ -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<vtkUnstructuredGrid*>(input);
-          bool Contains1D2DQuads = false;
+          bool NotFitForDelegation = false;
           if ( vtkUnsignedCharArray* types = inputUnstrctured->GetCellTypesArray() )
             {
-             std::set<vtkIdType> 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<vtkIdType> 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);