return Standard_False;
Handle(Geom2d_Curve) gpcprol = BRep_Tool::CurveOnSurface(Eprol,Fprol,uf,ul);
+ if (gpcprol.IsNull()) throw Standard_Failure("Failed to create curve.");
Handle(Geom2dAdaptor_HCurve) pcprol = new Geom2dAdaptor_HCurve(gpcprol);
Standard_Real partemp = BRep_Tool::Parameter(Vtx,Eprol);
if (onsame && IFopArc == 1) pfac1 = p2dbout;
else {
Hc1 = BRep_Tool::CurveOnSurface(CV1.Arc(),Fv,Ubid,Ubid);
+ if (Hc1.IsNull()) throw Standard_Failure("Failed to create curve.");
pfac1 = Hc1->Value(CV1.ParameterOnArc());
}
if (onsame && IFopArc == 2) pfac2 = p2dbout;
else {
Hc2 = BRep_Tool::CurveOnSurface(CV2.Arc(),Fv,Ubid,Ubid);
+ if (Hc2.IsNull()) throw Standard_Failure("Failed to create curve.");
pfac2 = Hc2->Value(CV2.ParameterOnArc());
}
if (Fi1.LineIndex() != 0) {
//Standard_Real Ubid,Vbid;
Handle (Geom_Curve) C=BRep_Tool::Curve(edgecouture,Ubid,Vbid);
+ if (C.IsNull()) throw Standard_Failure("Failed to create curve.");
Handle(Geom_TrimmedCurve) Ctrim=new Geom_TrimmedCurve (C,Ubid,Vbid);
GeomAdaptor_Curve cur1(Ctrim->BasisCurve());
GeomAdaptor_Curve cur2(Cc);
Standard_Real first, last, prm1, prm2;
Standard_Boolean onfirst, FirstToPar;
Handle(Geom2d_Curve) Hc = BRep_Tool::CurveOnSurface( CV[i].Arc(), Fv, first, last );
+ if (Hc.IsNull()) throw Standard_Failure("Failed to create curve.");
pfac1 = Hc->Value( CV[i].ParameterOnArc() );
PcF = Pc->Value( Udeb );
PcL = Pc->Value( Ufin );
TopoDS_Edge aLocalEdge = CV[i].Arc();
aLocalEdge.Reverse();
Handle(Geom2d_Curve) HcR = BRep_Tool::CurveOnSurface( aLocalEdge, Fv, first, last );
+ if (HcR.IsNull()) throw Standard_Failure("Failed to create curve.");
Interfc = ChFi3d_FilCurveInDS( indcurv, indface, HcR, aLocalEdge.Orientation() );
DStr.ChangeShapeInterferences(indface).Append( Interfc );
//modify degenerated edge
{
Standard_Real fd, ld;
Handle(Geom2d_Curve) Cd = BRep_Tool::CurveOnSurface( Edeg, Fv, fd, ld );
+ if (Cd.IsNull()) throw Standard_Failure("Failed to create curve.");
Handle(Geom2d_TrimmedCurve) tCd = Handle(Geom2d_TrimmedCurve)::DownCast(Cd);
if (! tCd.IsNull())
Cd = tCd->BasisCurve();
const ChFiDS_FaceInterference& Fiop = Fd->Interference(IFopArc);
gp_Pnt2d pop1, pop2, pv1, pv2;
Hc = BRep_Tool::CurveOnSurface(Arcprol,Fop,Ubid,Ubid);
+ if (Hc.IsNull()) throw Standard_Failure("Failed to create curve.");
pop1 = Hc->Value(parVtx);
pop2 = Fiop.PCurveOnFace()->Value(Fiop.Parameter(isfirst));
Hc = BRep_Tool::CurveOnSurface(Arcprol,Fv,Ubid,Ubid);
+ if (Hc.IsNull()) throw Standard_Failure("Failed to create curve.");
pv1 = Hc->Value(parVtx);
pv2 = p2dbout;
ChFi3d_Recale(Bs,pv1,pv2,1);
}
}
}
+ if (trouve == Standard_False) {
+ throw Standard_Failure("Failed to find face.");
+ }
}
//=======================================================================
{Edge=Ecur1;trouve=Standard_True;}
}
}
+ if (trouve == Standard_False) {
+ throw Standard_Failure("Failed to find edge.");
+ }
}
//=======================================================================
if (nb==1) {
Hc1 = BRep_Tool::CurveOnSurface(Edge[0],Face[0],Ubid,Ubid);
+ if (Hc1.IsNull()) throw Standard_Failure("Failed to create curve.");
if (isOnSame1) {
// update interference param on Fi1 and point of CV1
if (prolface[0]) Bs.Initialize(faceprol[0], Standard_False);
Handle(Geom_Curve) C;
C=BRep_Tool::Curve(E2,Ubid,Vbid);
+ if (C.IsNull()) throw Standard_Failure("Failed to create curve.");
Handle(Geom_TrimmedCurve) Ctrim = new Geom_TrimmedCurve(C,Ubid,Vbid);
Standard_Real Utrim,Vtrim;
Utrim=Ctrim->BasisCurve()->FirstParameter();
paredge2=inters.Point(nbp).W();
if (!extend) {
cfacemoins1=BRep_Tool::CurveOnSurface(E2,F,u2,v2);
+ if (cfacemoins1.IsNull()) throw Standard_Failure("Failed to create curve.");
cface=BRep_Tool::CurveOnSurface(E2,Face[nb],u2,v2);
+ if (cface.IsNull()) throw Standard_Failure("Failed to create curve.");
cfacemoins1->D0(paredge2,pfac2);
cface->D0(paredge2,pint);
}
if( IFopArc == 1) pfac1 = p2dbout;
else {
Hc1 = BRep_Tool::CurveOnSurface(CV1.Arc(),Fv,Ubid,Ubid);
+ if (Hc1.IsNull()) throw Standard_Failure("Failed to create curve.");
pfac1 = Hc1->Value(CV1.ParameterOnArc());
}
if(IFopArc == 2) pfac2 = p2dbout;
else {
Hc2 = BRep_Tool::CurveOnSurface(CV2.Arc(),Fv,Ubid,Ubid);
+ if (Hc2.IsNull()) throw Standard_Failure("Failed to create curve.");
pfac2 = Hc2->Value(CV2.ParameterOnArc());
}
if(Fi1.LineIndex() != 0){
//Standard_Real Ubid,Vbid;
Handle (Geom_Curve) C=BRep_Tool::Curve(edgecouture,Ubid,Vbid);
+ if (C.IsNull()) throw Standard_Failure("Failed to create curve.");
Handle(Geom_TrimmedCurve) Ctrim=new Geom_TrimmedCurve (C,Ubid,Vbid);
GeomAdaptor_Curve cur1(Ctrim->BasisCurve());
GeomAdaptor_Curve cur2(Cc);
// Modified by skv - Thu Aug 21 11:55:58 2008 OCC20222 End
//fin modif
Hc = BRep_Tool::CurveOnSurface(Arcprolbis,Fop,Ubid,Ubid);
+ if (Hc.IsNull()) throw Standard_Failure("Failed to create curve.");
pop1 = Hc->Value(parVtx);
pop2 = Fiop.PCurveOnFace()->Value(Fiop.Parameter(isfirst));
Hc = BRep_Tool::CurveOnSurface(Arcprol,Fv,Ubid,Ubid);
+ if (Hc.IsNull()) throw Standard_Failure("Failed to create curve.");
//modif
parVtx = BRep_Tool::Parameter(Vtx,Arcprol);
//fin modif
{Edge=Ecur1;trouve=Standard_True;}
}
}
+ if (trouve == Standard_False) {
+ throw Standard_Failure("Failed to find edge.");
+ }
}
//=======================================================================
Handle (Geom_Curve) c1,c2;
if (sharpicmoins) {
c1=BRep_Tool::Curve(Eviveicmoins,up1,up2);
+ if (c1.IsNull()) throw Standard_Failure("Failed to create curve.");
}
else {
if (jficmoins==1)
}
if (sharpicplus){
c2=BRep_Tool::Curve(Eviveicplus,up1,up2);
+ if (c2.IsNull()) throw Standard_Failure("Failed to create curve.");
}
else {
jfp=3-jficplus;
}
Eproj.Append(E1);
proj1=BRep_Tool::CurveOnSurface(E1,F,up1,up2);
+ if (proj1.IsNull()) throw Standard_Failure("Failed to create curve.");
proj2d.Append(new Geom2d_TrimmedCurve(proj1,up1,up2));
proj1c=BRep_Tool::Curve(E1,up1,up2);
+ if (proj1c.IsNull()) throw Standard_Failure("Failed to create curve.");
cproj.Append(new Geom_TrimmedCurve(proj1c,up1,up2));
if (error>BRep_Tool::Tolerance(E1)) error=BRep_Tool::Tolerance(E1);
}
Pf=BRep_Tool::Pnt(Vf);
Pl=BRep_Tool::Pnt(Vl);
para=parcom.Value(nb);
- Pcom=BRep_Tool::Curve(TopoDS::Edge(Ecom.Value(nb)),up1,up2)->Value(para);
+ Handle(Geom_Curve) result = BRep_Tool::Curve(TopoDS::Edge(Ecom.Value(nb)),up1,up2);
+ if (result.IsNull()) throw Standard_Failure("Failed to create curve.");
+ Pcom=result->Value(para);
+
if (Pf.Distance(BRep_Tool::Pnt(V1))< Pl.Distance(BRep_Tool::Pnt(V1)))
orvt=TopAbs_FORWARD;
if (!Eproj.Value(nb).IsNull()) {
n3d++;
proj=BRep_Tool::CurveOnSurface(TopoDS::Edge(Eproj.Value(nb)),
TopoDS::Face(Fproj.Value(nb)),up1,up2);
+ if (proj.IsNull()) throw Standard_Failure("Failed to create curve.");
proj2d=new Geom2d_TrimmedCurve(proj,up1,up2);
projc=BRep_Tool::Curve(TopoDS::Edge(Eproj.Value(nb)),up1,up2);
+ if (projc.IsNull()) throw Standard_Failure("Failed to create curve.");
cproj=new Geom_TrimmedCurve(projc,up1,up2);
pardeb=cproj->FirstParameter();
parfin=cproj->LastParameter();