diff -uprN BinTools/BinTools.cxx "BinTools - patch/BinTools.cxx"
--- BinTools/BinTools.cxx	2022-02-01 21:05:58.000000000 +0900
+++ "BinTools - patch/BinTools.cxx"	2022-04-13 12:08:25.418744000 +0900
@@ -14,6 +14,14 @@
 // commercial license or contractual agreement.
 
 
+#include <gp_Pnt2d.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Dir2d.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Ax1.hxx>
+#include <gp_Ax22d.hxx>
+#include <gp_Ax2.hxx>
+#include <gp_Ax3.hxx>
 #include <BinTools.hxx>
 #include <BinTools_ShapeSet.hxx>
 #include <FSD_FileHeader.hxx>
@@ -169,6 +177,189 @@ Standard_IStream& BinTools::GetBool(Stan
   return IS;
 }
 
+//=======================================================================
+//function : GetPnt2d
+//purpose  : 
+//=======================================================================
+
+Standard_IStream& BinTools::GetPnt2d(Standard_IStream& IS, gp_Pnt2d& theValue)
+{
+  Standard_Real X=0.,Y=0.;
+  BinTools::GetReal(IS, X);
+  BinTools::GetReal(IS, Y);
+  theValue.SetCoord(X,Y);
+  return IS;
+}
+
+//=======================================================================
+//function : GetPnt
+//purpose  : 
+//=======================================================================
+
+Standard_IStream& BinTools::GetPnt(Standard_IStream& IS, gp_Pnt& theValue)
+{
+  Standard_Real X=0.,Y=0.,Z=0.;
+  BinTools::GetReal(IS, X);
+  BinTools::GetReal(IS, Y);
+  BinTools::GetReal(IS, Z);
+  theValue.SetCoord(X,Y,Z);
+  return IS;
+}
+
+//=======================================================================
+//function : GetDir2d
+//purpose  : 
+//=======================================================================
+
+static Standard_Boolean Check(const gp_Dir2d& D, Standard_Real X, Standard_Real Y)
+{
+  return gp_Vec2d(D.XY()).Angle(gp_Vec2d(X,Y)) <= gp::Resolution();
+}
+
+static Standard_Boolean Check(const gp_Dir2d& D, const gp_Dir2d& D2)
+{
+  return gp_Vec2d(D.XY()).Angle(gp_Vec2d(D2.XY())) <= gp::Resolution();
+}
+
+Standard_IStream& BinTools::GetDir2d(Standard_IStream& IS, gp_Dir2d& theValue)
+{
+  Standard_Real X=0.,Y=0.;
+  BinTools::GetReal(IS, X);
+  BinTools::GetReal(IS, Y);
+  theValue.SetCoord(X,Y);
+  if (Check(theValue, X, Y))
+  {
+    const_cast<gp_XY&>(theValue.XY()).SetCoord(X, Y);
+  }
+  return IS;
+}
+
+//=======================================================================
+//function : GetDir
+//purpose  : 
+//=======================================================================
+
+static Standard_Boolean Check(const gp_Dir& D, Standard_Real X, Standard_Real Y, Standard_Real Z)
+{
+  return gp_Vec(D.XYZ()).Angle(gp_Vec(X,Y,Z)) <= gp::Resolution();
+}
+
+static Standard_Boolean Check(const gp_Dir& D, const gp_Dir& D2)
+{
+  return gp_Vec(D.XYZ()).Angle(gp_Vec(D2.XYZ())) <= gp::Resolution();
+}
+
+Standard_IStream& BinTools::GetDir(Standard_IStream& IS, gp_Dir& theValue)
+{
+  Standard_Real X=0.,Y=0.,Z=0.;
+  BinTools::GetReal(IS, X);
+  BinTools::GetReal(IS, Y);
+  BinTools::GetReal(IS, Z);
+  theValue.SetCoord(X,Y,Z);
+  if (Check(theValue, X, Y, Z))
+  {
+    const_cast<gp_XYZ&>(theValue.XYZ()).SetCoord(X, Y, Z);
+  }
+  return IS;
+}
+
+//=======================================================================
+//function : GetAx1
+//purpose  : 
+//=======================================================================
+
+Standard_IStream& BinTools::GetAx1(Standard_IStream& IS, gp_Ax1& theValue)
+{
+  gp_Pnt P(0.,0.,0.);
+  gp_Dir D(1.,0.,0.);
+  BinTools::GetPnt(IS, P);
+  BinTools::GetDir(IS, D);
+  gp_Ax1 ax1(P,D);
+  if (Check(ax1.Direction(), D))
+  {
+    const_cast<gp_XYZ&>(ax1.Direction().XYZ()) = D.XYZ();
+  }
+  theValue = ax1;
+  return IS;
+}
+
+//=======================================================================
+//function : GetAx22d
+//purpose  : 
+//=======================================================================
+
+Standard_IStream& BinTools::GetAx22d(Standard_IStream& IS, gp_Ax22d& theValue)
+{
+  gp_Pnt2d P(0.,0.);
+  gp_Dir2d AX(1.,0.),AY(1.,0.);
+  BinTools::GetPnt2d(IS, P);
+  BinTools::GetDir2d(IS, AX);
+  BinTools::GetDir2d(IS, AY);
+  gp_Ax22d ax2(P,AX,AY);
+  if (Check(ax2.XDirection(), AX) &&
+      Check(ax2.YDirection(), AY))
+  {
+    const_cast<gp_XY&>(ax2.XDirection().XY()) = AX.XY();
+    const_cast<gp_XY&>(ax2.YDirection().XY()) = AY.XY();
+  }
+  theValue = ax2;
+  return IS;
+}
+
+//=======================================================================
+//function : GetAx2
+//purpose  : 
+//=======================================================================
+
+Standard_IStream& BinTools::GetAx2(Standard_IStream& IS, gp_Ax2& theValue)
+{
+  gp_Pnt P(0.,0.,0.);
+  gp_Dir A(1.,0.,0.),AX(1.,0.,0.),AY(1.,0.,0.);
+  BinTools::GetPnt(IS, P);
+  BinTools::GetDir(IS, A);
+  BinTools::GetDir(IS, AX);
+  BinTools::GetDir(IS, AY);
+  gp_Ax2 ax2(P,A,AX);
+  if (Check(ax2.Direction(), A) &&
+      Check(ax2.XDirection(), AX) &&
+      Check(ax2.YDirection(), AY))
+  {
+    const_cast<gp_XYZ&>(ax2.Direction().XYZ()) = A.XYZ();
+    const_cast<gp_XYZ&>(ax2.XDirection().XYZ()) = AX.XYZ();
+    const_cast<gp_XYZ&>(ax2.YDirection().XYZ()) = AY.XYZ();
+  }
+  theValue = ax2;
+  return IS;
+}
+
+//=======================================================================
+//function : GetAx3
+//purpose  : 
+//=======================================================================
+
+Standard_IStream& BinTools::GetAx3(Standard_IStream& IS, gp_Ax3& theValue)
+{
+  gp_Pnt P(0.,0.,0.);
+  gp_Dir A(1.,0.,0.),AX(1.,0.,0.),AY(1.,0.,0.);
+  BinTools::GetPnt(IS, P);
+  BinTools::GetDir(IS, A);
+  BinTools::GetDir(IS, AX);
+  BinTools::GetDir(IS, AY);
+  gp_Ax3 ax3(P,A,AX);
+  if (Check(ax3.Direction(), A) &&
+      Check(ax3.XDirection(), AX) &&
+      Check(ax3.YDirection(), AY))
+  {
+    const_cast<gp_XYZ&>(ax3.Direction().XYZ()) = A.XYZ();
+    const_cast<gp_XYZ&>(ax3.XDirection().XYZ()) = AX.XYZ();
+    const_cast<gp_XYZ&>(ax3.YDirection().XYZ()) = AY.XYZ();
+  }
+  if (AY.DotCross(A,AX) < 0)
+    ax3.YReverse();
+  theValue = ax3;
+  return IS;
+}
+
 //=======================================================================
 //function : Write
 //purpose  :
