mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +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:
@@ -65,6 +65,28 @@ static const Standard_Real PosTol = Precision::PConfusion() / 2;
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(Geom2dAdaptor_Curve, Adaptor2d_Curve2d)
|
||||
|
||||
//=======================================================================
|
||||
//function : ShallowCopy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor2d_Curve2d) Geom2dAdaptor_Curve::ShallowCopy() const
|
||||
{
|
||||
Handle(Geom2dAdaptor_Curve) aCopy = new Geom2dAdaptor_Curve();
|
||||
|
||||
aCopy->myCurve = myCurve;
|
||||
aCopy->myTypeCurve = myTypeCurve;
|
||||
aCopy->myFirst = myFirst;
|
||||
aCopy->myLast = myLast;
|
||||
aCopy->myBSplineCurve = myBSplineCurve;
|
||||
if(!myNestedEvaluator.IsNull())
|
||||
{
|
||||
aCopy->myNestedEvaluator = myNestedEvaluator->ShallowCopy();
|
||||
}
|
||||
|
||||
return aCopy;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LocalContinuity
|
||||
//purpose : Computes the Continuity of a BSplineCurve
|
||||
|
@@ -58,6 +58,9 @@ public:
|
||||
//! Standard_ConstructionError is raised if Ufirst>Ulast
|
||||
Standard_EXPORT Geom2dAdaptor_Curve(const Handle(Geom2d_Curve)& C, const Standard_Real UFirst, const Standard_Real ULast);
|
||||
|
||||
//! Shallow copy of adaptor
|
||||
Standard_EXPORT virtual Handle(Adaptor2d_Curve2d) ShallowCopy() const Standard_OVERRIDE;
|
||||
|
||||
//! Reset currently loaded curve (undone Load()).
|
||||
Standard_EXPORT void Reset();
|
||||
|
||||
@@ -183,7 +186,7 @@ private:
|
||||
//! \param theParameter the value on the knot axis which identifies the caching span
|
||||
void RebuildCache (const Standard_Real theParameter) const;
|
||||
|
||||
private:
|
||||
protected:
|
||||
|
||||
Handle(Geom2d_Curve) myCurve;
|
||||
GeomAbs_CurveType myTypeCurve;
|
||||
|
Reference in New Issue
Block a user