1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Version Open CASCADE 670 with fixes

This commit is contained in:
gka
2014-10-10 15:19:04 +04:00
parent 47d9074abb
commit d099845895
65 changed files with 6265 additions and 5290 deletions

View File

@@ -855,3 +855,41 @@ Handle(Geom_BSplineCurve) GeomAdaptor_Curve::BSpline() const
return *((Handle(Geom_BSplineCurve)*)&myCurve);
}
static Standard_Integer nbPoints(const Handle(Geom_Curve)& theCurve)
{
Standard_Integer nbs = 10;
if(theCurve->IsKind(STANDARD_TYPE( Geom_Line)) )
nbs = 2;
else if(theCurve->IsKind(STANDARD_TYPE( Geom_BezierCurve)))
{
nbs = 3 + (*((Handle(Geom_BezierCurve)*)&theCurve))->NbPoles();
}
else if(theCurve->IsKind(STANDARD_TYPE( Geom_BSplineCurve))) {
nbs = (*((Handle(Geom_BSplineCurve)*)&theCurve))->NbKnots();
nbs*= (*((Handle(Geom_BSplineCurve)*)&theCurve))->Degree();
if(nbs < 2.0) nbs=2;
}
else if (theCurve->IsKind(STANDARD_TYPE(Geom_OffsetCurve)))
{
Handle(Geom_Curve) aCurve = (*((Handle(Geom_OffsetCurve)*)&theCurve))->BasisCurve();
return Max(nbs, nbPoints(aCurve));
}
else if (theCurve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
{
Handle(Geom_Curve) aCurve = (*((Handle(Geom_TrimmedCurve)*)&theCurve))->BasisCurve();
return Max(nbs, nbPoints(aCurve));
}
if(nbs>300)
nbs = 300;
return nbs;
}
/*Standard_Integer GeomAdaptor_Curve::NbSamples() const
{
return nbPoints(myCurve);
}
*/