mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024023: Revamp the OCCT Handle -- downcast (automatic)
Automatic update by command "occt_upgrade . -downcast" C-style cast of Handle to that of derived type (now illegal) is replaced by call to DownCast() Const reference local variables of Handle type initialized by result of DownCast are replaced by normal variables.
This commit is contained in:
@@ -42,7 +42,7 @@ Standard_Integer BRepGProp_EdgeTool::IntegrationOrder(const BRepAdaptor_Curve&
|
||||
{
|
||||
const GeomAdaptor_Curve& GAC = BAC.Curve();
|
||||
const Handle(Geom_Curve)& GC = GAC.Curve();
|
||||
const Handle(Geom_BezierCurve)& GBZC = (*((Handle(Geom_BezierCurve)*)&GC));
|
||||
Handle(Geom_BezierCurve) GBZC (Handle(Geom_BezierCurve)::DownCast (GC));
|
||||
Standard_Integer n = 2*(GBZC->NbPoles()) - 1;
|
||||
return n;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ Standard_Integer BRepGProp_EdgeTool::IntegrationOrder(const BRepAdaptor_Curve&
|
||||
{
|
||||
const GeomAdaptor_Curve& GAC = BAC.Curve();
|
||||
const Handle(Geom_Curve)& GC = GAC.Curve();
|
||||
const Handle(Geom_BSplineCurve)& GBSC = (*((Handle(Geom_BSplineCurve)*)&GC));
|
||||
Handle(Geom_BSplineCurve) GBSC (Handle(Geom_BSplineCurve)::DownCast (GC));
|
||||
Standard_Integer n = 2*(GBSC->NbPoles()) - 1;
|
||||
return n;
|
||||
}
|
||||
|
@@ -617,7 +617,7 @@ void BRepGProp_Face::GetUKnots
|
||||
GeomAdaptor_Curve aCurve;
|
||||
Handle(Geom_Surface) aSurf = mySurface.Surface().Surface();
|
||||
|
||||
aCurve.Load((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&aSurf))->BasisCurve());
|
||||
aCurve.Load(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (aSurf)->BasisCurve());
|
||||
isCBSpline = aCurve.GetType() == GeomAbs_BSplineCurve;
|
||||
}
|
||||
}
|
||||
@@ -643,7 +643,7 @@ void BRepGProp_Face::GetUKnots
|
||||
Handle(Geom_Surface) aSurf = mySurface.Surface().Surface();
|
||||
Handle(Geom_BSplineCurve) aBSplCurve;
|
||||
|
||||
aCurve.Load((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&aSurf))->BasisCurve());
|
||||
aCurve.Load(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (aSurf)->BasisCurve());
|
||||
aBSplCurve = aCurve.BSpline();
|
||||
aNbKnots = aBSplCurve->NbKnots();
|
||||
aKnots = new TColStd_HArray1OfReal(1, aNbKnots);
|
||||
|
Reference in New Issue
Block a user