1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024023: Revamp the OCCT Handle -- ambiguity

Code corrected to avoid ambiguous situations due to changed implementation of Handle (overloaded methods accepting handles of different types).
In Adaptor3d_CurveOnSurface added method Load() with two parameters, allowing to avoid ambiguity of cast of handles when calling separate methods Load() for curve and surface, replacing by single call.
In DrawTrSurf and IGESData_IGESWriter, template variants of methods Set() and Send(), respectively, are added to avoid ambiguity when these methods are called with handles to derived types (using SFINAE).
In NCollection_DefineHSequence, method Append() accepting handle to another HSequence is made template, to be available only if argument has compatible type.
This commit is contained in:
abv
2015-07-02 17:06:37 +03:00
parent a1eb3afd0d
commit 543a996496
69 changed files with 270 additions and 198 deletions

View File

@@ -312,8 +312,8 @@ void BRepFill_Filling::AddConstraints( const BRepFill_SequenceOfEdgeFaceAndOrder
if (CurOrder == GeomAbs_C0) {
Handle( BRepAdaptor_HCurve ) HCurve = new BRepAdaptor_HCurve();
HCurve->ChangeCurve().Initialize( CurEdge );
Constr = new BRepFill_CurveConstraint(HCurve,
const Handle(Adaptor3d_HCurve)& aHCurve = HCurve; // to avoid ambiguity
Constr = new BRepFill_CurveConstraint(aHCurve,
CurOrder,
myNbPtsOnCur,
myTol3d );

View File

@@ -112,7 +112,8 @@ static Handle(Geom_BSplineCurve) EdgeToBSpline (const TopoDS_Edge& theEdge)
// special treatment of conic curve
if (aTrimCurve->BasisCurve()->IsKind(STANDARD_TYPE(Geom_Conic)))
{
GeomConvert_ApproxCurve anAppr (aTrimCurve, Precision::Confusion(), GeomAbs_C1, 16, 14);
const Handle(Geom_Curve)& aCurve = aTrimCurve; // to avoid ambiguity
GeomConvert_ApproxCurve anAppr (aCurve, Precision::Confusion(), GeomAbs_C1, 16, 14);
if (anAppr.HasResult())
aBSCurve = anAppr.Curve();
}

View File

@@ -350,7 +350,8 @@ static Standard_Boolean SameParameter(TopoDS_Edge& E,
}
}
Approx_SameParameter sp( HC3d, Pcurv, S, tol3d );
const Handle(Adaptor3d_HCurve)& aHCurve = HC3d; // to avoid ambiguity
Approx_SameParameter sp (aHCurve, Pcurv, S, tol3d );
if(sp.IsDone() && !sp.IsSameParameter()) Pcurv = sp.Curve2d();
else if(!sp.IsDone() && !sp.IsSameParameter()){
#ifdef OCCT_DEBUG