Salome HOME
54462: Hexa(ijk) fails on a composite block with a degenerated edge
[modules/smesh.git] / src / Controls / SMESH_Controls.cxx
index 1ccd96f9905611d39a69424bcebb65a90f437dc6..f71565018cb61459c3a39f638d4c493cc59a891e 100644 (file)
@@ -3043,7 +3043,7 @@ bool ConnectedElements::IsSatisfy( long theElementId )
       {
         // keep elements of myType
         const SMDS_MeshElement* element = eIt->next();
-        if ( element->GetType() == myType )
+        if ( myType == SMDSAbs_All || element->GetType() == myType )
           myOkIDs.insert( myOkIDs.end(), element->GetID() );
 
         // enqueue nodes of the element
@@ -4425,6 +4425,12 @@ bool ElementsOnShape::IsSatisfy (const SMDS_MeshElement* elem)
   return isSatisfy;
 }
 
+//================================================================================
+/*!
+ * \brief Check and optionally return a satisfying shape
+ */
+//================================================================================
+
 bool ElementsOnShape::IsSatisfy (const SMDS_MeshNode* node,
                                  TopoDS_Shape*        okShape)
 {
@@ -4561,6 +4567,7 @@ ElementsOnShape::Classifier::~Classifier()
 
 bool ElementsOnShape::Classifier::isOutOfSolid (const gp_Pnt& p)
 {
+  if ( isOutOfBox( p )) return true;
   mySolidClfr->Perform( p, myTol );
   return ( mySolidClfr->State() != TopAbs_IN && mySolidClfr->State() != TopAbs_ON );
 }
@@ -4572,6 +4579,7 @@ bool ElementsOnShape::Classifier::isOutOfBox (const gp_Pnt& p)
 
 bool ElementsOnShape::Classifier::isOutOfFace  (const gp_Pnt& p)
 {
+  if ( isOutOfBox( p )) return true;
   myProjFace.Perform( p );
   if ( myProjFace.IsDone() && myProjFace.LowerDistance() <= myTol )
   {
@@ -4588,6 +4596,7 @@ bool ElementsOnShape::Classifier::isOutOfFace  (const gp_Pnt& p)
 
 bool ElementsOnShape::Classifier::isOutOfEdge  (const gp_Pnt& p)
 {
+  if ( isOutOfBox( p )) return true;
   myProjEdge.Perform( p );
   return ! ( myProjEdge.NbPoints() > 0 && myProjEdge.LowerDistance() <= myTol );
 }
@@ -4860,7 +4869,7 @@ bool BelongToGeom::IsSatisfy (long theId)
   {
     if ( const SMDS_MeshElement* anElem = myMeshDS->FindElement( theId ))
     {
-      if ( anElem->GetType() == myType )
+      if ( myType == SMDSAbs_All || anElem->GetType() == myType )
       {
         if ( anElem->getshapeId() < 1 )
           return myElementsOnShapePtr->IsSatisfy(theId);
@@ -5000,7 +5009,8 @@ bool LyingOnGeom::IsSatisfy( long theId )
   if ( mySubShapesIDs.Contains( elem->getshapeId() ))
     return true;
 
-  if ( elem->GetType() != SMDSAbs_Node && elem->GetType() == myType )
+  if (( elem->GetType() != SMDSAbs_Node ) &&
+      ( myType == SMDSAbs_All || elem->GetType() == myType ))
   {
     SMDS_ElemIteratorPtr nodeItr = elem->nodesIterator();
     while ( nodeItr->more() )