diff -uprN BinTools/BinTools.hxx "BinTools - patch/BinTools.hxx"
--- BinTools/BinTools.hxx	2022-02-01 21:05:58.000000000 +0900
+++ "BinTools - patch/BinTools.hxx"	2022-04-13 12:07:05.490773300 +0900
@@ -29,6 +29,14 @@
 #include <Standard_IStream.hxx>
 #include <Message_ProgressRange.hxx>
 
+class gp_Pnt2d;
+class gp_Pnt;
+class gp_Dir2d;
+class gp_Dir;
+class gp_Ax1;
+class gp_Ax22d;
+class gp_Ax2;
+class gp_Ax3;
 class TopoDS_Shape;
 
 
@@ -58,6 +66,22 @@ public:
   Standard_EXPORT static Standard_IStream& GetBool (Standard_IStream& IS, Standard_Boolean& theValue);
   
   Standard_EXPORT static Standard_IStream& GetExtChar (Standard_IStream& IS, Standard_ExtCharacter& theValue);
+  
+  Standard_EXPORT static Standard_IStream& GetPnt2d(Standard_IStream& IS, gp_Pnt2d& theValue);
+  
+  Standard_EXPORT static Standard_IStream& GetPnt(Standard_IStream& IS, gp_Pnt& theValue);
+  
+  Standard_EXPORT static Standard_IStream& GetDir2d(Standard_IStream& IS, gp_Dir2d& theValue);
+  
+  Standard_EXPORT static Standard_IStream& GetDir(Standard_IStream& IS, gp_Dir& theValue);
+  
+  Standard_EXPORT static Standard_IStream& GetAx1(Standard_IStream& IS, gp_Ax1& theValue);
+  
+  Standard_EXPORT static Standard_IStream& GetAx22d(Standard_IStream& IS, gp_Ax22d& theValue);
+  
+  Standard_EXPORT static Standard_IStream& GetAx2(Standard_IStream& IS, gp_Ax2& theValue);
+  
+  Standard_EXPORT static Standard_IStream& GetAx3(Standard_IStream& IS, gp_Ax3& theValue);
 
   //! Writes the shape to the stream in binary format BinTools_FormatVersion_CURRENT.
   //! This alias writes shape with triangulation data.
