0028564: Support of applications using old persistence (ShapeSchema)
[occt.git] / src / StdObject / StdObject_gp_Curves.hxx
index aef2e17..4ea0132 100644 (file)
@@ -31,7 +31,7 @@
 
 
 inline StdObjMgt_ReadData& operator >>
-  (StdObjMgt_ReadData::Object theReadData, gp_Lin2d& theLin)
+  (StdObjMgt_ReadData& theReadData, gp_Lin2d& theLin)
 {
   gp_Ax2d anAx;
   theReadData >> anAx;
@@ -39,8 +39,16 @@ inline StdObjMgt_ReadData& operator >>
   return theReadData;
 }
 
+inline StdObjMgt_WriteData& operator <<
+  (StdObjMgt_WriteData& theWriteData, const gp_Lin2d& theLin)
+{
+  const gp_Ax2d& anAx = theLin.Position();
+  write (theWriteData, anAx);
+  return theWriteData;
+}
+
 inline StdObjMgt_ReadData& operator >>
-  (StdObjMgt_ReadData::Object theReadData, gp_Circ2d& theCirc)
+  (StdObjMgt_ReadData& theReadData, gp_Circ2d& theCirc)
 {
   gp_Ax22d anAx;
   Standard_Real aRadius;
@@ -53,8 +61,17 @@ inline StdObjMgt_ReadData& operator >>
   return theReadData;
 }
 
+inline StdObjMgt_WriteData& operator <<
+  (StdObjMgt_WriteData& theWriteData, const gp_Circ2d& theCirc)
+{
+  const gp_Ax22d& anAx = theCirc.Position();
+  Standard_Real aRadius = theCirc.Radius();
+  theWriteData << anAx << aRadius;
+  return theWriteData;
+}
+
 inline StdObjMgt_ReadData& operator >>
-  (StdObjMgt_ReadData::Object theReadData, gp_Elips2d& theElips)
+  (StdObjMgt_ReadData& theReadData, gp_Elips2d& theElips)
 {
   gp_Ax22d anAx;
   Standard_Real aMajorRadius, aMinorRadius;
@@ -68,8 +85,18 @@ inline StdObjMgt_ReadData& operator >>
   return theReadData;
 }
 
+inline StdObjMgt_WriteData& operator <<
+  (StdObjMgt_WriteData& theWriteData, const gp_Elips2d& theElips)
+{
+  const gp_Ax22d& anAx = theElips.Axis();
+  Standard_Real aMajorRadius = theElips.MajorRadius();
+  Standard_Real aMinorRadius = theElips.MinorRadius();
+  theWriteData << anAx << aMajorRadius << aMinorRadius;
+  return theWriteData;
+}
+
 inline StdObjMgt_ReadData& operator >>
-  (StdObjMgt_ReadData::Object theReadData, gp_Hypr2d& theHypr)
+  (StdObjMgt_ReadData& theReadData, gp_Hypr2d& theHypr)
 {
   gp_Ax22d anAx;
   Standard_Real aMajorRadius, aMinorRadius;
@@ -83,8 +110,18 @@ inline StdObjMgt_ReadData& operator >>
   return theReadData;
 }
 
+inline StdObjMgt_WriteData& operator <<
+  (StdObjMgt_WriteData& theWriteData, const gp_Hypr2d& theHypr)
+{
+  const gp_Ax22d& anAx = theHypr.Axis();
+  Standard_Real aMajorRadius = theHypr.MajorRadius();
+  Standard_Real aMinorRadius = theHypr.MinorRadius();
+  theWriteData << anAx << aMajorRadius << aMinorRadius;
+  return theWriteData;
+}
+
 inline StdObjMgt_ReadData& operator >>
-  (StdObjMgt_ReadData::Object theReadData, gp_Parab2d& theParab)
+  (StdObjMgt_ReadData& theReadData, gp_Parab2d& theParab)
 {
   gp_Ax22d anAx;
   Standard_Real aFocalLength;
@@ -97,8 +134,17 @@ inline StdObjMgt_ReadData& operator >>
   return theReadData;
 }
 
