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

0025706: SIGSEGV after making existing BSplineCurve rational

1. Eliminated exception after conversion non-rational B-spline to rational
2. Implemented DRAW command setweight to change weights of B-spline
3. Test cases were added
This commit is contained in:
azv
2015-01-14 10:00:06 +03:00
committed by bugmaster
parent 0fe1715f01
commit 52ba6031e8
7 changed files with 179 additions and 8 deletions

View File

@@ -1212,12 +1212,16 @@ void Geom_BSplineCurve::ValidateCache(const Standard_Real Parameter)
//
// check if the degree did not change
//
if (cachepoles->Upper() < deg + 1) {
if (cachepoles->Upper() < deg + 1)
cachepoles = new TColgp_HArray1OfPnt(1,deg + 1);
if (rational) {
cacheweights = new TColStd_HArray1OfReal(1,deg + 1);
}
if (rational)
{
if (cacheweights.IsNull() || cacheweights->Upper() < deg + 1)
cacheweights = new TColStd_HArray1OfReal(1,deg + 1);
}
else if (!cacheweights.IsNull())
cacheweights.Nullify();
BSplCLib::LocateParameter(deg,
(flatknots->Array1()),
(BSplCLib::NoMults()),

View File

@@ -1401,6 +1401,8 @@ void Geom_BSplineSurface::ValidateCache(const Standard_Real Uparameter,
}
}
}
else if (!cacheweights.IsNull())
cacheweights.Nullify();
BSplCLib::LocateParameter(udeg,
(ufknots->Array1()),