Salome HOME
In GetSubMesh(), assure calling fillAncestorsMap() for each compound
[modules/smesh.git] / src / SMESH / SMESH_Mesh.cxx
index a7e10a243f7bf6b3ed4d16d41ae87df2c1c08ba1..22fd2e44e51e28713d2213b04adf2bccfaa680db 100644 (file)
@@ -918,10 +918,9 @@ SMESH_subMesh *SMESH_Mesh::GetSubMesh(const TopoDS_Shape & aSubShape)
     if ( it.More() )
     {
       index = _myMeshDS->AddCompoundSubmesh( aSubShape, it.Value().ShapeType() );
-      if ( index > _nbSubShapes ) _nbSubShapes = index; // not to create sm for this group again
-
       // fill map of Ancestors
-      fillAncestorsMap(aSubShape);
+      while ( _nbSubShapes < index )
+        fillAncestorsMap( _myMeshDS->IndexToShape( ++_nbSubShapes ));
     }
   }
 //   if ( !index )
@@ -1502,6 +1501,18 @@ int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const throw(SALOME_Excep
   return _myMeshDS->GetMeshInfo().NbTriangles(order);
 }
 
+//================================================================================
+/*!
+ * \brief Return number of biquadratic triangles in the mesh
+ */
+//================================================================================
+
+int SMESH_Mesh::NbBiQuadTriangles() const throw(SALOME_Exception)
+{
+  Unexpect aCatch(SalomeException);
+  return _myMeshDS->GetMeshInfo().NbBiQuadTriangles();
+}
+
 //================================================================================
 /*!
  * \brief Return the number nodes faces in the mesh