+ // PAL16202
+ else
+ {
+ bool isSub = TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), aShape );
+ if ( !_sourceHypo->IsCompoundSource() ) {
+ if ( !isSub ) {
+ aStatus = HYP_BAD_PARAMETER;
+ SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), aShape)));
+ }
+ }
+ else if ( isSub ) {
+ // is Ok provided that source vertex is shared only by one edge
+ // of the source group
+ TopoDS_Shape sharingEdge;
+ TopTools_ListIteratorOfListOfShape ancestIt
+ ( aMesh.GetAncestors( _sourceHypo->GetSourceVertex() ));
+ for ( ; ancestIt.More(); ancestIt.Next() )
+ {
+ const TopoDS_Shape& ancestor = ancestIt.Value();
+ if ( ancestor.ShapeType() == TopAbs_EDGE &&
+ TAssocTool::IsSubShape( ancestor, _sourceHypo->GetSourceEdge() ))
+ {
+ if ( sharingEdge.IsNull() || ancestor.IsSame( sharingEdge ))
+ sharingEdge = ancestor;
+ else {
+ // the second encountered
+ aStatus = HYP_BAD_PARAMETER;
+ MESSAGE("Source vertex is shared by several edges of a group");
+ break;
+ }
+ }
+ }
+ }
+ }