1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +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

@@ -1326,12 +1326,15 @@ void Geom2d_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_HArray1OfPnt2d(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()),