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:
@@ -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()),
|
||||
|
@@ -1401,6 +1401,8 @@ void Geom_BSplineSurface::ValidateCache(const Standard_Real Uparameter,
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!cacheweights.IsNull())
|
||||
cacheweights.Nullify();
|
||||
|
||||
BSplCLib::LocateParameter(udeg,
|
||||
(ufknots->Array1()),
|
||||
|
Reference in New Issue
Block a user