mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024955: Misuse of DownCast
Code where DownCast was applied to Handle of the type being not a base class of the target one is revised and (hopefully) corrected. Code corrected following review remarks GeomConvert::CurveToBSplineCurve() is called even for b-spline curves to ensure that result is non-periodic Check for conic is corrected
This commit is contained in:
@@ -520,24 +520,19 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC,
|
||||
|
||||
GeomFill_SectionGenerator section;
|
||||
Handle(Geom_BSplineSurface) surface;
|
||||
Handle(Geom_TrimmedCurve) curvTrim;
|
||||
Handle(Geom_BSplineCurve) curvBS, curvBS1;
|
||||
Handle(Geom_Curve) curv = mySections(1);
|
||||
|
||||
for (j=jdeb; j<=jfin; j++) {
|
||||
|
||||
// read the j-th curve
|
||||
curv = mySections(j);
|
||||
curvTrim = new Geom_TrimmedCurve(curv,
|
||||
curv->FirstParameter(),
|
||||
curv->LastParameter());
|
||||
Handle(Geom_Curve) curv = mySections(j);
|
||||
|
||||
// transformation en BSpline reparametree sur [UFirst,ULast]
|
||||
curvBS = Handle(Geom_BSplineCurve)::DownCast(curvTrim);
|
||||
if (curvBS.IsNull()) {
|
||||
Convert_ParameterisationType ParamType = Convert_QuasiAngular;
|
||||
curvBS = GeomConvert::CurveToBSplineCurve(curvTrim,ParamType);
|
||||
// transformation to BSpline reparametrized to [UFirst,ULast]
|
||||
Handle(Geom_BSplineCurve) curvBS = Handle(Geom_BSplineCurve)::DownCast (curv);
|
||||
if (curvBS.IsNull())
|
||||
{
|
||||
curvBS = GeomConvert::CurveToBSplineCurve (curv, Convert_QuasiAngular);
|
||||
}
|
||||
|
||||
TColStd_Array1OfReal BSK(1,curvBS->NbKnots());
|
||||
curvBS->Knots(BSK);
|
||||
BSplCLib::Reparametrize(UFirst,ULast,BSK);
|
||||
|
Reference in New Issue
Block a user