]> OCCT Git - occt-copy.git/commitdiff
0032485: Modeling Algorithms - Add Clone() function for adapters
authorasuraven <andrey.suravenkov@opencascade.com>
Tue, 20 Jul 2021 15:44:23 +0000 (18:44 +0300)
committerasuraven <andrey.suravenkov@opencascade.com>
Mon, 26 Jul 2021 09:34:47 +0000 (12:34 +0300)
44 files changed:
src/Adaptor2d/Adaptor2d_Curve2d.cxx
src/Adaptor2d/Adaptor2d_Curve2d.hxx
src/Adaptor2d/Adaptor2d_Line2d.cxx
src/Adaptor2d/Adaptor2d_Line2d.hxx
src/Adaptor2d/Adaptor2d_OffsetCurve.cxx
src/Adaptor2d/Adaptor2d_OffsetCurve.hxx
src/Adaptor3d/Adaptor3d_Curve.cxx
src/Adaptor3d/Adaptor3d_Curve.hxx
src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx
src/Adaptor3d/Adaptor3d_CurveOnSurface.hxx
src/Adaptor3d/Adaptor3d_IsoCurve.cxx
src/Adaptor3d/Adaptor3d_IsoCurve.hxx
src/Adaptor3d/Adaptor3d_Surface.cxx
src/Adaptor3d/Adaptor3d_Surface.hxx
src/BRepAdaptor/BRepAdaptor_CompCurve.cxx
src/BRepAdaptor/BRepAdaptor_CompCurve.hxx
src/BRepAdaptor/BRepAdaptor_Curve.cxx
src/BRepAdaptor/BRepAdaptor_Curve.hxx
src/BRepAdaptor/BRepAdaptor_Curve2d.cxx
src/BRepAdaptor/BRepAdaptor_Curve2d.hxx
src/BRepAdaptor/BRepAdaptor_Surface.cxx
src/BRepAdaptor/BRepAdaptor_Surface.hxx
src/BiTgte/BiTgte_CurveOnEdge.cxx
src/BiTgte/BiTgte_CurveOnEdge.hxx
src/ChFiDS/ChFiDS_ElSpine.cxx
src/ChFiDS/ChFiDS_ElSpine.hxx
src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx
src/Geom2dAdaptor/Geom2dAdaptor_Curve.hxx
src/GeomAdaptor/GeomAdaptor_Curve.cxx
src/GeomAdaptor/GeomAdaptor_Curve.hxx
src/GeomAdaptor/GeomAdaptor_Surface.cxx
src/GeomAdaptor/GeomAdaptor_Surface.hxx
src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.cxx
src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.hxx
src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx
src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.hxx
src/GeomFill/GeomFill_SnglrFunc.cxx
src/GeomFill/GeomFill_SnglrFunc.hxx
src/ProjLib/ProjLib_CompProjectedCurve.cxx
src/ProjLib/ProjLib_CompProjectedCurve.hxx
src/ProjLib/ProjLib_ProjectOnPlane.cxx
src/ProjLib/ProjLib_ProjectOnPlane.hxx
src/ProjLib/ProjLib_ProjectedCurve.cxx
src/ProjLib/ProjLib_ProjectedCurve.hxx

index 3df4666d44ff19442768a31e14206acd2bef7a67..5bcd2eb872873495a32c36944ae798816b883981 100644 (file)
@@ -40,6 +40,16 @@ Adaptor2d_Curve2d::~Adaptor2d_Curve2d()
 {
 }
 
+//=======================================================================
+//function : ShallowCopy()
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor2d_Curve2d) Adaptor2d_Curve2d::ShallowCopy() const
+{  
+  throw Standard_NotImplemented("Adaptor2d_Curve2d::ShallowCopy");
+}
+
 //=======================================================================
 //function : FirstParameter
 //purpose  : 
index ae14128738da1545b0b66ea57a7b442bbfbfdfa8..1da082692cdbfb041b6a3ee8b01d683c0dba7c37 100644 (file)
@@ -54,6 +54,9 @@ class Adaptor2d_Curve2d : public Standard_Transient
 {
   DEFINE_STANDARD_RTTIEXT(Adaptor2d_Curve2d, Standard_Transient)
 public:
+
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor2d_Curve2d) ShallowCopy() const;
   
   Standard_EXPORT virtual Standard_Real FirstParameter() const;
   
index 7e5cd5deec600d6618f1f86fc5afe05cfe147bcd..16792e654adb9638f3ffed81bb66b759b515801f 100644 (file)
@@ -53,6 +53,22 @@ Adaptor2d_Line2d::Adaptor2d_Line2d()
 {
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+ Handle(Adaptor2d_Curve2d) Adaptor2d_Line2d::ShallowCopy() const
+ {
+   Handle(Adaptor2d_Line2d) aCopy = new Adaptor2d_Line2d();
+
+   aCopy->myUfirst = myUfirst;
+   aCopy->myUlast  = myUlast;
+   aCopy->myAx2d   = myAx2d;
+
+   return aCopy;
+ }
+
 //=======================================================================
 //function : Load
 //purpose  : 
index 3cdb10ef1458462724a716231f988f867884515c..db8ee1a6c0f4ef37022c8d2ac314de4040ac1b60 100644 (file)
@@ -53,7 +53,10 @@ public:
   Standard_EXPORT Adaptor2d_Line2d();
   
   Standard_EXPORT Adaptor2d_Line2d(const gp_Pnt2d& P, const gp_Dir2d& D, const Standard_Real UFirst, const Standard_Real ULast);
-  
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor2d_Curve2d) ShallowCopy() const Standard_OVERRIDE;
+
   Standard_EXPORT void Load (const gp_Lin2d& L);
   
   Standard_EXPORT void Load (const gp_Lin2d& L, const Standard_Real UFirst, const Standard_Real ULast);
index db84f182002aa8b8e589105232a850da7cee74d2..6a7e86eb9cc3b9e69f24e98add62b70066ae6056 100644 (file)
@@ -90,6 +90,22 @@ Adaptor2d_OffsetCurve::Adaptor2d_OffsetCurve(
 {
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor2d_Curve2d) Adaptor2d_OffsetCurve::ShallowCopy() const
+{
+  Handle(Adaptor2d_OffsetCurve) aCopy = new Adaptor2d_OffsetCurve();
+
+  aCopy->myCurve  = myCurve;
+  aCopy->myOffset = myOffset;
+  aCopy->myFirst  = myFirst;
+  aCopy->myLast   = myLast;
+
+  return aCopy;
+}
 //=======================================================================
 //function : Load
 //purpose  : 
index bdfa376dd54a4e099acc3330bd4e183b856422fe..14c5bd838d92f97923bd59c997f3e97ccd508ab8 100644 (file)
@@ -57,6 +57,9 @@ public:
   //! WFirst,WLast define the bounds of the Offset curve.
   Standard_EXPORT Adaptor2d_OffsetCurve(const Handle(Adaptor2d_Curve2d)& C, const Standard_Real Offset, const Standard_Real WFirst, const Standard_Real WLast);
   
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor2d_Curve2d) ShallowCopy() const Standard_OVERRIDE;
+
   //! Changes  the curve.  The Offset is reset to 0.
   Standard_EXPORT void Load (const Handle(Adaptor2d_Curve2d)& S);
   
