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:
@@ -175,7 +175,7 @@ void GeomFill_BoundWithSurf::Reparametrize(const Standard_Real First,
|
||||
HasDF,HasDL,DF,DL,
|
||||
Rev,30);
|
||||
myPar = new Law_BSpFunc();
|
||||
(*((Handle(Law_BSpFunc)*) &myPar))->SetCurve(curve);
|
||||
Handle(Law_BSpFunc)::DownCast (myPar)->SetCurve(curve);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -395,8 +395,8 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1,
|
||||
if(!CheckTgte(i)) {
|
||||
Handle(Law_Function) fu1,fu2;
|
||||
ptch->Func(fu1,fu2);
|
||||
fu1 = Law::MixBnd(*((Handle(Law_Linear)*) &fu1));
|
||||
fu2 = Law::MixBnd(*((Handle(Law_Linear)*) &fu2));
|
||||
fu1 = Law::MixBnd(Handle(Law_Linear)::DownCast (fu1));
|
||||
fu2 = Law::MixBnd(Handle(Law_Linear)::DownCast (fu2));
|
||||
ptch->Func(fu1,fu2);
|
||||
break;
|
||||
}
|
||||
@@ -476,8 +476,8 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1,
|
||||
if(!CheckTgte(i)) {
|
||||
Handle(Law_Function) fu1,fu2;
|
||||
ptch->Func(fu1,fu2);
|
||||
Handle(Law_Function) ffu1 = Law::MixBnd(*((Handle(Law_Linear)*) &fu1));
|
||||
Handle(Law_Function) ffu2 = Law::MixBnd(*((Handle(Law_Linear)*) &fu2));
|
||||
Handle(Law_Function) ffu1 = Law::MixBnd(Handle(Law_Linear)::DownCast (fu1));
|
||||
Handle(Law_Function) ffu2 = Law::MixBnd(Handle(Law_Linear)::DownCast (fu2));
|
||||
ptch->SetFunc(ffu1,ffu2);
|
||||
break;
|
||||
}
|
||||
|
@@ -142,7 +142,7 @@ void GeomFill_Profiler::AddCurve(const Handle(Geom_Curve)& Curve)
|
||||
//// modified by jgv, 19.01.05 for OCC7354 ////
|
||||
Handle(Geom_Curve) theCurve = Curve;
|
||||
if (theCurve->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
|
||||
theCurve = (*((Handle(Geom_TrimmedCurve)*)&theCurve))->BasisCurve();
|
||||
theCurve = Handle(Geom_TrimmedCurve)::DownCast (theCurve)->BasisCurve();
|
||||
if (theCurve->IsKind(STANDARD_TYPE(Geom_Conic)))
|
||||
{
|
||||
GeomConvert_ApproxCurve appr(Curve, Precision::Confusion(), GeomAbs_C1, 16, 14);
|
||||
|
@@ -77,7 +77,7 @@ void GeomFill_SimpleBound::Reparametrize(const Standard_Real First,
|
||||
HasDF,HasDL,DF,DL,
|
||||
Rev,30);
|
||||
myPar = new Law_BSpFunc();
|
||||
(*((Handle(Law_BSpFunc)*) &myPar))->SetCurve(curve);
|
||||
Handle(Law_BSpFunc)::DownCast (myPar)->SetCurve(curve);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -325,8 +325,7 @@ GeomFill_Sweep::GeomFill_Sweep(const Handle(GeomFill_LocationLaw)& Location,
|
||||
myCurve2d = new (TColGeom2d_HArray1OfCurve) (1, 2);
|
||||
CError = new (TColStd_HArray2OfReal) (1,2, 1,2);
|
||||
|
||||
const Handle(Geom_BSplineSurface)& BSplSurf =
|
||||
Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
Handle(Geom_BSplineSurface) BSplSurf (Handle(Geom_BSplineSurface)::DownCast(mySurface));
|
||||
|
||||
gp_Dir2d D(0., 1.);
|
||||
gp_Pnt2d P(BSplSurf->UKnot(1), 0);
|
||||
|
Reference in New Issue
Block a user