// Copyright (c) 2015 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef _ShapePersistent_Geom2d_Curve_HeaderFile #define _ShapePersistent_Geom2d_Curve_HeaderFile #include #include #include #include #include #include #include #include #include #include #include #include class ShapePersistent_Geom2d_Curve : protected ShapePersistent_Geom2d { typedef Curve::PersistentBase pBase; typedef pBase pBounded; class pBezier : public pBounded { public: inline void Read (StdObjMgt_ReadData& theReadData) { theReadData >> myRational >> myPoles >> myWeights; } virtual Handle(Geom2d_Curve) Import() const; private: Standard_Boolean myRational; Handle(ShapePersistent_HArray1::Pnt2d) myPoles; Handle(StdLPersistent_HArray1::Real) myWeights; }; class pBSpline : public pBounded { public: inline void Read (StdObjMgt_ReadData& theReadData) { theReadData >> myRational >> myPeriodic >> mySpineDegree; theReadData >> myPoles >> myWeights >> myKnots >> myMultiplicities; } virtual Handle(Geom2d_Curve) Import() const; private: Standard_Boolean myRational; Standard_Boolean myPeriodic; Standard_Integer mySpineDegree; Handle(ShapePersistent_HArray1::Pnt2d) myPoles; Handle(StdLPersistent_HArray1::Real) myWeights; Handle(StdLPersistent_HArray1::Real) myKnots; Handle(StdLPersistent_HArray1::Integer) myMultiplicities; }; class pTrimmed : public pBounded { public: inline void Read (StdObjMgt_ReadData& theReadData) { theReadData >> myBasisCurve >> myFirstU >> myLastU; } virtual Handle(Geom2d_Curve) Import() const; private: Handle(Curve) myBasisCurve; Standard_Real myFirstU; Standard_Real myLastU; }; class pOffset : public pBase { public: inline void Read (StdObjMgt_ReadData& theReadData) { theReadData >> myBasisCurve >> myOffsetValue; } virtual Handle(Geom2d_Curve) Import() const; private: Handle(Curve) myBasisCurve; Standard_Real myOffsetValue; }; public: typedef instance Line; typedef subBase_gp Conic; typedef instance Circle; typedef instance Ellipse; typedef instance Hyperbola; typedef instance Parabola; typedef subBase_empty Bounded; typedef Delayed Bezier; typedef Delayed BSpline; typedef Delayed Trimmed; typedef Delayed Offset; }; #endif