0020982: EDF 1547 SMESH: Creation of non-conformal quadratic pyramids

Move all checks of shape validity from AddCompoundSubmesh() to IsGroupOfSubShapes()
This commit is contained in:
eap 2010-09-17 05:34:11 +00:00
parent 52e29b1d26
commit c72cfb82fd

View File

@ -1073,14 +1073,12 @@ TopoDS_Shape SMESHDS_Mesh::ShapeToMesh() const
bool SMESHDS_Mesh::IsGroupOfSubShapes (const TopoDS_Shape& theShape) const bool SMESHDS_Mesh::IsGroupOfSubShapes (const TopoDS_Shape& theShape) const
{ {
if ( myShape.IsSame( theShape )) if ( myIndexToShape.Contains(theShape) )
return true; return true;
for ( TopoDS_Iterator it( theShape ); it.More(); it.Next() ) { for ( TopoDS_Iterator it( theShape ); it.More(); it.Next() )
if (myIndexToShape.Contains( it.Value() ) || if (IsGroupOfSubShapes( it.Value() ))
IsGroupOfSubShapes( it.Value() ))
return true; return true;
}
return false; return false;
} }
@ -1205,7 +1203,7 @@ int SMESHDS_Mesh::AddCompoundSubmesh(const TopoDS_Shape& S,
TopAbs_ShapeEnum type) TopAbs_ShapeEnum type)
{ {
int aMainIndex = 0; int aMainIndex = 0;
if ( IsGroupOfSubShapes( S ) || (S.ShapeType() == TopAbs_VERTEX && myIndexToShape.Contains(S)) ) if ( IsGroupOfSubShapes( S ))
{ {
aMainIndex = myIndexToShape.Add( S ); aMainIndex = myIndexToShape.Add( S );
bool all = ( type == TopAbs_SHAPE ); bool all = ( type == TopAbs_SHAPE );