#include <gp_Circ2d.hxx>
#include <Precision.hxx>
+
static void QuasiFleche(const TheCurve&,
const Standard_Real,
const Standard_Real,
const Standard_Integer,
const Standard_Real,
TColStd_SequenceOfReal&,
- TColgp_SequenceOfPnt&);
+ TColgp_SequenceOfPnt&,
+ Standard_Integer&);
static void QuasiFleche(const TheCurve&,
const Standard_Real,
const gp_Pnt&,
const Standard_Integer,
TColStd_SequenceOfReal&,
- TColgp_SequenceOfPnt&);
+ TColgp_SequenceOfPnt&,
+ Standard_Integer&);
//=======================================================================
const GeomAbs_Shape Continuity)
{
Standard_Integer Nbmin = 2;
+ Standard_Integer aNbCallQF = 0;
gp_Pnt Pdeb;
if (Continuity <= GeomAbs_G1)
U1, Pdeb,
U2, Pfin,
Nbmin,
- Parameters, Points);
+ Parameters, Points, aNbCallQF);
}
else
{
Dfin,
Nbmin,
EPSILON * EPSILON,
- Parameters, Points);
+ Parameters, Points, aNbCallQF);
}
// cout << "Nb de pts: " << Points.Length()<< endl;
return Standard_True;
const Standard_Integer Nbmin,
const Standard_Real Eps,
TColStd_SequenceOfReal& Parameters,
- TColgp_SequenceOfPnt& Points)
+ TColgp_SequenceOfPnt& Points,
+ Standard_Integer& theNbCalls)
{
+ theNbCalls++;
+ if (theNbCalls >= MyMaxQuasiFleshe)
+ {
+ return;
+ }
Standard_Integer Ptslength = Points.Length();
+ if (theNbCalls > 100 && Ptslength < 2)
+ {
+ return;
+ }
Standard_Real Udelta = Ufin - Udeb;
gp_Pnt Pdelta;
gp_Vec Vdelta;
Vdelta,
3,
Eps,
- Parameters, Points);
+ Parameters, Points, theNbCalls);
}
if (Nbmin > 2)
Vfin,
Nbmin - (Points.Length() - Ptslength),
Eps,
- Parameters, Points);
+ Parameters, Points, theNbCalls);
}
+ theNbCalls--;
}
const gp_Pnt& Pfin,
const Standard_Integer Nbmin,
TColStd_SequenceOfReal& Parameters,
- TColgp_SequenceOfPnt& Points)
+ TColgp_SequenceOfPnt& Points,
+ Standard_Integer& theNbCalls)
{
+ theNbCalls++;
+ if (theNbCalls >= MyMaxQuasiFleshe)
+ {
+ return;
+ }
Standard_Integer Ptslength = Points.Length();
+ if (theNbCalls > 100 && Ptslength < 2)
+ {
+ return;
+ }
Standard_Real Udelta = Ufin - Udeb;
gp_Pnt Pdelta;
if (Nbmin > 2)
QuasiFleche (C, Deflection2, Udeb, Pdeb,
Udeb + Udelta * 0.5, Pverif,
2,
- Parameters, Points);
+ Parameters, Points, theNbCalls);
QuasiFleche (C, Deflection2, Udeb + Udelta * 0.5, Pverif,
Udeb + Udelta, Pdelta,
2,
- Parameters, Points);
+ Parameters, Points, theNbCalls);
}
if (Nbmin > 2)
QuasiFleche (C, Deflection2, Udeb + Udelta, Pdelta,
Ufin, Pfin,
Nbmin - (Points.Length() - Ptslength),
- Parameters, Points);
+ Parameters, Points, theNbCalls);
}
+ theNbCalls--;
}