index d82c14b1b8c249637fdbedd5d3525b3e334efc46..76b13c555733e5c1af9652cb25ec513dbc5d4985 100644 (file)
@@ -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  : 
index 52897871e47bfaeb4f2782b255ffa5d2786bd3de..78f062eafc67ad28e11708dc94babceb75112705 100644 (file)
@@ -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;
index a0dff90f24f9e145966ea585117b04300bd827d5..3967462bc2b00d9be6ea57699c7e748a36c29d63 100644 (file)
@@ -718,6 +718,28 @@ Adaptor3d_CurveOnSurface::Adaptor3d_CurveOnSurface
   Load(C);
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor3d_Curve) Adaptor3d_CurveOnSurface::ShallowCopy() const
+{
+  Handle(Adaptor3d_CurveOnSurface) aCopy = new Adaptor3d_CurveOnSurface();
+
+  aCopy->mySurface    = mySurface;
+  aCopy->myCurve     = myCurve;
+  aCopy->myType      = myType;
+  aCopy->myCirc      = myCirc;
+  aCopy->myLin       = myLin;
+  aCopy->myFirstSurf = myFirstSurf;
+  aCopy->myLastSurf  = myLastSurf;
+  aCopy->myIntervals = myIntervals;
+  aCopy->myIntCont   = myIntCont;
+
+  return aCopy;
+}
+
 //=======================================================================
 //function : Load
 //purpose  : 
index 96c2309534dbdf6a019452e3d015a44db6fcf62a..554a7edf39f83db16c7b4dbbe5b0d2d79dbabbdd 100644 (file)
@@ -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);
   
index 712d89a8a38f185b5d4a92da0f8b2a2e13114599..092943093a735425d0452439a39ea34faad53c36 100644 (file)
@@ -104,6 +104,23 @@ 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();
+  aCopy->mySurface   = mySurface;
+  aCopy->myIso       = myIso;
+  aCopy->myFirst     = myFirst;
+  aCopy->myLast      = myLast;
+  aCopy->myParameter = myParameter;
+
+  return aCopy;
+}
+
 //=======================================================================
 //function : Load
 //purpose  : 
