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:
@@ -41,6 +41,16 @@ Adaptor3d_Curve::~Adaptor3d_Curve()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShallowCopy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_Curve) Adaptor3d_Curve::ShallowCopy() const
|
||||
{
|
||||
throw Standard_NotImplemented("Adaptor3d_Curve::ShallowCopy");
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
|
@@ -58,6 +58,9 @@ class Adaptor3d_Curve : public Standard_Transient
|
||||
DEFINE_STANDARD_RTTIEXT(Adaptor3d_Curve, Standard_Transient)
|
||||
public:
|
||||
|
||||
//! Shallow copy of adaptor
|
||||
Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Real FirstParameter() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Real LastParameter() const;
|
||||
|
@@ -718,6 +718,40 @@ Adaptor3d_CurveOnSurface::Adaptor3d_CurveOnSurface
|
||||
Load(C);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShallowCopy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_Curve) Adaptor3d_CurveOnSurface::ShallowCopy() const
|
||||
{
|
||||
Handle(Adaptor3d_CurveOnSurface) aCopy = new Adaptor3d_CurveOnSurface();
|
||||
|
||||
if (!mySurface.IsNull())
|
||||
{
|
||||
aCopy->mySurface = mySurface->ShallowCopy();
|
||||
}
|
||||
if (!myCurve.IsNull())
|
||||
{
|
||||
aCopy->myCurve = myCurve->ShallowCopy();
|
||||
}
|
||||
aCopy->myType = myType;
|
||||
aCopy->myCirc = myCirc;
|
||||
aCopy->myLin = myLin;
|
||||
if (!myFirstSurf.IsNull())
|
||||
{
|
||||
aCopy->myFirstSurf = myFirstSurf->ShallowCopy();
|
||||
}
|
||||
if (!myLastSurf.IsNull())
|
||||
{
|
||||
aCopy->myLastSurf = myLastSurf->ShallowCopy();
|
||||
}
|
||||
aCopy->myIntervals = myIntervals;
|
||||
aCopy->myIntCont = myIntCont;
|
||||
|
||||
return aCopy;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
|
@@ -45,6 +45,9 @@ public:
|
||||
//! the surface <S>.
|
||||
Standard_EXPORT Adaptor3d_CurveOnSurface(const Handle(Adaptor2d_Curve2d)& C, const Handle(Adaptor3d_Surface)& S);
|
||||
|
||||
//! Shallow copy of adaptor
|
||||
Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const Standard_OVERRIDE;
|
||||
|
||||
//! Changes the surface.
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_Surface)& S);
|
||||
|
||||
|
@@ -104,6 +104,27 @@ Adaptor3d_IsoCurve::Adaptor3d_IsoCurve(const Handle(Adaptor3d_Surface)& theS,
|
||||
Load(theIso, theParam, theWFirst, theWLast);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShallowCopy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_Curve) Adaptor3d_IsoCurve::ShallowCopy() const
|
||||
{
|
||||
Handle(Adaptor3d_IsoCurve) aCopy = new Adaptor3d_IsoCurve();
|
||||
|
||||
if (!mySurface.IsNull())
|
||||
{
|
||||
aCopy->mySurface = mySurface->ShallowCopy();
|
||||
}
|
||||
aCopy->myIso = myIso;
|
||||
aCopy->myFirst = myFirst;
|
||||
aCopy->myLast = myLast;
|
||||
aCopy->myParameter = myParameter;
|
||||
|
||||
return aCopy;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
|
@@ -49,6 +49,9 @@ public:
|
||||
//! iso. WFirst,WLast define the bounds of the iso.
|
||||
Standard_EXPORT Adaptor3d_IsoCurve(const Handle(Adaptor3d_Surface)& S, const GeomAbs_IsoType Iso, const Standard_Real Param, const Standard_Real WFirst, const Standard_Real WLast);
|
||||
|
||||
//! Shallow copy of adaptor
|
||||
Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const Standard_OVERRIDE;
|
||||
|
||||
//! Changes the surface. The iso is reset to
|
||||
//! NoneIso.
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_Surface)& S);
|
||||
|
@@ -43,6 +43,15 @@ Adaptor3d_Surface::~Adaptor3d_Surface()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShallowCopy()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_Surface) Adaptor3d_Surface::ShallowCopy() const
|
||||
{
|
||||
throw Standard_NotImplemented("Adaptor3d_Surface::ShallowCopy");
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FirstUParameter
|
||||
//purpose :
|
||||
|
@@ -59,6 +59,9 @@ class Adaptor3d_Surface : public Standard_Transient
|
||||
DEFINE_STANDARD_RTTIEXT(Adaptor3d_Surface, Standard_Transient)
|
||||
public:
|
||||
|
||||
//! Shallow copy of adaptor
|
||||
Standard_EXPORT virtual Handle(Adaptor3d_Surface) ShallowCopy() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Real FirstUParameter() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Real LastUParameter() const;
|
||||
|
Reference in New Issue
Block a user