mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0032485: Modeling Algorithms - Add Clone() function for adapters
Provide ShallowCopy() functions for adapters & evaluators of curves, 2d curves and surfaces. This will allow using copies of the same adapter in multi-thread calculations.
This commit is contained in:
@@ -73,6 +73,30 @@ BRepAdaptor_Curve::BRepAdaptor_Curve(const TopoDS_Edge& E,
|
||||
Initialize(E,F);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShallowCopy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_Curve) BRepAdaptor_Curve::ShallowCopy() const
|
||||
{
|
||||
Handle(BRepAdaptor_Curve) aCopy = new BRepAdaptor_Curve();
|
||||
|
||||
aCopy->myTrsf = myTrsf;
|
||||
|
||||
const Handle(Adaptor3d_Curve) aCurve = myCurve.ShallowCopy();
|
||||
const GeomAdaptor_Curve& aGeomCurve = *(Handle(GeomAdaptor_Curve)::DownCast(aCurve));
|
||||
aCopy->myCurve = aGeomCurve;
|
||||
|
||||
if (!myConSurf.IsNull())
|
||||
{
|
||||
aCopy->myConSurf = Handle(Adaptor3d_CurveOnSurface)::DownCast(myConSurf->ShallowCopy());
|
||||
}
|
||||
aCopy->myEdge = myEdge;
|
||||
|
||||
return aCopy;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Reset
|
||||
//purpose :
|
||||
|
Reference in New Issue
Block a user