1 // Copyright (c) 2015 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #ifndef _StdObject_gp_Axes_HeaderFile
16 #define _StdObject_gp_Axes_HeaderFile
19 #include <StdObject_gp_Vectors.hxx>
21 #include <gp_Ax2d.hxx>
22 #include <gp_Ax22d.hxx>
28 inline StdObjMgt_ReadData& operator >>
29 (StdObjMgt_ReadData::Object theReadData, gp_Ax2d& theAx)
33 theReadData >> aLoc >> aDir;
34 theAx = gp_Ax2d (aLoc, aDir);
38 inline StdObjMgt_WriteData&
39 write (StdObjMgt_WriteData::Object theWriteData, const gp_Ax2d& theAx)
41 const gp_Pnt2d& aLoc = theAx.Location();
42 const gp_Dir2d& aDir = theAx.Direction();
43 theWriteData << aLoc << aDir;
47 inline StdObjMgt_WriteData& operator <<
48 (StdObjMgt_WriteData::Object theWriteData, const gp_Ax2d& theAx)
50 const gp_Pnt2d& aLoc = theAx.Location();
51 const gp_Dir2d& aDir = theAx.Direction();
52 theWriteData << aLoc << aDir;
56 inline StdObjMgt_ReadData& operator >>
57 (StdObjMgt_ReadData::Object theReadData, gp_Ax22d& theAx)
60 gp_Dir2d aYDir, aXDir;
61 theReadData >> aLoc >> aYDir >> aXDir;
62 theAx = gp_Ax22d (aLoc, aXDir, aYDir);
66 inline StdObjMgt_WriteData& operator <<
67 (StdObjMgt_WriteData::Object theWriteData, const gp_Ax22d& theAx)
69 const gp_Pnt2d& aLoc = theAx.Location();
70 const gp_Dir2d& aYDir = theAx.YDirection();
71 const gp_Dir2d& aXDir = theAx.XDirection();
72 theWriteData << aLoc << aYDir << aXDir;
76 inline StdObjMgt_ReadData& operator >>
77 (StdObjMgt_ReadData::Object theReadData, gp_Ax1& theAx)
81 theReadData >> aLoc >> aDir;
82 theAx = gp_Ax1 (aLoc, aDir);
86 inline StdObjMgt_WriteData&
87 write(StdObjMgt_WriteData::Object theWriteData, const gp_Ax1& theAx)
89 const gp_Pnt& aLoc = theAx.Location();
90 const gp_Dir& aDir = theAx.Direction();
91 theWriteData << aLoc << aDir;
95 inline StdObjMgt_WriteData& operator <<
96 (StdObjMgt_WriteData::Object theWriteData, const gp_Ax1& theAx)
98 const gp_Pnt& aLoc = theAx.Location();
99 const gp_Dir& aDir = theAx.Direction();
100 theWriteData << aLoc << aDir;
104 inline StdObjMgt_ReadData& operator >>
105 (StdObjMgt_ReadData::Object theReadData, gp_Ax2& theAx)
109 theReadData >> anAx >> aYDir >> aXDir;
110 theAx = gp_Ax2 (anAx.Location(), anAx.Direction(), aXDir);
114 inline StdObjMgt_WriteData& operator <<
115 (StdObjMgt_WriteData::Object theWriteData, const gp_Ax2& theAx)
117 const gp_Ax1& anAx = theAx.Axis();
118 const gp_Dir& aYDir = theAx.YDirection();
119 const gp_Dir& aXDir = theAx.XDirection();
120 theWriteData << anAx << aYDir << aXDir;
124 inline StdObjMgt_ReadData& operator >>
125 (StdObjMgt_ReadData::Object theReadData, gp_Ax3& theAx)
129 theReadData >> anAx >> aYDir >> aXDir;
130 theAx = gp_Ax3 (anAx.Location(), anAx.Direction(), aXDir);
131 if (aYDir * theAx.YDirection() < 0.)
136 inline StdObjMgt_WriteData& operator <<
137 (StdObjMgt_WriteData::Object theWriteData, const gp_Ax3& theAx)
139 const gp_Ax1& anAx = theAx.Axis();
140 const gp_Dir& aYDir = theAx.YDirection();
141 const gp_Dir& aXDir = theAx.XDirection();
142 theWriteData << anAx << aYDir << aXDir;