mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0029769: Uninitialized data with BSplCLib_Cache, BSplSLib_Cache
Implementation of classes BSplCLib_Cache and BSplSLib_Cache is revised: - Common functionality dealing with spans along one parametric direction is separated to new struct BSplCLib_CacheParams - Empty constructors are removed; copying is prohibited - Code reconsidering degree and other parameters on each call to BuildCache() is eliminated; curve parameters must be the same in constructor and all calls to BuildCache() - Extra call to BuildCache() from constructor is eliminated
This commit is contained in:
@@ -539,8 +539,7 @@ void GeomAdaptor_Curve::RebuildCache(const Standard_Real theParameter) const
|
||||
if (myCurveCache.IsNull())
|
||||
myCurveCache = new BSplCLib_Cache(aDeg, aBezier->IsPeriodic(), aFlatKnots,
|
||||
aBezier->Poles(), aBezier->Weights());
|
||||
myCurveCache->BuildCache(theParameter, aDeg, aBezier->IsPeriodic(), aFlatKnots,
|
||||
aBezier->Poles(), aBezier->Weights());
|
||||
myCurveCache->BuildCache (theParameter, aFlatKnots, aBezier->Poles(), aBezier->Weights());
|
||||
}
|
||||
else if (myTypeCurve == GeomAbs_BSplineCurve)
|
||||
{
|
||||
@@ -548,9 +547,8 @@ void GeomAdaptor_Curve::RebuildCache(const Standard_Real theParameter) const
|
||||
if (myCurveCache.IsNull())
|
||||
myCurveCache = new BSplCLib_Cache(myBSplineCurve->Degree(), myBSplineCurve->IsPeriodic(),
|
||||
myBSplineCurve->KnotSequence(), myBSplineCurve->Poles(), myBSplineCurve->Weights());
|
||||
myCurveCache->BuildCache(theParameter, myBSplineCurve->Degree(),
|
||||
myBSplineCurve->IsPeriodic(), myBSplineCurve->KnotSequence(),
|
||||
myBSplineCurve->Poles(), myBSplineCurve->Weights());
|
||||
myCurveCache->BuildCache (theParameter, myBSplineCurve->KnotSequence(),
|
||||
myBSplineCurve->Poles(), myBSplineCurve->Weights());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -670,12 +670,9 @@ void GeomAdaptor_Surface::RebuildCache(const Standard_Real theU,
|
||||
if (mySurfaceCache.IsNull())
|
||||
mySurfaceCache = new BSplSLib_Cache(
|
||||
aDegU, aBezier->IsUPeriodic(), aFlatKnotsU,
|
||||
aDegV, aBezier->IsVPeriodic(), aFlatKnotsV,
|
||||
aBezier->Poles(), aBezier->Weights());
|
||||
mySurfaceCache->BuildCache(theU, theV,
|
||||
aDegU, aBezier->IsUPeriodic(), aFlatKnotsU,
|
||||
aDegV, aBezier->IsVPeriodic(), aFlatKnotsV,
|
||||
aBezier->Poles(), aBezier->Weights());
|
||||
aDegV, aBezier->IsVPeriodic(), aFlatKnotsV, aBezier->Weights());
|
||||
mySurfaceCache->BuildCache (theU, theV, aFlatKnotsU, aFlatKnotsV,
|
||||
aBezier->Poles(), aBezier->Weights());
|
||||
}
|
||||
else if (mySurfaceType == GeomAbs_BSplineSurface)
|
||||
{
|
||||
@@ -684,11 +681,9 @@ void GeomAdaptor_Surface::RebuildCache(const Standard_Real theU,
|
||||
mySurfaceCache = new BSplSLib_Cache(
|
||||
myBSplineSurface->UDegree(), myBSplineSurface->IsUPeriodic(), myBSplineSurface->UKnotSequence(),
|
||||
myBSplineSurface->VDegree(), myBSplineSurface->IsVPeriodic(), myBSplineSurface->VKnotSequence(),
|
||||
myBSplineSurface->Poles(), myBSplineSurface->Weights());
|
||||
mySurfaceCache->BuildCache(theU, theV,
|
||||
myBSplineSurface->UDegree(), myBSplineSurface->IsUPeriodic(), myBSplineSurface->UKnotSequence(),
|
||||
myBSplineSurface->VDegree(), myBSplineSurface->IsVPeriodic(), myBSplineSurface->VKnotSequence(),
|
||||
myBSplineSurface->Poles(), myBSplineSurface->Weights());
|
||||
myBSplineSurface->Weights());
|
||||
mySurfaceCache->BuildCache (theU, theV, myBSplineSurface->UKnotSequence(), myBSplineSurface->VKnotSequence(),
|
||||
myBSplineSurface->Poles(), myBSplineSurface->Weights());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user