index b05da9e2c72a7dd2c00d65ff5e6c84e74fd16048..9fa24f5a9586ba87c49b654d4026bc277746a426 100644 (file)
@@ -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);
index 5a52130b5c2cfcde9c7c2a9984de44ee9e536e3b..c48bbc5b429e110dde404bba0c43afd4cc820770 100644 (file)
@@ -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  : 
index a3163f92dada9e20aa6798e9204fd6b868c56551..5972b5ff76f3f1ff79feef665c7ee3ce6080b573 100644 (file)
@@ -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;
index 64acb5ee91f9a87bb7d22872b97de16fd3c99b1d..ca1834ec01bd37480a1e86eda8d4fdeea2eb3c64 100644 (file)
@@ -79,6 +79,28 @@ BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& theWire,
   Initialize(theWire, theIsAC, theFirst, theLast, theTolerance);
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
+{
+  Handle(BRepAdaptor_CompCurve) aCopy = new BRepAdaptor_CompCurve();
+
+  aCopy->myWire   = myWire;
+  aCopy->TFirst   = TFirst;
+  aCopy->TLast    = TLast;
+  aCopy->PTol     = PTol;
+  aCopy->myCurves = myCurves;
+  aCopy->myKnots  = myKnots;
+  aCopy->CurIndex = CurIndex;
+  aCopy->Forward  = Forward;
+  aCopy->IsbyAC   = IsbyAC;
+
+  return aCopy;
+}
+
  void BRepAdaptor_CompCurve::Initialize(const TopoDS_Wire& W,
                                        const Standard_Boolean AC)
 {
index cf772a41a985061cce076aad0bbbf19cc766858e..9378600ea0fe7027a4c1e7a36a8536058905d9f0 100644 (file)
@@ -74,6 +74,9 @@ public:
   //! <W>.
   Standard_EXPORT BRepAdaptor_CompCurve(const TopoDS_Wire& W, const Standard_Boolean KnotByCurvilinearAbcissa, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
   
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const Standard_OVERRIDE;
+
   //! Sets the  wire <W>.
   Standard_EXPORT void Initialize (const TopoDS_Wire& W, const Standard_Boolean KnotByCurvilinearAbcissa);
   
index f6915be1f67aa4fffecaded24d260d260a812799..99d5f011fb26f4433d1eb13412d9fdf585d1a34a 100644 (file)
@@ -50,7 +50,9 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepAdaptor_Curve, Adaptor3d_Curve)
 //purpose  : 
 //=======================================================================
 BRepAdaptor_Curve::BRepAdaptor_Curve()
-{}
+{
+  myCurve = new GeomAdaptor_Curve;
+}
 
 //=======================================================================
 //function : BRepAdaptor_Curve
@@ -59,6 +61,7 @@ BRepAdaptor_Curve::BRepAdaptor_Curve()
 
 BRepAdaptor_Curve::BRepAdaptor_Curve(const TopoDS_Edge& E)
 {
+  myCurve = new GeomAdaptor_Curve;
   Initialize(E);
 }
 
@@ -70,16 +73,34 @@ BRepAdaptor_Curve::BRepAdaptor_Curve(const TopoDS_Edge& E)
 BRepAdaptor_Curve::BRepAdaptor_Curve(const TopoDS_Edge& E,
                                     const TopoDS_Face& F)
 {
+  myCurve = new GeomAdaptor_Curve;
   Initialize(E,F);
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor3d_Curve) BRepAdaptor_Curve::ShallowCopy() const
+{
+  Handle(BRepAdaptor_Curve) aCopy = new BRepAdaptor_Curve();
+
+  aCopy->myTrsf    = myTrsf;
+  aCopy->myCurve   = Handle(GeomAdaptor_Curve)::DownCast(myCurve->ShallowCopy());
+  aCopy->myConSurf = myConSurf;
+  aCopy->myEdge    = myEdge;
+
+  return aCopy;
+}
+
 //=======================================================================
 //function : Reset
 //purpose  :
 //=======================================================================
 void BRepAdaptor_Curve::Reset()
 {
-  myCurve.Reset();
+  myCurve->Reset();
   myConSurf.Nullify();
   myEdge.Nullify();
   myTrsf = gp_Trsf();
@@ -100,7 +121,7 @@ void BRepAdaptor_Curve::Initialize(const TopoDS_Edge& E)
   Handle(Geom_Curve) C = BRep_Tool::Curve(E,L,pf,pl);
 
   if (!C.IsNull()) {
-    myCurve.Load(C,pf,pl);
+    myCurve->Load(C,pf,pl);
   }
   else {
     Handle(Geom2d_Curve) PC;
@@ -184,7 +205,7 @@ Standard_Boolean BRepAdaptor_Curve::IsCurveOnSurface() const
 
 const GeomAdaptor_Curve& BRepAdaptor_Curve::Curve() const
 {
-  return myCurve;
+  return *myCurve;
 }
 
 //=======================================================================
@@ -225,7 +246,7 @@ Standard_Real BRepAdaptor_Curve::Tolerance() const
 Standard_Real BRepAdaptor_Curve::FirstParameter() const 
 {
   if (myConSurf.IsNull()) {
-    return myCurve.FirstParameter();
+    return myCurve->FirstParameter();
   }
   else {
     return myConSurf->FirstParameter();
@@ -240,7 +261,7 @@ Standard_Real BRepAdaptor_Curve::FirstParameter() const
 Standard_Real BRepAdaptor_Curve::LastParameter() const 
 {
   if (myConSurf.IsNull()) {
-    return myCurve.LastParameter();
+    return myCurve->LastParameter();
   }
   else {
     return myConSurf->LastParameter();
@@ -255,7 +276,7 @@ Standard_Real BRepAdaptor_Curve::LastParameter() const
 GeomAbs_Shape BRepAdaptor_Curve::Continuity() const 
 {
   if (myConSurf.IsNull()) {
-    return myCurve.Continuity();
+    return myCurve->Continuity();
   }
   else {
     return myConSurf->Continuity();
@@ -270,7 +291,7 @@ GeomAbs_Shape BRepAdaptor_Curve::Continuity() const
 Standard_Integer BRepAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const
 {
   if (myConSurf.IsNull()) {
-    return myCurve.NbIntervals(S);
+    return myCurve->NbIntervals(S);
   }
   else {
     return myConSurf->NbIntervals(S);
@@ -286,7 +307,7 @@ void BRepAdaptor_Curve::Intervals(TColStd_Array1OfReal& T,
                                   const GeomAbs_Shape S) const
 {
   if (myConSurf.IsNull()) {
-    myCurve.Intervals(T, S);
+    myCurve->Intervals(T, S);
   }
   else {
     myConSurf->Intervals(T, S);
@@ -307,10 +328,10 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Curve::Trim(const Standard_Real First,
   Handle(BRepAdaptor_Curve) res;
   if (myConSurf.IsNull()){
     Standard_Real pf = FirstParameter(), pl = LastParameter();
-    Handle(Geom_Curve) C = myCurve.Curve();
-    const_cast<GeomAdaptor_Curve*>(&myCurve)->Load(C,First,Last);
+    Handle(Geom_Curve) C = myCurve->Curve();
+    const_cast<GeomAdaptor_Curve*>(myCurve.get())->Load(C,First,Last);
     res = new BRepAdaptor_Curve (*this);
-    const_cast<GeomAdaptor_Curve*>(&myCurve)->Load(C,pf,pl);
+    const_cast<GeomAdaptor_Curve*>(myCurve.get())->Load(C,pf,pl);
   }
   else {
     Handle(Adaptor3d_CurveOnSurface) sav = myConSurf;
@@ -330,7 +351,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Curve::Trim(const Standard_Real First,
 Standard_Boolean BRepAdaptor_Curve::IsClosed() const 
 {
   if (myConSurf.IsNull()) {
-    return myCurve.IsClosed();
+    return myCurve->IsClosed();
   }
   else {
     return myConSurf->IsClosed();
@@ -345,7 +366,7 @@ Standard_Boolean BRepAdaptor_Curve::IsClosed() const
 Standard_Boolean BRepAdaptor_Curve::IsPeriodic() const 
 {
   if (myConSurf.IsNull()) {
-    return myCurve.IsPeriodic();
+    return myCurve->IsPeriodic();
   }
   else {
     return myConSurf->IsPeriodic();
@@ -360,7 +381,7 @@ Standard_Boolean BRepAdaptor_Curve::IsPeriodic() const
 Standard_Real BRepAdaptor_Curve::Period() const 
 {
   if (myConSurf.IsNull()) {
-    return myCurve.Period();
+    return myCurve->Period();
   }
   else {
     return myConSurf->Period();
@@ -376,7 +397,7 @@ gp_Pnt BRepAdaptor_Curve::Value(const Standard_Real U) const
 {
   gp_Pnt P;
   if (myConSurf.IsNull())
-    P = myCurve.Value(U);
+    P = myCurve->Value(U);
   else
     P = myConSurf->Value(U);
   P.Transform(myTrsf);
@@ -391,7 +412,7 @@ gp_Pnt BRepAdaptor_Curve::Value(const Standard_Real U) const
 void BRepAdaptor_Curve::D0(const Standard_Real U, gp_Pnt& P) const
 {
   if (myConSurf.IsNull())
-    myCurve.D0(U,P);
+    myCurve->D0(U,P);
   else
     myConSurf->D0(U,P);
   P.Transform(myTrsf);
@@ -406,7 +427,7 @@ void BRepAdaptor_Curve::D1(const Standard_Real U,
                           gp_Pnt& P, gp_Vec& V) const
 {
   if (myConSurf.IsNull())
-    myCurve.D1(U,P,V);
+    myCurve->D1(U,P,V);
   else
     myConSurf->D1(U,P,V);
   P.Transform(myTrsf);
@@ -422,7 +443,7 @@ void BRepAdaptor_Curve::D2(const Standard_Real U,
                           gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const
 {
   if (myConSurf.IsNull())
-    myCurve.D2(U,P,V1,V2);
+    myCurve->D2(U,P,V1,V2);
   else
     myConSurf->D2(U,P,V1,V2);
   P.Transform(myTrsf);
@@ -440,7 +461,7 @@ void BRepAdaptor_Curve::D3(const Standard_Real U,
                           gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const
 {
   if (myConSurf.IsNull())
-    myCurve.D3(U,P,V1,V2,V3);
+    myCurve->D3(U,P,V1,V2,V3);
   else
     myConSurf->D3(U,P,V1,V2,V3);
   P.Transform(myTrsf);
@@ -459,7 +480,7 @@ gp_Vec BRepAdaptor_Curve::DN(const Standard_Real U,
 {
   gp_Vec V;
   if (myConSurf.IsNull())
-    V = myCurve.DN(U,N);
+    V = myCurve->DN(U,N);
   else
     V = myConSurf->DN(U,N);
   V.Transform(myTrsf);
@@ -474,7 +495,7 @@ gp_Vec BRepAdaptor_Curve::DN(const Standard_Real U,
 Standard_Real BRepAdaptor_Curve::Resolution(const Standard_Real R) const 
 {
   if (myConSurf.IsNull()) {
-    return myCurve.Resolution(R);
+    return myCurve->Resolution(R);
   }
   else {
     return myConSurf->Resolution(R);
@@ -489,7 +510,7 @@ Standard_Real BRepAdaptor_Curve::Resolution(const Standard_Real R) const
 GeomAbs_CurveType BRepAdaptor_Curve::GetType() const 
 {
   if (myConSurf.IsNull()) {
-    return myCurve.GetType();
+    return myCurve->GetType();
   }
   else {
     return myConSurf->GetType();
@@ -505,7 +526,7 @@ gp_Lin BRepAdaptor_Curve::Line() const
 {
   gp_Lin L;
   if (myConSurf.IsNull())
-    L = myCurve.Line();
+    L = myCurve->Line();
   else
     L = myConSurf->Line();
   L.Transform(myTrsf);
@@ -521,7 +542,7 @@ gp_Circ BRepAdaptor_Curve::Circle() const
 {
   gp_Circ C;
   if (myConSurf.IsNull())
-    C = myCurve.Circle();
+    C = myCurve->Circle();
   else
     C = myConSurf->Circle();
   C.Transform(myTrsf);
@@ -537,7 +558,7 @@ gp_Elips BRepAdaptor_Curve::Ellipse() const
 {
   gp_Elips E;
   if (myConSurf.IsNull())
-    E = myCurve.Ellipse();
+    E = myCurve->Ellipse();
   else
     E = myConSurf->Ellipse();
   E.Transform(myTrsf);
@@ -553,7 +574,7 @@ gp_Hypr BRepAdaptor_Curve::Hyperbola() const
 {
   gp_Hypr H;
   if (myConSurf.IsNull())
-    H = myCurve.Hyperbola();
+    H = myCurve->Hyperbola();
   else
     H = myConSurf->Hyperbola();
   H.Transform(myTrsf);
@@ -569,7 +590,7 @@ gp_Parab BRepAdaptor_Curve::Parabola() const
 {
   gp_Parab P;
   if (myConSurf.IsNull())
-    P = myCurve.Parabola();
+    P = myCurve->Parabola();
   else
     P = myConSurf->Parabola();
   P.Transform(myTrsf);
@@ -584,7 +605,7 @@ gp_Parab BRepAdaptor_Curve::Parabola() const
 Standard_Integer BRepAdaptor_Curve::Degree() const
 {
   if (myConSurf.IsNull())
-    return myCurve.Degree();
+    return myCurve->Degree();
   else
     return myConSurf->Degree();
 }
@@ -597,7 +618,7 @@ Standard_Integer BRepAdaptor_Curve::Degree() const
 Standard_Boolean BRepAdaptor_Curve::IsRational() const
 {
   if (myConSurf.IsNull())
-    return myCurve.IsRational();
+    return myCurve->IsRational();
   else
     return myConSurf->IsRational();
 }
@@ -609,7 +630,7 @@ Standard_Boolean BRepAdaptor_Curve::IsRational() const
 Standard_Integer BRepAdaptor_Curve::NbPoles() const
 {
   if (myConSurf.IsNull()) 
-    return myCurve.NbPoles();
+    return myCurve->NbPoles();
   else
     return myConSurf->NbPoles();
 }
@@ -621,7 +642,7 @@ Standard_Integer BRepAdaptor_Curve::NbPoles() const
 Standard_Integer BRepAdaptor_Curve::NbKnots() const
 {
   if (myConSurf.IsNull()) 
-    return myCurve.NbKnots();
+    return myCurve->NbKnots();
   else
     return myConSurf->NbKnots();
 }
@@ -635,7 +656,7 @@ Handle(Geom_BezierCurve) BRepAdaptor_Curve::Bezier() const
 {
   Handle(Geom_BezierCurve) BC;
   if (myConSurf.IsNull()) {
-    BC = myCurve.Bezier();
+    BC = myCurve->Bezier();
   }
   else {
     BC = myConSurf->Bezier();
@@ -654,7 +675,7 @@ Handle(Geom_BSplineCurve) BRepAdaptor_Curve::BSpline() const
 {
   Handle(Geom_BSplineCurve) BS;
   if (myConSurf.IsNull()) {
-    BS = myCurve.BSpline();
+    BS = myCurve->BSpline();
   }
   else {
     BS = myConSurf->BSpline();
@@ -670,10 +691,10 @@ Handle(Geom_BSplineCurve) BRepAdaptor_Curve::BSpline() const
 
 Handle(Geom_OffsetCurve) BRepAdaptor_Curve::OffsetCurve() const
 {
-  if ( !Is3DCurve() || myCurve.GetType() != GeomAbs_OffsetCurve)
+  if ( !Is3DCurve() || myCurve->GetType() != GeomAbs_OffsetCurve)
     throw Standard_NoSuchObject("BRepAdaptor_Curve::OffsetCurve");
 
-  Handle(Geom_OffsetCurve) anOffC = myCurve.OffsetCurve();
+  Handle(Geom_OffsetCurve) anOffC = myCurve->OffsetCurve();
   return myTrsf.Form() == gp_Identity
     ? anOffC : Handle(Geom_OffsetCurve)::DownCast(anOffC->Transformed(myTrsf));
 }
index ded2fda66c31cbc670b57e4c2dc93d51fb18341c..40617940f8ec49879b4d93d2269a4cd735cc6121 100644 (file)
@@ -82,6 +82,9 @@ public:
   //! the face.
   Standard_EXPORT BRepAdaptor_Curve(const TopoDS_Edge& E, const TopoDS_Face& F);
 
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const Standard_OVERRIDE;
+
   //! Reset currently loaded curve (undone Load()).
   Standard_EXPORT void Reset();
 
@@ -222,7 +225,7 @@ public:
 private:
 
   gp_Trsf myTrsf;
-  GeomAdaptor_Curve myCurve;
+  Handle(GeomAdaptor_Curve) myCurve;
   Handle(Adaptor3d_CurveOnSurface) myConSurf;
   TopoDS_Edge myEdge;
 
index 140f4dd97b77b91609d1defddde7a335cedab21a..941ae240c137ded52e3702727a8c81fa5dde4707 100644 (file)
@@ -43,6 +43,25 @@ BRepAdaptor_Curve2d::BRepAdaptor_Curve2d(const TopoDS_Edge& E,
   Initialize(E,F);
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor2d_Curve2d) BRepAdaptor_Curve2d::ShallowCopy() const
+{
+  Handle(BRepAdaptor_Curve2d) aCopy = new BRepAdaptor_Curve2d();
+
+  aCopy->myCurve = myCurve;
+  aCopy->myTypeCurve = myTypeCurve;
+  aCopy->myFirst = myFirst;
+  aCopy->myLast = myLast;
+  aCopy->myBSplineCurve = myBSplineCurve;
+  aCopy->myCurveCache = myCurveCache;
+  aCopy->myNestedEvaluator = myNestedEvaluator;
+
+  return aCopy;
+}
 
 //=======================================================================
 //function : Initialize
index f19157649d8db5d28ef0a4ba52db70c28edb8c4f..a78e3c987a1ea990d267c05a2e4cbee08caef7c2 100644 (file)
@@ -49,6 +49,9 @@ public:
   
   //! Creates with the pcurve of <E> on <F>.
   Standard_EXPORT BRepAdaptor_Curve2d(const TopoDS_Edge& E, const TopoDS_Face& F);
+
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor2d_Curve2d) ShallowCopy() const Standard_OVERRIDE;
   
   //! Initialize with the pcurve of <E> on <F>.
   Standard_EXPORT void Initialize (const TopoDS_Edge& E, const TopoDS_Face& F);
index 1eda58f4feb523315f141b05ab2298b8970ce8a2..d16ccc62d60524bd2e76b2a647577813e6b26753 100644 (file)
@@ -63,6 +63,21 @@ BRepAdaptor_Surface::BRepAdaptor_Surface(const TopoDS_Face& F,
 }
 
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor3d_Surface) BRepAdaptor_Surface::ShallowCopy() const
+{
+  Handle(BRepAdaptor_Surface) aCopy = new BRepAdaptor_Surface();
+
+  aCopy->mySurf = mySurf;
+  aCopy->myTrsf = myTrsf;
+  aCopy->myFace = myFace;
+
+  return aCopy;
+}
 //=======================================================================
 //function : Initialize
 //purpose  : 
index ffd8648d35d0dc7b6601266fbf54a4b80972bb48..ed067dc619f83970bede0a8c989ee3c0350d67fc 100644 (file)
@@ -68,6 +68,9 @@ public:
   //! the  parameter  range  in   the  UV space  of  the
   //! restriction.
   Standard_EXPORT BRepAdaptor_Surface(const TopoDS_Face& F, const Standard_Boolean R = Standard_True);
+
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor3d_Surface) ShallowCopy() const Standard_OVERRIDE;
   
   //! Sets the surface to the geometry of <F>.
   Standard_EXPORT void Initialize (const TopoDS_Face& F, const Standard_Boolean Restriction = Standard_True);
index d3dc87b5524818cd042ff3716e0beca3e2402514..a94b3a6091035963f5f2ed5bc4b68fb780f01336 100644 (file)
@@ -64,7 +64,24 @@ BiTgte_CurveOnEdge::BiTgte_CurveOnEdge(const TopoDS_Edge& theEonF,
   Init(theEonF, theEdge);
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
 
+Handle(Adaptor3d_Curve) BiTgte_CurveOnEdge::ShallowCopy() const
+{
+  Handle(BiTgte_CurveOnEdge) aCopy = new BiTgte_CurveOnEdge();
+
+  aCopy->myEdge = myEdge;
+  aCopy->myEonF = myEonF;
+  aCopy->myCurv = myCurv;
+  aCopy->myConF = myConF;
+  aCopy->myType = myType;
+  aCopy->myCirc = myCirc;
+
+  return aCopy;
+}
 //=======================================================================
 //function : Init
 //purpose  : 
index 1c2c0c8793f5894e4e76eda7561812720857b617..d1b3142fc69e5f5b372f953d972a2c7bcc647afb 100644 (file)
@@ -57,6 +57,9 @@ public:
   Standard_EXPORT BiTgte_CurveOnEdge();
   
   Standard_EXPORT BiTgte_CurveOnEdge(const TopoDS_Edge& EonF, const TopoDS_Edge& Edge);
+
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const Standard_OVERRIDE;
   
   Standard_EXPORT void Init (const TopoDS_Edge& EonF, const TopoDS_Edge& Edge);
   
index a2866fffa956b273025a271e0304581fdf950985..579076164c72e20fd48fc921b4015013f9f281c0 100644 (file)
@@ -49,8 +49,34 @@ ChFiDS_ElSpine::ChFiDS_ElSpine()
   pfirstsav (Precision::Infinite()),
   plastsav (Precision::Infinite())
 {
+  curve = new GeomAdaptor_Curve;
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+Handle(Adaptor3d_Curve) ChFiDS_ElSpine::ShallowCopy() const
+{
+  Handle(ChFiDS_ElSpine) aCopy = new ChFiDS_ElSpine();
+
+  aCopy->curve                = Handle(GeomAdaptor_Curve)::DownCast(curve->ShallowCopy());
+  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
@@ -100,7 +126,7 @@ Standard_Real ChFiDS_ElSpine::GetSavedLastParameter() const
 
 GeomAbs_Shape ChFiDS_ElSpine::Continuity() const
 {
-  return curve.Continuity();
+  return curve->Continuity();
 }
 
 //=======================================================================
@@ -110,7 +136,7 @@ GeomAbs_Shape ChFiDS_ElSpine::Continuity() const
 
 Standard_Integer ChFiDS_ElSpine::NbIntervals(const GeomAbs_Shape S) const
 {
-  return curve.NbIntervals(S);
+  return curve->NbIntervals(S);
 }
 
 //=======================================================================
@@ -120,7 +146,7 @@ Standard_Integer ChFiDS_ElSpine::NbIntervals(const GeomAbs_Shape S) const
 
 void ChFiDS_ElSpine::Intervals(TColStd_Array1OfReal& T,const GeomAbs_Shape S) const
 {
-  curve.Intervals(T,S);
+  curve->Intervals(T,S);
 }
 
 //=======================================================================
@@ -132,7 +158,7 @@ Handle(Adaptor3d_Curve) ChFiDS_ElSpine::Trim(const Standard_Real First,
                                            const Standard_Real Last,
                                            const Standard_Real Tol) const
 {
-  return curve.Trim(First,Last,Tol);
+  return curve->Trim(First,Last,Tol);
 }
 
 //=======================================================================
@@ -142,7 +168,7 @@ Handle(Adaptor3d_Curve) ChFiDS_ElSpine::Trim(const Standard_Real First,
 
 Standard_Real ChFiDS_ElSpine::Resolution(const Standard_Real R3d) const
 {
-  return curve.Resolution(R3d);
+  return curve->Resolution(R3d);
 }
 
 
@@ -153,7 +179,7 @@ Standard_Real ChFiDS_ElSpine::Resolution(const Standard_Real R3d) const
 
 GeomAbs_CurveType ChFiDS_ElSpine::GetType() const
 {
-  return curve.GetType();
+  return curve->GetType();
 }
 
 
@@ -200,7 +226,7 @@ Standard_Real ChFiDS_ElSpine::Period() const
 
 gp_Pnt ChFiDS_ElSpine::Value(const Standard_Real AbsC) const
 {
-  return curve.Value(AbsC);
+  return curve->Value(AbsC);
 }
 
 
@@ -211,7 +237,7 @@ gp_Pnt ChFiDS_ElSpine::Value(const Standard_Real AbsC) const
 
 void ChFiDS_ElSpine::D0(const Standard_Real AbsC, gp_Pnt& P) const
 {
-  curve.D0(AbsC,P);
+  curve->D0(AbsC,P);
 }
 
 
@@ -223,7 +249,7 @@ void ChFiDS_ElSpine::D0(const Standard_Real AbsC, gp_Pnt& P) const
 void ChFiDS_ElSpine::D1(const Standard_Real AbsC, gp_Pnt& P, gp_Vec& V1)
 const
 {
-  curve.D1(AbsC,P,V1);
+  curve->D1(AbsC,P,V1);
 }
 
 
@@ -235,7 +261,7 @@ const
 void ChFiDS_ElSpine::D2(const Standard_Real AbsC, 
                        gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const
 {  
-  curve.D2(AbsC,P,V1,V2);
+  curve->D2(AbsC,P,V1,V2);
 }
 
 //=======================================================================
@@ -246,7 +272,7 @@ void ChFiDS_ElSpine::D2(const Standard_Real AbsC,
 void ChFiDS_ElSpine::D3(const Standard_Real AbsC, 
                        gp_Pnt& P, gp_Vec& V1, gp_Vec& V2,  gp_Vec& V3) const
 {  
-  curve.D3(AbsC,P,V1,V2,V3);
+  curve->D3(AbsC,P,V1,V2,V3);
 }
 
 
@@ -300,10 +326,10 @@ void ChFiDS_ElSpine::SaveLastParameter()
 void ChFiDS_ElSpine::SetOrigin(const Standard_Real O)
 {
   if(!periodic) throw Standard_Failure("Elspine non periodique");
-  Handle(Geom_BSplineCurve) bs = Handle(Geom_BSplineCurve)::DownCast(curve.Curve());
+  Handle(Geom_BSplineCurve) bs = Handle(Geom_BSplineCurve)::DownCast(curve->Curve());
   if(!bs.IsNull()) {
     bs->SetOrigin(O,Precision::PConfusion());
-    curve.Load(bs);
+    curve->Load(bs);
   }
 }
 
@@ -392,7 +418,7 @@ const gp_Ax1& ChFiDS_ElSpine::VertexWithTangent(const Standard_Integer Index) co
 
 void ChFiDS_ElSpine::SetCurve(const Handle(Geom_Curve)& C)
 {
-  curve.Load(C);
+  curve->Load(C);
 }
 
 //=======================================================================
@@ -449,7 +475,7 @@ Handle(ChFiDS_SurfData)& ChFiDS_ElSpine::ChangeNext()
 
 gp_Lin ChFiDS_ElSpine::Line() const 
 {
- return curve.Line();  
+ return curve->Line();
 }
 
 //=======================================================================
@@ -459,7 +485,7 @@ gp_Lin ChFiDS_ElSpine::Line() const
 
 gp_Circ  ChFiDS_ElSpine::Circle() const 
 {
- return curve.Circle();
+ return curve->Circle();
 }
 
 //=======================================================================
@@ -469,7 +495,7 @@ gp_Circ  ChFiDS_ElSpine::Circle() const
 
 gp_Elips ChFiDS_ElSpine::Ellipse() const 
 {
-  return curve.Ellipse();
+  return curve->Ellipse();
 }
 
 //=======================================================================
@@ -479,7 +505,7 @@ gp_Elips ChFiDS_ElSpine::Ellipse() const
 
 gp_Hypr ChFiDS_ElSpine::Hyperbola() const 
 {
-  return curve.Hyperbola();  
+  return curve->Hyperbola();
 }
 
 //=======================================================================
@@ -489,7 +515,7 @@ gp_Hypr ChFiDS_ElSpine::Hyperbola() const
 
 gp_Parab ChFiDS_ElSpine::Parabola() const 
 {
- return curve.Parabola();
+ return curve->Parabola();
 }
 
 //=======================================================================
@@ -499,7 +525,7 @@ gp_Parab ChFiDS_ElSpine::Parabola() const
 
 Handle(Geom_BezierCurve) ChFiDS_ElSpine::Bezier() const 
 {
-  return curve.Bezier();
+  return curve->Bezier();
 }
 
 //=======================================================================
@@ -509,5 +535,5 @@ Handle(Geom_BezierCurve) ChFiDS_ElSpine::Bezier() const
 
 Handle(Geom_BSplineCurve) ChFiDS_ElSpine::BSpline() const 
 {
-  return curve.BSpline();
+  return curve->BSpline();
 }
index 9dfc5a014629a0a367b8c93730dfddc454353d9a..3124b7a175edea7a50f3618165cdcfbf29ec4d9c 100644 (file)
@@ -57,6 +57,9 @@ class ChFiDS_ElSpine  : public Adaptor3d_Curve
 public:
 
   Standard_EXPORT ChFiDS_ElSpine();
+
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const Standard_OVERRIDE;
   
   Standard_EXPORT virtual Standard_Real FirstParameter() const Standard_OVERRIDE;
   
@@ -147,7 +150,7 @@ public:
 
 private:
 
-  GeomAdaptor_Curve curve;
+  Handle(GeomAdaptor_Curve) curve;
   gp_Pnt ptfirst;
   gp_Pnt ptlast;
   gp_Vec tgfirst;
index 2220bb3c65c8b32e3b15613cb81471f32587efe2..a0b630f34c687dd63601793b6a37875c7e02795a 100644 (file)
@@ -65,6 +65,25 @@ 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;
+  aCopy->myNestedEvaluator = myNestedEvaluator;
+
+  return aCopy;
+}
+
 //=======================================================================
 //function : LocalContinuity
 //purpose  : Computes the Continuity of a BSplineCurve 
index 0c668ec6d4e7d47a28a933b97bc741ef18c13e10..accca173afd8bebdf5d8ed9768e16b6a9fa5dc6c 100644 (file)
@@ -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;
index 6d8bfae8122096f354047b8a8e558cd12f1c5137..33fb3cca9c0203efd777ea8b26443d6518ae27bd 100644 (file)
@@ -63,6 +63,25 @@ static const Standard_Real PosTol = Precision::PConfusion() / 2;
 
 IMPLEMENT_STANDARD_RTTIEXT(GeomAdaptor_Curve, Adaptor3d_Curve)
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor3d_Curve) GeomAdaptor_Curve::ShallowCopy() const
+{
+  Handle(GeomAdaptor_Curve) aCopy = new GeomAdaptor_Curve();
+
+  aCopy->myCurve           = myCurve;
+  aCopy->myTypeCurve       = myTypeCurve;
+  aCopy->myFirst           = myFirst;
+  aCopy->myLast            = myLast;
+  aCopy->myBSplineCurve    = myBSplineCurve;
+  aCopy->myNestedEvaluator = myNestedEvaluator;
+
+  return aCopy;
+}
+
 //=======================================================================
 //function : LocalContinuity
 //purpose  : Computes the Continuity of a BSplineCurve 
index 894623beba08de68bd24f0efb73e328f6c679588..4c2fe32d8c0a17983ab70e1df59aaca1016d9e79 100644 (file)
@@ -54,6 +54,9 @@ public:
     Load (theCurve, theUFirst, theULast);
   }
 
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const Standard_OVERRIDE;
+
   //! Reset currently loaded curve (undone Load()).
   Standard_EXPORT void Reset();
 
index 27d058aefcf6712378faa6d31494063d87edf629..010caba62f38c9851da92ed41966e260ce88190f 100644 (file)
@@ -114,6 +114,30 @@ GeomAbs_Shape LocalContinuity(Standard_Integer         Degree,
   return GeomAbs_CN;
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor3d_Surface) GeomAdaptor_Surface::ShallowCopy() const
+{
+  Handle(GeomAdaptor_Surface) aCopy = new GeomAdaptor_Surface();
+
+  aCopy->mySurface         = mySurface;
+  aCopy->myUFirst          = myUFirst;
+  aCopy->myULast           = myULast;
+  aCopy->myVFirst          = myVFirst;
+  aCopy->myVLast           = myVLast;
+  aCopy->myTolU            = myTolU;
+  aCopy->myTolV            = myTolV;
+  aCopy->myBSplineSurface  = myBSplineSurface;
+
+  aCopy->mySurfaceType     = mySurfaceType;
+  aCopy->myNestedEvaluator = myNestedEvaluator;
+
+  return aCopy;
+}
+
 //=======================================================================
 //function : Load
 //purpose  : 
index 725bcfb6b5ca7e1a08032a7b21298290c863c127..49efc819325e12a1e6f6162ffc8b1f67f2970f3f 100644 (file)
@@ -61,6 +61,9 @@ public:
     Load (theSurf, theUFirst, theULast, theVFirst, theVLast, theTolU, theTolV);
   }
 
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor3d_Surface) ShallowCopy() const Standard_OVERRIDE;
+
   void Load (const Handle(Geom_Surface)& theSurf)
   {
     if (theSurf.IsNull()) { throw Standard_NullObject("GeomAdaptor_Surface::Load"); }
@@ -257,7 +260,7 @@ private:
   //! \param theV second parameter to identify the span for caching
   Standard_EXPORT void RebuildCache (const Standard_Real theU, const Standard_Real theV) const;
 
-private:
+  protected:
 
   Handle(Geom_Surface) mySurface;
   Standard_Real myUFirst;
@@ -270,7 +273,6 @@ private:
   Handle(Geom_BSplineSurface) myBSplineSurface; ///< B-spline representation to prevent downcasts
   mutable Handle(BSplSLib_Cache) mySurfaceCache; ///< Cached data for B-spline or Bezier surface
 
-protected:
   GeomAbs_SurfaceType mySurfaceType;
   Handle(GeomEvaluator_Surface) myNestedEvaluator; ///< Calculates values of nested complex surfaces (offset surface, surface of extrusion or revolution)
 };
index d196c8e9081aa40f38ccea45b3ce308949c182ea..e98a66884b261c34a34c578f457b1e009a6289d8 100644 (file)
@@ -58,6 +58,34 @@ GeomAdaptor_SurfaceOfLinearExtrusion::GeomAdaptor_SurfaceOfLinearExtrusion
   Load(V);
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor3d_Surface) GeomAdaptor_SurfaceOfLinearExtrusion::ShallowCopy() const
+{
+  Handle(GeomAdaptor_SurfaceOfLinearExtrusion) aCopy = new GeomAdaptor_SurfaceOfLinearExtrusion();
+
+  aCopy->myBasisCurve = myBasisCurve;
+  aCopy->myDirection  = myDirection;
+  aCopy->myHaveDir    = myHaveDir;
+
+  aCopy->mySurface = mySurface;
+  aCopy->myUFirst = myUFirst;
+  aCopy->myULast = myULast;
+  aCopy->myVFirst = myVFirst;
+  aCopy->myVLast = myVLast;
+  aCopy->myTolU = myTolU;
+  aCopy->myTolV = myTolV;
+  aCopy->myBSplineSurface = myBSplineSurface;
+  aCopy->mySurfaceCache = mySurfaceCache;
+
+  aCopy->mySurfaceType = mySurfaceType;
+  aCopy->myNestedEvaluator = myNestedEvaluator;
+
+  return aCopy;
+}
 //=======================================================================
 //function : Load
 //purpose  : 
index f5e28e909aa92b06f22d005d6030a6929f4bd9a5..c9b3179e9ededf429252e2a943863fcbb7ac956c 100644 (file)
@@ -57,6 +57,9 @@ public:
   //! Thew Curve and the Direction are loaded.
   Standard_EXPORT GeomAdaptor_SurfaceOfLinearExtrusion(const Handle(Adaptor3d_Curve)& C, const gp_Dir& V);
   
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor3d_Surface) ShallowCopy() const Standard_OVERRIDE;
+
   //! Changes the Curve
   Standard_EXPORT void Load (const Handle(Adaptor3d_Curve)& C);
   
index b2bc4336c22a08e454bdfcff9fe89b4b436d51c3..726085698053ecf8597d647248f7c405f864b0b2 100644 (file)
@@ -58,6 +58,36 @@ GeomAdaptor_SurfaceOfRevolution::GeomAdaptor_SurfaceOfRevolution(
   Load(V);
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor3d_Surface) GeomAdaptor_SurfaceOfRevolution::ShallowCopy() const
+{
+  Handle(GeomAdaptor_SurfaceOfRevolution) aCopy = new GeomAdaptor_SurfaceOfRevolution();
+
+  aCopy->myBasisCurve = myBasisCurve;
+  aCopy->myAxis       = myAxis;
+  aCopy->myHaveAxis   = myHaveAxis;
+  aCopy->myAxeRev     = myAxeRev;
+
+  aCopy->mySurface = mySurface;
+  aCopy->myUFirst = myUFirst;
+  aCopy->myULast = myULast;
+  aCopy->myVFirst = myVFirst;
+  aCopy->myVLast = myVLast;
+  aCopy->myTolU = myTolU;
+  aCopy->myTolV = myTolV;
+  aCopy->myBSplineSurface = myBSplineSurface;
+  aCopy->mySurfaceCache = mySurfaceCache;
+
+  aCopy->mySurfaceType = mySurfaceType;
+  aCopy->myNestedEvaluator = myNestedEvaluator;
+
+  return aCopy;
+}
+
 //=======================================================================
 //function : Load
 //purpose  : 
index a41b151871088eff00bbed44427616f5c50c0946..35485e9fb5c293b03de3dc6bf982bc2a35e96a0d 100644 (file)
@@ -65,6 +65,9 @@ public:
   
   //! The Curve and the Direction are loaded.
   Standard_EXPORT GeomAdaptor_SurfaceOfRevolution(const Handle(Adaptor3d_Curve)& C, const gp_Ax1& V);
+
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor3d_Surface) ShallowCopy() const Standard_OVERRIDE;
   
   //! Changes the Curve
   Standard_EXPORT void Load (const Handle(Adaptor3d_Curve)& C);
index 825758bff5d31efa110ad9e52a31afba17893454..28e802c2febe47d761aa1081c3082ce9163d2a86 100644 (file)
@@ -29,6 +29,18 @@ GeomFill_SnglrFunc::GeomFill_SnglrFunc(const Handle(Adaptor3d_Curve)& HC) :
 {
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor3d_Curve) GeomFill_SnglrFunc::ShallowCopy() const
+{
+  Handle(GeomFill_SnglrFunc) aCopy = new GeomFill_SnglrFunc(myHCurve);
+  aCopy->ratio = ratio;
+  return aCopy;
+}
+
 void GeomFill_SnglrFunc::SetRatio(const Standard_Real Ratio)
 {
   ratio = Ratio;
index 69d9f7df65d5ab1d775793fa41c8142d53962593..8cbfc726e658b96e36da6ed8dae8875aeab87348 100644 (file)
@@ -44,6 +44,9 @@ public:
 
   
   Standard_EXPORT GeomFill_SnglrFunc(const Handle(Adaptor3d_Curve)& HC);
+
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const Standard_OVERRIDE;
   
   Standard_EXPORT void SetRatio (const Standard_Real Ratio);
   
index 49c15ece7dd70f531bc7ecf766fcb65ea2798530..0500f58c4708e0bbb610d178bb9418f6f324634c 100644 (file)
@@ -631,6 +631,31 @@ ProjLib_CompProjectedCurve::ProjLib_CompProjectedCurve
   Init();
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor2d_Curve2d) ProjLib_CompProjectedCurve::ShallowCopy() const
+{
+  Handle(ProjLib_CompProjectedCurve) aCopy = new ProjLib_CompProjectedCurve();
+
+  aCopy->mySurface     = mySurface;
+  aCopy->myCurve       = myCurve;
+  aCopy->myNbCurves    = myNbCurves;
+  aCopy->mySequence    = mySequence;
+  aCopy->myTolU        = myTolU;
+  aCopy->myTolV        = myTolV;
+  aCopy->myMaxDist     = myMaxDist;
+  aCopy->myUIso        = myUIso;
+  aCopy->myVIso        = myVIso;
+  aCopy->mySnglPnts    = mySnglPnts;
+  aCopy->myMaxDistance = myMaxDistance;
+  aCopy->myTabInt      = myTabInt;
+
+  return aCopy;
+}
+
 //=======================================================================
 //function : Init
 //purpose  : 
index d086f7e6d2b4fb9429992318c44da38f5a521cb6..08386705212c270809e82d45f2217ac3ce6dc36c 100644 (file)
@@ -45,6 +45,9 @@ public:
   //! if MaxDist < 0 then algorithm works as above.
   Standard_EXPORT ProjLib_CompProjectedCurve(const Handle(Adaptor3d_Surface)& S, const Handle(Adaptor3d_Curve)& C, const Standard_Real TolU, const Standard_Real TolV, const Standard_Real MaxDist);
   
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor2d_Curve2d) ShallowCopy() const Standard_OVERRIDE;
+
   //! computes a set of projected point and determine the
   //! continuous parts of the projected  curves. The  points
   //! corresponding to a projection on the bounds of the surface are
index 1496e2848d6a1b7b01c5dd8882d05255dec0cf54..7da03167872d5acbae15af79476b132db4a7717b 100644 (file)
@@ -446,6 +446,29 @@ myIsApprox  (Standard_False)
 //  }
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor3d_Curve) ProjLib_ProjectOnPlane::ShallowCopy() const
+{
+  Handle(ProjLib_ProjectOnPlane) aCopy = new ProjLib_ProjectOnPlane();
+
+  aCopy->myCurve = myCurve;
+  aCopy->myPlane = myPlane;
+  aCopy->myDirection = myDirection;
+  aCopy->myKeepParam = myKeepParam;
+  aCopy->myFirstPar = myFirstPar;
+  aCopy->myLastPar = myLastPar;
+  aCopy->myTolerance = myTolerance;
+  aCopy->myType = myType;
+  aCopy->myResult = myResult;
+  aCopy->myIsApprox = myIsApprox;
+
+  return aCopy;
+}
+
 //=======================================================================
 //function : Project
 //purpose  : Returns the projection of a point <Point> on a plane 
index a9fb55bc1576647d9d63e5f17984fc724487979d..1fc5e228dc1bb15a627662589ff98523bc7c0206 100644 (file)
@@ -70,6 +70,9 @@ public:
   //! raises  if the direction  <D>  is parallel  to the
   //! plane <Pl>.
   Standard_EXPORT ProjLib_ProjectOnPlane(const gp_Ax3& Pl, const gp_Dir& D);
+
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const Standard_OVERRIDE;
   
   //! Sets the  Curve  and perform  the projection.
   //! if <KeepParametrization> is true, the parametrization
index f3617344e817376f9e061a2d30135ce4dd1ce513..64db5c578fa1ed0f8125bf6b9edbfeb1da04880e 100644 (file)
@@ -371,6 +371,27 @@ ProjLib_ProjectedCurve::ProjLib_ProjectedCurve
   Perform(C);
 }
 
+//=======================================================================
+//function : ShallowCopy
+//purpose  : 
+//=======================================================================
+
+Handle(Adaptor2d_Curve2d) ProjLib_ProjectedCurve::ShallowCopy() const
+{
+  Handle(ProjLib_ProjectedCurve) aCopy = new ProjLib_ProjectedCurve();
+
+  aCopy->myTolerance   = myTolerance;
+  aCopy->mySurface     = mySurface;
+  aCopy->myCurve       = myCurve;
+  aCopy->myResult      = myResult;
+  aCopy->myDegMin      = myDegMin;
+  aCopy->myDegMax      = myDegMax;
+  aCopy->myMaxSegments = myMaxSegments;
+  aCopy->myMaxDist     = myMaxDist;
+  aCopy->myBndPnt      = myBndPnt;
+
+  return aCopy;
+}
 
 //=======================================================================
 //function : Load
index 22e447ae5307b5df32bf13163d1594f70e7af73a..61587c468a00c962679fcb87d6db4e39c519d760 100644 (file)
@@ -67,6 +67,9 @@ public:
   //! If projecting uses approximation, 3d tolerance is Tol, default parameters are used, 
   Standard_EXPORT ProjLib_ProjectedCurve(const Handle(Adaptor3d_Surface)& S, const Handle(Adaptor3d_Curve)& C, const Standard_Real Tol);
   
+  //! Shallow copy of adaptor
+  Standard_EXPORT virtual Handle(Adaptor2d_Curve2d) ShallowCopy() const Standard_OVERRIDE;
+
   //! Changes the tolerance used to project
   //! the curve on the surface
   Standard_EXPORT void Load (const Standard_Real Tolerance);