+inline StdObjMgt_WriteData& operator <<
+  (StdObjMgt_WriteData& theWriteData, const gp_Parab2d& theParab)
+{
+  const gp_Ax22d& anAx = theParab.Axis();
+  Standard_Real aFocalLength = theParab.Focal();
+  theWriteData << anAx << aFocalLength;
+  return theWriteData;
+}
+
 inline StdObjMgt_ReadData& operator >>
-  (StdObjMgt_ReadData::Object theReadData, gp_Lin& theLin)
+  (StdObjMgt_ReadData& theReadData, gp_Lin& theLin)
 {
   gp_Ax1 anAx;
   theReadData >> anAx;
@@ -106,8 +152,16 @@ inline StdObjMgt_ReadData& operator >>
   return theReadData;
 }
 
+inline StdObjMgt_WriteData& operator <<
+  (StdObjMgt_WriteData& theWriteData, const gp_Lin& theLin)
+{
+  const gp_Ax1& anAx = theLin.Position();
+  write (theWriteData, anAx);
+  return theWriteData;
+}
+
 inline StdObjMgt_ReadData& operator >>
-  (StdObjMgt_ReadData::Object theReadData, gp_Circ& theCirc)
+  (StdObjMgt_ReadData& theReadData, gp_Circ& theCirc)
 {
   gp_Ax2 anAx;
   Standard_Real aRadius;
@@ -120,8 +174,17 @@ inline StdObjMgt_ReadData& operator >>
   return theReadData;
 }
 
+inline StdObjMgt_WriteData& operator <<
+  (StdObjMgt_WriteData& theWriteData, const gp_Circ& theCirc)
+{
+  const gp_Ax2& anAx = theCirc.Position();
+  Standard_Real aRadius = theCirc.Radius();
+  theWriteData << anAx << aRadius;
+  return theWriteData;
+}
+
 inline StdObjMgt_ReadData& operator >>
-  (StdObjMgt_ReadData::Object theReadData, gp_Elips& theElips)
+  (StdObjMgt_ReadData& theReadData, gp_Elips& theElips)
 {
   gp_Ax2 anAx;
   Standard_Real aMajorRadius, aMinorRadius;
@@ -135,8 +198,18 @@ inline StdObjMgt_ReadData& operator >>
   return theReadData;
 }
 
+inline StdObjMgt_WriteData& operator <<
+  (StdObjMgt_WriteData& theWriteData, const gp_Elips& theElips)
+{
+  const gp_Ax2& anAx = theElips.Position();
+  Standard_Real aMajorRadius = theElips.MajorRadius();
+  Standard_Real aMinorRadius = theElips.MinorRadius();
+  theWriteData << anAx << aMajorRadius << aMinorRadius;
+  return theWriteData;
+}
+
 inline StdObjMgt_ReadData& operator >>
-  (StdObjMgt_ReadData::Object theReadData, gp_Hypr& theHypr)
+  (StdObjMgt_ReadData& theReadData, gp_Hypr& theHypr)
 {
   gp_Ax2 anAx;
   Standard_Real aMajorRadius, aMinorRadius;
@@ -150,8 +223,18 @@ inline StdObjMgt_ReadData& operator >>
   return theReadData;
 }
 
+inline StdObjMgt_WriteData& operator <<
+  (StdObjMgt_WriteData& theWriteData, const gp_Hypr& theHypr)
+{
+  const gp_Ax2& anAx = theHypr.Position();
+  Standard_Real aMajorRadius = theHypr.MajorRadius();
+  Standard_Real aMinorRadius = theHypr.MinorRadius();
+  theWriteData << anAx << aMajorRadius << aMinorRadius;
+  return theWriteData;
+}
+
 inline StdObjMgt_ReadData& operator >>
-  (StdObjMgt_ReadData::Object theReadData, gp_Parab& theParab)
+  (StdObjMgt_ReadData& theReadData, gp_Parab& theParab)
 {
   gp_Ax2 anAx;
   Standard_Real aFocalLength;
@@ -164,5 +247,14 @@ inline StdObjMgt_ReadData& operator >>
   return theReadData;
 }
 
+inline StdObjMgt_WriteData& operator <<
+(StdObjMgt_WriteData& theWriteData, const gp_Parab& theParab)
+{
+  const gp_Ax2& anAx = theParab.Position();
+  Standard_Real aFocalLength = theParab.Focal();
+  theWriteData << anAx << aFocalLength;
+  return theWriteData;
+}
+
 
 #endif