diff -uprN BinTools/BinTools_Curve2dSet.cxx "BinTools - patch/BinTools_Curve2dSet.cxx"
--- BinTools/BinTools_Curve2dSet.cxx	2022-02-01 21:05:58.000000000 +0900
+++ "BinTools - patch/BinTools_Curve2dSet.cxx"	2022-04-13 12:13:37.656615000 +0900
@@ -337,35 +337,6 @@ void  BinTools_Curve2dSet::Write (Standa
 
 
 //=======================================================================
-//function : ReadPnt2d
-//purpose  : 
-//=======================================================================
-
-static Standard_IStream& operator>>(Standard_IStream& IS, gp_Pnt2d& P)
-{
-  Standard_Real X=0.,Y=0.;
-  BinTools::GetReal(IS, X);
-  BinTools::GetReal(IS, Y);
-  P.SetCoord(X,Y);
-  return IS;
-}
-
-//=======================================================================
-//function : ReadDir2d
-//purpose  : 
-//=======================================================================
-
-static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir2d& D)
-{
-  Standard_Real X=0.,Y=0.;
-  BinTools::GetReal(IS, X);
-  BinTools::GetReal(IS, Y);
-  D.SetCoord(X,Y);
-  return IS;
-}
-
-
-//=======================================================================
 //function : ReadCurve2d
 //purpose  : 
 //=======================================================================
