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:
@@ -44,6 +44,8 @@ public:
|
||||
virtual gp_Vec2d DN(const Standard_Real theU,
|
||||
const Standard_Integer theDerU) const = 0;
|
||||
|
||||
virtual Handle(Geom2dEvaluator_Curve) ShallowCopy() const = 0;
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(Geom2dEvaluator_Curve,Standard_Transient)
|
||||
};
|
||||
|
||||
|
@@ -113,6 +113,22 @@ gp_Vec2d Geom2dEvaluator_OffsetCurve::DN(const Standard_Real theU,
|
||||
return aDN;
|
||||
}
|
||||
|
||||
Handle(Geom2dEvaluator_Curve) Geom2dEvaluator_OffsetCurve::ShallowCopy() const
|
||||
{
|
||||
Handle(Geom2dEvaluator_OffsetCurve) aCopy;
|
||||
if (!myBaseAdaptor.IsNull())
|
||||
{
|
||||
aCopy = new Geom2dEvaluator_OffsetCurve(Handle(Geom2dAdaptor_Curve)::DownCast(myBaseAdaptor->ShallowCopy()),
|
||||
myOffset);
|
||||
}
|
||||
else
|
||||
{
|
||||
aCopy = new Geom2dEvaluator_OffsetCurve(myBaseCurve, myOffset);
|
||||
}
|
||||
|
||||
return aCopy;
|
||||
}
|
||||
|
||||
|
||||
void Geom2dEvaluator_OffsetCurve::BaseD0(const Standard_Real theU,
|
||||
gp_Pnt2d& theValue) const
|
||||
|
@@ -53,6 +53,8 @@ public:
|
||||
Standard_EXPORT gp_Vec2d DN(const Standard_Real theU,
|
||||
const Standard_Integer theDeriv) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Handle(Geom2dEvaluator_Curve) ShallowCopy() const Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(Geom2dEvaluator_OffsetCurve,Geom2dEvaluator_Curve)
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user