Updated for bug 0020052 from Mantis.

This commit is contained in:
skl 2008-11-21 11:21:28 +00:00
parent 014f092f46
commit 951bb21f99

View File

@ -203,6 +203,24 @@ static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges,
}
if(aChain.Length()>1) {
// second step: union edges with various curves
// skl for bug 0020052 from Mantis: perform such unions
// only if curves are bspline or bezier
bool NeedUnion = true;
for(j=1; j<=aChain.Length(); j++) {
TopoDS_Edge edge = TopoDS::Edge(aChain.Value(j));
Handle(Geom_Curve) c3d = BRep_Tool::Curve(edge,Loc,fp1,lp1);
if(c3d.IsNull()) continue;
while(c3d->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
Handle(Geom_TrimmedCurve) tc =
Handle(Geom_TrimmedCurve)::DownCast(c3d);
c3d = tc->BasisCurve();
}
if( ( c3d->IsKind(STANDARD_TYPE(Geom_BSplineCurve)) ||
c3d->IsKind(STANDARD_TYPE(Geom_BezierCurve)) ) ) continue;
NeedUnion = false;
break;
}
if(NeedUnion) {
MESSAGE ("can not make analitical union => make approximation");
TopoDS_Wire W;
B.MakeWire(W);
@ -219,6 +237,11 @@ static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges,
B.Add (E,VL);
aChain.SetValue(1,E);
}
else {
MESSAGE ("can not make approximation for such types of curves");
return Standard_False;
}
}
anEdge = TopoDS::Edge(aChain.Value(1));
return Standard_True;