mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +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:
@@ -51,6 +51,34 @@ ChFiDS_ElSpine::ChFiDS_ElSpine()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShallowCopy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Adaptor3d_Curve) ChFiDS_ElSpine::ShallowCopy() const
|
||||
{
|
||||
Handle(ChFiDS_ElSpine) aCopy = new ChFiDS_ElSpine();
|
||||
|
||||
const Handle(Adaptor3d_Curve) aCurve = curve.ShallowCopy();
|
||||
const GeomAdaptor_Curve& aGeomCurve = *(Handle(GeomAdaptor_Curve)::DownCast(aCurve));
|
||||
aCopy->curve = aGeomCurve;
|
||||
|
||||
aCopy->ptfirst = ptfirst;
|
||||
aCopy->ptlast = ptlast;
|
||||
aCopy->tgfirst = tgfirst;
|
||||
aCopy->tglast = tglast;
|
||||
aCopy->VerticesWithTangents = VerticesWithTangents;
|
||||
aCopy->previous = previous;
|
||||
aCopy->next = next;
|
||||
aCopy->pfirst = pfirst;
|
||||
aCopy->plast = plast;
|
||||
aCopy->period = period;
|
||||
aCopy->periodic = periodic;
|
||||
aCopy->pfirstsav = pfirstsav;
|
||||
aCopy->plastsav = plastsav;
|
||||
|
||||
return aCopy;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
@@ -449,7 +477,7 @@ Handle(ChFiDS_SurfData)& ChFiDS_ElSpine::ChangeNext()
|
||||
|
||||
gp_Lin ChFiDS_ElSpine::Line() const
|
||||
{
|
||||
return curve.Line();
|
||||
return curve.Line();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -479,7 +507,7 @@ gp_Elips ChFiDS_ElSpine::Ellipse() const
|
||||
|
||||
gp_Hypr ChFiDS_ElSpine::Hyperbola() const
|
||||
{
|
||||
return curve.Hyperbola();
|
||||
return curve.Hyperbola();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
Reference in New Issue
Block a user