Fix for PAL7758(Incorrect work of "Lying on Geom" filter for faces).

LyingOnGeom::Contains(...) improved.
This commit is contained in:
mzn 2005-01-20 11:50:07 +00:00
parent 090aff0726
commit 3fa31cc01e

View File

@ -268,43 +268,31 @@ bool Controls::LyingOnGeom::Contains( SMESHDS_Mesh* theMeshDS,
if (IsContains(theMeshDS, theShape, theElem, theFindShapeEnum, theAvoidShapeEnum)) if (IsContains(theMeshDS, theShape, theElem, theFindShapeEnum, theAvoidShapeEnum))
return true; return true;
if ( SMESHDS_SubMesh* aSubMesh = theMeshDS->MeshElements( theShape ) ) TopTools_IndexedMapOfShape aSubShapes;
TopExp::MapShapes( theShape, aSubShapes );
for (int i = 1; i <= aSubShapes.Extent(); i++)
{ {
SMDS_NodeIteratorPtr aNodeIt = aSubMesh->GetNodes(); const TopoDS_Shape& aShape = aSubShapes.FindKey(i);
while ( aNodeIt->more() )
{
const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(aNodeIt->next());
SMDS_ElemIteratorPtr anElemIt = aNode->GetInverseElementIterator();
while ( anElemIt->more() )
{
const SMDS_MeshElement* anElement = static_cast<const SMDS_MeshElement*>(anElemIt->next());
if (anElement == theElem)
return true;
}
}
}
TopExp_Explorer anExp( theShape,TopAbs_VERTEX,theAvoidShapeEnum ); if( SMESHDS_SubMesh* aSubMesh = theMeshDS->MeshElements( aShape ) ){
if( aSubMesh->Contains( theElem ) )
return true;
while( anExp.More() ) SMDS_NodeIteratorPtr aNodeIt = aSubMesh->GetNodes();
{ while ( aNodeIt->more() )
const TopoDS_Shape& aShape = anExp.Current(); {
if( SMESHDS_SubMesh* aSubMesh = theMeshDS->MeshElements( aShape ) ){ const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(aNodeIt->next());
SMDS_NodeIteratorPtr aNodeIt = aSubMesh->GetNodes(); SMDS_ElemIteratorPtr anElemIt = aNode->GetInverseElementIterator();
while ( aNodeIt->more() ) while ( anElemIt->more() )
{ {
const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(aNodeIt->next()); const SMDS_MeshElement* anElement = static_cast<const SMDS_MeshElement*>(anElemIt->next());
SMDS_ElemIteratorPtr anElemIt = aNode->GetInverseElementIterator(); if (anElement == theElem)
while ( anElemIt->more() ) return true;
{ }
const SMDS_MeshElement* anElement = static_cast<const SMDS_MeshElement*>(anElemIt->next()); }
if (anElement == theElem) }
return true;
}
}
} }
anExp.Next();
}
return false; return false;
} }