+ //while(itFaces->more()) if(itFaces->next()->NbNodes()==4) Nb++;
+ const SMDS_MeshFace * curFace;
+ while (itFaces->more()) {
+ curFace = itFaces->next();
+ if (!curFace->IsPoly() && curFace->NbNodes() == 4) Nb++;
+ }
+ return Nb;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// Return the number of polygonal faces in the mesh. This method run in O(n)
+///////////////////////////////////////////////////////////////////////////////
+int SMESH_Mesh::NbPolygons() throw(SALOME_Exception)
+{
+ Unexpect aCatch(SalomeException);
+ int Nb = 0;
+ SMDS_FaceIteratorPtr itFaces = _myMeshDS->facesIterator();
+ while (itFaces->more())
+ if (itFaces->next()->IsPoly()) Nb++;