Salome HOME
23382: [CEA 1981] Wrong mesh SMESH test V8_2_0a1
authoreap <eap@opencascade.com>
Mon, 7 Nov 2016 12:12:37 +0000 (15:12 +0300)
committereap <eap@opencascade.com>
Mon, 7 Nov 2016 12:12:37 +0000 (15:12 +0300)
src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_Gen.hxx
src/SMESH_I/SMESH_Gen_i.cxx

index 504089aea77cf618f6939a85d77e6a23c5f15bd6..752b5f6ebaded468801dc43866724e1972e05ace 100644 (file)
@@ -371,9 +371,6 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
 
   MEMOSTAT;
 
-  if ( aCompactMesh )
-    aMesh.GetMeshDS()->compactMesh();
-
   // fix quadratic mesh by bending iternal links near concave boundary
   if ( aCompactMesh && // a final compute
        aShape.IsSame( aMesh.GetShapeToMesh() ) &&
@@ -386,6 +383,10 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
       aHelper.FixQuadraticElements( sm->GetComputeError() );
     }
   }
+
+  if ( aCompactMesh )
+    aMesh.GetMeshDS()->compactMesh();
+
   return ret;
 }
 
index eb6934595dc0802d9590853d50533b190ec97f66..d011050354f065381884f99f8ffb016f5c77c67d 100644 (file)
@@ -60,7 +60,7 @@ typedef struct studyContextStruct
 
 typedef std::set<int> TSetOfInt;
 
-class SMESH_EXPORT  SMESH_Gen
+class SMESH_EXPORT SMESH_Gen
 {
 public:
   SMESH_Gen();
index 2397c7f6c3643c565e5b1f3c4e0ca2a1f2501e2b..72540ef327ee532123a856b20c73fdf0e1b05015 100644 (file)
@@ -1924,7 +1924,10 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh,
       // call implementation compute
       ::SMESH_Mesh& myLocMesh = meshServant->GetImpl();
       myGen.PrepareCompute( myLocMesh, myLocShape );
-      bool ok = myGen.Compute( myLocMesh, myLocShape, myLocShape != myLocMesh.GetShapeToMesh());
+      int how = ::SMESH_Gen::COMPACT_MESH;
+      if ( myLocShape != myLocMesh.GetShapeToMesh() ) // compute a sub-mesh
+        how |= ::SMESH_Gen::SHAPE_ONLY;
+      bool ok = myGen.Compute( myLocMesh, myLocShape, how );
       meshServant->CreateGroupServants(); // algos can create groups (issue 0020918)
       myLocMesh.GetMeshDS()->Modified();
       return ok;