@@ -375,7 +346,8 @@ static Standard_IStream& operator>>(Stan
 {
   gp_Pnt2d P(0.,0.);
   gp_Dir2d AX(1.,0.);
-  IS >> P >> AX;
+  BinTools::GetPnt2d(IS, P);
+  BinTools::GetDir2d(IS, AX);
   L = new Geom2d_Line(P,AX);
   return IS;
 }
@@ -387,12 +359,11 @@ static Standard_IStream& operator>>(Stan
 static Standard_IStream& operator>>(Standard_IStream& IS,
 				    Handle(Geom2d_Circle)& C)
 {
-  gp_Pnt2d P(0.,0.);
-  gp_Dir2d AX(1.,0.),AY(1.,0.);
+  gp_Ax22d A(gp_Pnt2d(0.,0.), gp_Dir2d(1.,0.), gp_Dir2d(1.,0.));
   Standard_Real R=0.;
-  IS >> P >> AX >> AY;
+  BinTools::GetAx22d(IS, A);
   BinTools::GetReal(IS, R);
-  C = new Geom2d_Circle(gp_Ax22d(P,AX,AY),R);
+  C = new Geom2d_Circle(A,R);
   return IS;
 }
 
@@ -404,13 +375,12 @@ static Standard_IStream& operator>>(Stan
 static Standard_IStream& operator>>(Standard_IStream& IS,
 				    Handle(Geom2d_Ellipse)& E)
 {
-  gp_Pnt2d P(0.,0.);
-  gp_Dir2d AX(1.,0.),AY(1.,0.);
+  gp_Ax22d A(gp_Pnt2d(0.,0.), gp_Dir2d(1.,0.), gp_Dir2d(1.,0.));
   Standard_Real R1=0., R2=0.;
-  IS >> P >> AX >> AY;
+  BinTools::GetAx22d(IS, A);
   BinTools::GetReal(IS, R1);
   BinTools::GetReal(IS, R2);
-  E = new Geom2d_Ellipse(gp_Ax22d(P,AX,AY),R1,R2);
+  E = new Geom2d_Ellipse(A,R1,R2);
   return IS;
 }
 
@@ -422,12 +392,11 @@ static Standard_IStream& operator>>(Stan
 static Standard_IStream& operator>>(Standard_IStream& IS,
 				    Handle(Geom2d_Parabola)& C)
 {
-  gp_Pnt2d P(0.,0.);
-  gp_Dir2d AX(1.,0.),AY(1.,0.);
+  gp_Ax22d A(gp_Pnt2d(0.,0.), gp_Dir2d(1.,0.), gp_Dir2d(1.,0.));
   Standard_Real R1=0.;
-  IS >> P >> AX >> AY;
+  BinTools::GetAx22d(IS, A);
   BinTools::GetReal(IS, R1);
-  C = new Geom2d_Parabola(gp_Ax22d(P,AX,AY),R1);
+  C = new Geom2d_Parabola(A,R1);
   return IS;
 }
 
@@ -439,13 +408,12 @@ static Standard_IStream& operator>>(Stan
 static Standard_IStream& operator>>(Standard_IStream& IS,
 				    Handle(Geom2d_Hyperbola)& H)
 {
-  gp_Pnt2d P(0.,0.);
-  gp_Dir2d AX(1.,0.),AY(1.,0.);
+  gp_Ax22d A(gp_Pnt2d(0.,0.), gp_Dir2d(1.,0.), gp_Dir2d(1.,0.));
   Standard_Real R1=0.,R2=0.;
-  IS >> P >> AX >> AY;
+  BinTools::GetAx22d(IS, A);
   BinTools::GetReal(IS, R1);
   BinTools::GetReal(IS, R2);
-  H = new Geom2d_Hyperbola(gp_Ax22d(P,AX,AY),R1,R2);
+  H = new Geom2d_Hyperbola(A,R1,R2);
   return IS;
 }
 
@@ -471,7 +439,7 @@ static Standard_IStream& operator>>(Stan
   TColStd_Array1OfReal weights(1,degree+1);
   
   for (i = 1; i <= degree+1; i++) {
-    IS >> poles(i);//Pnt2d
+    BinTools::GetPnt2d(IS, poles(i));
     if (rational)
       BinTools::GetReal(IS, weights(i));
   }
@@ -511,7 +479,7 @@ static Standard_IStream& operator>>(Stan
   TColStd_Array1OfReal weights(1,nbpoles);
   
   for (i = 1; i <= nbpoles; i++) {
-    IS >> poles(i);//Pnt2d
+    BinTools::GetPnt2d(IS, poles(i));
     if (rational)
       BinTools::GetReal(IS, weights(i));
   }
diff -uprN BinTools/BinTools_CurveSet.cxx "BinTools - patch/BinTools_CurveSet.cxx"
--- BinTools/BinTools_CurveSet.cxx	2022-02-01 21:05:58.000000000 +0900
+++ "BinTools - patch/BinTools_CurveSet.cxx"	2022-04-13 12:14:48.279355900 +0900
@@ -346,37 +346,6 @@ void  BinTools_CurveSet::Write (Standard
 
 
 //=======================================================================
-//function : ReadPnt
-//purpose  : 
-//=======================================================================
-
-static Standard_IStream& operator>>(Standard_IStream& IS, gp_Pnt& P)
-{
-  Standard_Real X=0.,Y=0.,Z=0.;
-  BinTools::GetReal(IS, X);
-  BinTools::GetReal(IS, Y);
-  BinTools::GetReal(IS, Z);
-  P.SetCoord(X,Y,Z);
-  return IS;
-}
-
-//=======================================================================
-//function : ReadDir
-//purpose  : 
-//=======================================================================
-
-static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir& D)
-{
-  Standard_Real X=0.,Y=0.,Z=0.;
-  BinTools::GetReal(IS, X);
-  BinTools::GetReal(IS, Y);
-  BinTools::GetReal(IS, Z);
-  D.SetCoord(X,Y,Z);
-  return IS;
-}
-
-
-//=======================================================================
 //function : ReadCurve
 //purpose  : 
 //=======================================================================
@@ -386,7 +355,8 @@ static Standard_IStream& operator>>(Stan
 {
   gp_Pnt P(0.,0.,0.);
   gp_Dir AX(1.,0.,0.);
-  IS >> P >> AX;
+  BinTools::GetPnt(IS, P);
+  BinTools::GetDir(IS, AX);
   L = new Geom_Line(P,AX);
   return IS;
 }
@@ -399,12 +369,11 @@ static Standard_IStream& operator>>(Stan
 static Standard_IStream& operator>>(Standard_IStream& IS,
 				    Handle(Geom_Circle)& C)
 {
-  gp_Pnt P(0.,0.,0.);
-  gp_Dir A(1.,0.,0.),AX(1.,0.,0.),AY(1.,0.,0.);
+  gp_Ax2 A(gp_Pnt(0.,0.,0.), gp_Dir(1.,0.,0.), gp_Dir(1.,0.,0.));
   Standard_Real R=0.;
-  IS >> P >> A >> AX >> AY;
+  BinTools::GetAx2(IS, A);
   BinTools::GetReal(IS, R);
-  C = new Geom_Circle(gp_Ax2(P,A,AX),R);
+  C = new Geom_Circle(A,R);
   return IS;
 }
 
@@ -416,13 +385,12 @@ static Standard_IStream& operator>>(Stan
 static Standard_IStream& operator>>(Standard_IStream& IS,
 				    Handle(Geom_Ellipse)& E)
 {
-  gp_Pnt P(0.,0.,0.);
-  gp_Dir A(1.,0.,0.),AX(1.,0.,0.),AY(1.,0.,0.);
+  gp_Ax2 A(gp_Pnt(0.,0.,0.), gp_Dir(1.,0.,0.), gp_Dir(1.,0.,0.));
   Standard_Real R1=0.,R2=0.;
-  IS >> P >> A >> AX >> AY;
+  BinTools::GetAx2(IS, A);
   BinTools::GetReal(IS, R1);
   BinTools::GetReal(IS, R2);
-  E = new Geom_Ellipse(gp_Ax2(P,A,AX),R1,R2);
+  E = new Geom_Ellipse(A,R1,R2);
   return IS;
 }
 
@@ -434,12 +402,11 @@ static Standard_IStream& operator>>(Stan
 static Standard_IStream& operator>>(Standard_IStream& IS,
 				    Handle(Geom_Parabola)& C)
 {
-  gp_Pnt P(0.,0.,0.);
-  gp_Dir A(1.,0.,0.),AX(1.,0.,0.),AY(1.,0.,0.);
+  gp_Ax2 A(gp_Pnt(0.,0.,0.), gp_Dir(1.,0.,0.), gp_Dir(1.,0.,0.));
   Standard_Real R1=0.;
-  IS >> P >> A >> AX >> AY;
+  BinTools::GetAx2(IS, A);
   BinTools::GetReal(IS, R1);
-  C = new Geom_Parabola(gp_Ax2(P,A,AX),R1);
+  C = new Geom_Parabola(A,R1);
   return IS;
 }
 
@@ -451,13 +418,12 @@ static Standard_IStream& operator>>(Stan
 static Standard_IStream& operator>>(Standard_IStream& IS,
 				    Handle(Geom_Hyperbola)& H)
 {
-  gp_Pnt P(0.,0.,0.);
-  gp_Dir A(1.,0.,0.),AX(1.,0.,0.),AY(1.,0.,0);
+  gp_Ax2 A(gp_Pnt(0.,0.,0.), gp_Dir(1.,0.,0.), gp_Dir(1.,0.,0.));
   Standard_Real R1=0.,R2=0.;
-  IS >> P >> A >> AX >> AY;
+  BinTools::GetAx2(IS, A);
   BinTools::GetReal(IS, R1);
   BinTools::GetReal(IS, R2);
-  H = new Geom_Hyperbola(gp_Ax2(P,A,AX),R1,R2);
+  H = new Geom_Hyperbola(A,R1,R2);
   return IS;
 }
 
@@ -483,7 +449,7 @@ static Standard_IStream& operator>>(Stan
   TColStd_Array1OfReal weights(1,degree+1);
   
   for (i = 1; i <= degree+1; i++) {
-    IS >> poles(i);//Pnt
+    BinTools::GetPnt(IS, poles(i));
     if (rational)
 // weights(i);
       BinTools::GetReal(IS, weights(i));
@@ -524,7 +490,7 @@ static Standard_IStream& operator>>(Stan
   TColStd_Array1OfReal weights(1,nbpoles);
   
   for (i = 1; i <= nbpoles; i++) {
-    IS >> poles(i);//Pnt
+    BinTools::GetPnt(IS, poles(i));
     if (rational)
       BinTools::GetReal(IS, weights(i));
   }
@@ -573,7 +539,7 @@ static Standard_IStream& operator>>(Stan
   Standard_Real p=0.;
   BinTools::GetReal(IS, p);//Offset
   gp_Dir D(1.,0.,0.);
-  IS >> D;
+  BinTools::GetDir(IS, D);
   Handle(Geom_Curve) BC;
   BinTools_CurveSet::ReadCurve(IS,BC);
   C = new Geom_OffsetCurve(BC,p,D);
diff -uprN BinTools/BinTools_SurfaceSet.cxx "BinTools - patch/BinTools_SurfaceSet.cxx"
--- BinTools/BinTools_SurfaceSet.cxx	2022-02-01 21:05:58.000000000 +0900
+++ "BinTools - patch/BinTools_SurfaceSet.cxx"	2022-04-13 11:43:45.702307400 +0900
@@ -421,54 +421,6 @@ void  BinTools_SurfaceSet::Write (Standa
 
 
 //=======================================================================
-//function : ReadPnt
-//purpose  : 
-//=======================================================================
-
-static Standard_IStream& operator>>(Standard_IStream& IS, gp_Pnt& P)
-{
-  Standard_Real X=0.,Y=0.,Z=0.;
-  BinTools::GetReal(IS, X);
-  BinTools::GetReal(IS, Y);
-  BinTools::GetReal(IS, Z);
-  P.SetCoord(X,Y,Z);
-  return IS;
-}
-
-//=======================================================================
-//function : ReadDir
-//purpose  : 
-//=======================================================================
-
-static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir& D)
-{
-  Standard_Real X=0.,Y=0.,Z=0.;
-  BinTools::GetReal(IS, X);
-  BinTools::GetReal(IS, Y);
-  BinTools::GetReal(IS, Z);
-  D.SetCoord(X,Y,Z);
-  return IS;
-}
-
-//=======================================================================
-//function : ReadAx3
-//purpose  : 
-//=======================================================================
-
-static Standard_IStream& operator>>(Standard_IStream& IS, gp_Ax3& A3)
-{
-  gp_Pnt P(0.,0.,0.);
-  gp_Dir A(1.,0.,0.),AX(1.,0.,0.),AY(1.,0.,0.);
-  IS >> P >> A >> AX >> AY;
-  gp_Ax3 ax3(P,A,AX);
-  if (AY.DotCross(A,AX) < 0)
-    ax3.YReverse();
-  A3 = ax3;
-  return IS;
-}
-
-
-//=======================================================================
 //function : operator>>
 //purpose  : 
 //=======================================================================
@@ -477,7 +429,7 @@ static Standard_IStream& operator>>(Stan
 				    Handle(Geom_Plane)& S)
 {
   gp_Ax3 A;
-  IS >> A;
+  BinTools::GetAx3(IS, A);
   S = new Geom_Plane(A);
   return IS;
 }
@@ -492,7 +444,7 @@ static Standard_IStream& operator>>(Stan
 {
   gp_Ax3 A;
   Standard_Real R=0.;
-  IS >> A;
+  BinTools::GetAx3(IS, A);
   BinTools::GetReal(IS, R);
   S = new Geom_CylindricalSurface(A,R);
   return IS;
@@ -508,7 +460,7 @@ static Standard_IStream& operator>>(Stan
 {
   gp_Ax3 A;
   Standard_Real R=0.,Ang=0.;
-  IS >> A;
+  BinTools::GetAx3(IS, A);
   BinTools::GetReal(IS, R);
   BinTools::GetReal(IS, Ang);
   S = new Geom_ConicalSurface(A,Ang,R);
@@ -525,7 +477,7 @@ static Standard_IStream& operator>>(Stan
 {
   gp_Ax3 A;
   Standard_Real R=0.;
-  IS >> A;
+  BinTools::GetAx3(IS, A);
   BinTools::GetReal(IS, R);
   S = new Geom_SphericalSurface(A,R);
   return IS;
@@ -541,7 +493,7 @@ static Standard_IStream& operator>>(Stan
 {
   gp_Ax3 A;
   Standard_Real R1=0.,R2=0.;
-  IS >> A;
+  BinTools::GetAx3(IS, A);
   BinTools::GetReal(IS, R1);
   BinTools::GetReal(IS, R2);
   S = new Geom_ToroidalSurface(A,R1,R2);
@@ -558,7 +510,7 @@ static Standard_IStream& operator>>(Stan
 {
   gp_Dir D(1.,0.,0.);
   Handle(Geom_Curve) C;
-  IS >> D;
+  BinTools::GetDir(IS, D);
   BinTools_CurveSet::ReadCurve(IS,C);
   S = new Geom_SurfaceOfLinearExtrusion(C,D);
   return IS;
@@ -572,12 +524,11 @@ static Standard_IStream& operator>>(Stan
 static Standard_IStream& operator>>(Standard_IStream& IS,
 				    Handle(Geom_SurfaceOfRevolution)& S)
 {
-  gp_Pnt P(0.,0.,0.);
-  gp_Dir D(1.,0.,0.);
+  gp_Ax1 A(gp_Pnt(0.,0.,0.), gp_Dir(1.,0.,0.));
   Handle(Geom_Curve) C;
-  IS >> P >> D;
+  BinTools::GetAx1(IS, A);
   BinTools_CurveSet::ReadCurve(IS, C);
-  S = new Geom_SurfaceOfRevolution(C,gp_Ax1(P,D));
+  S = new Geom_SurfaceOfRevolution(C,A);
   return IS;
 }
 
@@ -610,7 +561,7 @@ static Standard_IStream& operator>>(Stan
   Standard_Integer i,j;
   for (i = 1; i <= udegree+1; i++) {
     for (j = 1; j <= vdegree+1; j++) {
-      IS >> poles(i,j);//Pnt
+      BinTools::GetPnt(IS, poles(i,j));
 //      std::cout <<"Pole X = " <<poles(i,j).X()<< " Y = " <<poles(i,j).Y()<< " Z = " << poles(i,j).Z()<<std::endl;
       if (urational || vrational)
 	BinTools::GetReal(IS, weights(i,j));
@@ -656,7 +607,7 @@ static Standard_IStream& operator>>(Stan
   Standard_Integer i,j;
   for (i = 1; i <= nbupoles; i++) {
     for (j = 1; j <= nbvpoles; j++) {
-      IS >> poles(i,j);//Pnt
+      BinTools::GetPnt(IS, poles(i,j));
       if (urational || vrational)
 	BinTools::GetReal(IS, weights(i,j)); 
     }
