X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH%2FSMESH_ProxyMesh.cxx;h=4c1a87ea4645c48fbec7e903f627d666d0fc61e3;hp=36d745f6511da3613a1464192e2f194a56204559;hb=refs%2Ftags%2FV9_7_0a1;hpb=0743fa8f5f572825041c1cee5b1b585d84f37270 diff --git a/src/SMESH/SMESH_ProxyMesh.cxx b/src/SMESH/SMESH_ProxyMesh.cxx index 36d745f65..4c1a87ea4 100644 --- a/src/SMESH/SMESH_ProxyMesh.cxx +++ b/src/SMESH/SMESH_ProxyMesh.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -402,9 +402,9 @@ SMDS_ElemIteratorPtr SMESH_ProxyMesh::GetFaces() const */ //================================================================================ -int SMESH_ProxyMesh::NbFaces() const +smIdType SMESH_ProxyMesh::NbFaces() const { - int nb = 0; + smIdType nb = 0; if ( _mesh->HasShapeToMesh() ) { TopTools_IndexedMapOfShape FF; @@ -639,6 +639,33 @@ SMDS_ElemIteratorPtr SMESH_ProxyMesh::GetInverseElementIterator(const SMDS_MeshN return iter; } +//================================================================================ +/*! + * \brief Check if a FACE has prisms on its both sides + * \param [in] smFace - sub-mesh of the FACE. NOT a proxy sub-mesh! + * \return bool - true if there are prisms on the two sides + */ +//================================================================================ + +bool SMESH_ProxyMesh::HasPrismsOnTwoSides( SMESHDS_SubMesh* smFace ) +{ + if ( !smFace || smFace->NbElements() == 0 ) + return false; + + SMDS_ElemIteratorPtr faces = smFace->GetElements(); + while ( faces->more() ) + { + const SMDS_MeshElement* f = faces->next(); + std::vector fNodes( f->begin_nodes(), f->end_nodes() ); + std::vector vols; + if ( SMDS_Mesh::GetElementsByNodes( fNodes, vols, SMDSAbs_Volume ) < 2 ) + return false; + return ( vols[0]->NbCornerNodes() == 2 * f->NbCornerNodes() && + vols[1]->NbCornerNodes() == 2 * f->NbCornerNodes() ); + } + return false; +} + //================================================================================ /*! * \brief SubMesh Constructor @@ -688,7 +715,7 @@ void SMESH_ProxyMesh::SubMesh::Clear() */ //================================================================================ -int SMESH_ProxyMesh::SubMesh::NbElements() const +smIdType SMESH_ProxyMesh::SubMesh::NbElements() const { return _uvPtStructVec.empty() ? _elements.size() : _uvPtStructVec.size() - 1; } @@ -713,7 +740,7 @@ SMDS_ElemIteratorPtr SMESH_ProxyMesh::SubMesh::GetElements() const */ //================================================================================ -int SMESH_ProxyMesh::SubMesh::NbNodes() const +smIdType SMESH_ProxyMesh::SubMesh::NbNodes() const { return _uvPtStructVec.size(); }