Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-03 09:17:29

0001 // Copyright (c) 2015 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _ShapePersistent_Geom2d_HeaderFile
0015 #define _ShapePersistent_Geom2d_HeaderFile
0016 
0017 #include <ShapePersistent_Geom.hxx>
0018 
0019 #include <Geom2d_CartesianPoint.hxx>
0020 #include <Geom2d_Direction.hxx>
0021 #include <Geom2d_VectorWithMagnitude.hxx>
0022 #include <Geom2d_AxisPlacement.hxx>
0023 #include <Geom2d_Transformation.hxx>
0024 #include <Geom2d_Curve.hxx>
0025 
0026 class ShapePersistent_Geom2d : public ShapePersistent_Geom
0027 {
0028   typedef geometryBase<Geom2d_Geometry> basic;
0029 
0030 public:
0031   typedef ShapePersistent_Geom::Geometry Geometry;
0032 
0033   typedef subBase_empty<basic>                             Point;
0034   typedef instance<Point, Geom2d_CartesianPoint, gp_Pnt2d> CartesianPoint;
0035 
0036   typedef subBase_gp<basic, gp_Vec2d>                            Vector;
0037   typedef instance<Vector, Geom2d_Direction, gp_Dir2d>           Direction;
0038   typedef instance<Vector, Geom2d_VectorWithMagnitude, gp_Vec2d> VectorWithMagnitude;
0039 
0040   typedef instance<basic, Geom2d_AxisPlacement, gp_Ax2d> AxisPlacement;
0041 
0042   typedef instance<SharedBase<Geom2d_Transformation>, Geom2d_Transformation, gp_Trsf2d>
0043     Transformation;
0044 
0045   typedef geometryBase<Geom2d_Curve> Curve;
0046 
0047 public:
0048   //! Create a persistent object for a curve
0049   Standard_EXPORT static occ::handle<Curve> Translate(
0050     const occ::handle<Geom2d_Curve>& theCurve,
0051     NCollection_DataMap<occ::handle<Standard_Transient>, occ::handle<StdObjMgt_Persistent>>&
0052       theMap);
0053 };
0054 
0055 //=======================================================================
0056 // Geometry
0057 //=======================================================================
0058 template <>
0059 inline const char* ShapePersistent_Geom::geometryBase<Geom2d_Geometry>::PName() const
0060 {
0061   return "PGeom2d_Geometry";
0062 }
0063 
0064 //=======================================================================
0065 // Point
0066 //=======================================================================
0067 template <>
0068 inline const char* ShapePersistent_Geom::subBase_empty<
0069   ShapePersistent_Geom2d::geometryBase<Geom2d_Geometry>>::PName() const
0070 {
0071   return "PGeom2d_Point";
0072 }
0073 
0074 //=======================================================================
0075 // CartesianPoint
0076 //=======================================================================
0077 template <>
0078 inline const char* ShapePersistent_Geom::
0079   instance<ShapePersistent_Geom2d::Point, Geom2d_CartesianPoint, gp_Pnt2d>::PName() const
0080 {
0081   return "PGeom2d_CartesianPoint";
0082 }
0083 
0084 template <>
0085 inline void ShapePersistent_Geom::instance<ShapePersistent_Geom2d::Point,
0086                                            Geom2d_CartesianPoint,
0087                                            gp_Pnt2d>::Write(StdObjMgt_WriteData& theWriteData) const
0088 {
0089   occ::handle<Geom2d_CartesianPoint> aMyGeom = occ::down_cast<Geom2d_CartesianPoint>(myTransient);
0090   theWriteData << aMyGeom->Pnt2d();
0091 }
0092 
0093 //=======================================================================
0094 // Direction
0095 //=======================================================================
0096 template <>
0097 const char* ShapePersistent_Geom::
0098   instance<ShapePersistent_Geom2d::Direction, Geom2d_Direction, gp_Dir2d>::PName() const;
0099 
0100 template <>
0101 void ShapePersistent_Geom::instance<ShapePersistent_Geom2d::Direction, Geom2d_Direction, gp_Dir2d>::
0102   Write(StdObjMgt_WriteData& theWriteData) const;
0103 
0104 //=======================================================================
0105 // VectorWithMagnitude
0106 //=======================================================================
0107 template <>
0108 const char* ShapePersistent_Geom::instance<ShapePersistent_Geom2d::VectorWithMagnitude,
0109                                            Geom2d_VectorWithMagnitude,
0110                                            gp_Vec2d>::PName() const;
0111 
0112 template <>
0113 void ShapePersistent_Geom::instance<ShapePersistent_Geom2d::VectorWithMagnitude,
0114                                     Geom2d_VectorWithMagnitude,
0115                                     gp_Vec2d>::Write(StdObjMgt_WriteData& theWriteData) const;
0116 
0117 //=======================================================================
0118 // AxisPlacement
0119 //=======================================================================
0120 template <>
0121 const char* ShapePersistent_Geom::
0122   instance<ShapePersistent_Geom2d::AxisPlacement, Geom2d_AxisPlacement, gp_Ax2d>::PName() const;
0123 
0124 template <>
0125 void ShapePersistent_Geom::instance<ShapePersistent_Geom2d::AxisPlacement,
0126                                     Geom2d_AxisPlacement,
0127                                     gp_Ax2d>::Write(StdObjMgt_WriteData& theWriteData) const;
0128 
0129 //=======================================================================
0130 // Transformation
0131 //=======================================================================
0132 template <>
0133 const char* ShapePersistent_Geom::
0134   instance<ShapePersistent_Geom2d::Transformation, Geom2d_Transformation, gp_Trsf2d>::PName() const;
0135 
0136 template <>
0137 void ShapePersistent_Geom::
0138   instance<ShapePersistent_Geom2d::Transformation, Geom2d_Transformation, gp_Trsf2d>::PChildren(
0139     StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const;
0140 
0141 template <>
0142 void ShapePersistent_Geom::instance<ShapePersistent_Geom2d::Transformation,
0143                                     Geom2d_Transformation,
0144                                     gp_Trsf2d>::Write(StdObjMgt_WriteData& theWriteData) const;
0145 
0146 //=======================================================================
0147 // Curve
0148 //=======================================================================
0149 template <>
0150 inline const char* ShapePersistent_Geom::geometryBase<Geom2d_Curve>::PName() const
0151 {
0152   return "PGeom2d_Curve";
0153 }
0154 
0155 #endif