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& theReadData, gp_Ax2d& theAx)
31 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
34 theReadData >> aLoc >> aDir;
35 theAx = gp_Ax2d (aLoc, aDir);
39 inline StdObjMgt_WriteData&
40 write (StdObjMgt_WriteData& theWriteData, const gp_Ax2d& theAx)
42 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
44 const gp_Pnt2d& aLoc = theAx.Location();
45 const gp_Dir2d& aDir = theAx.Direction();
46 theWriteData << aLoc << aDir;
50 inline StdObjMgt_WriteData& operator <<
51 (StdObjMgt_WriteData& theWriteData, const gp_Ax2d& theAx)
53 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
55 const gp_Pnt2d& aLoc = theAx.Location();
56 const gp_Dir2d& aDir = theAx.Direction();
57 theWriteData << aLoc << aDir;
61 inline StdObjMgt_ReadData& operator >>
62 (StdObjMgt_ReadData& theReadData, gp_Ax22d& theAx)
64 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
66 gp_Dir2d aYDir, aXDir;
67 theReadData >> aLoc >> aYDir >> aXDir;
68 theAx = gp_Ax22d (aLoc, aXDir, aYDir);
72 inline StdObjMgt_WriteData& operator <<
73 (StdObjMgt_WriteData& theWriteData, const gp_Ax22d& theAx)
75 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
77 const gp_Pnt2d& aLoc = theAx.Location();
78 const gp_Dir2d& aYDir = theAx.YDirection();
79 const gp_Dir2d& aXDir = theAx.XDirection();
80 theWriteData << aLoc << aYDir << aXDir;
84 inline StdObjMgt_ReadData& operator >>
85 (StdObjMgt_ReadData& theReadData, gp_Ax1& theAx)
87 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
90 theReadData >> aLoc >> aDir;
91 theAx = gp_Ax1 (aLoc, aDir);
95 inline StdObjMgt_WriteData&
96 write(StdObjMgt_WriteData& theWriteData, const gp_Ax1& theAx)
98 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
100 const gp_Pnt& aLoc = theAx.Location();
101 const gp_Dir& aDir = theAx.Direction();
102 theWriteData << aLoc << aDir;
106 inline StdObjMgt_WriteData& operator <<
107 (StdObjMgt_WriteData& theWriteData, const gp_Ax1& theAx)
109 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
111 const gp_Pnt& aLoc = theAx.Location();
112 const gp_Dir& aDir = theAx.Direction();
113 theWriteData << aLoc << aDir;
117 inline StdObjMgt_ReadData& operator >>
118 (StdObjMgt_ReadData& theReadData, gp_Ax2& theAx)
120 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
123 theReadData >> anAx >> aYDir >> aXDir;
124 theAx = gp_Ax2 (anAx.Location(), anAx.Direction(), aXDir);
128 inline StdObjMgt_WriteData& operator <<
129 (StdObjMgt_WriteData& theWriteData, const gp_Ax2& theAx)
131 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
133 const gp_Ax1& anAx = theAx.Axis();
134 const gp_Dir& aYDir = theAx.YDirection();
135 const gp_Dir& aXDir = theAx.XDirection();
136 theWriteData << anAx << aYDir << aXDir;
140 inline StdObjMgt_ReadData& operator >>
141 (StdObjMgt_ReadData& theReadData, gp_Ax3& theAx)
143 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
146 theReadData >> anAx >> aYDir >> aXDir;
147 theAx = gp_Ax3 (anAx.Location(), anAx.Direction(), aXDir);
148 if (aYDir * theAx.YDirection() < 0.)
153 inline StdObjMgt_WriteData& operator <<
154 (StdObjMgt_WriteData& theWriteData, const gp_Ax3& theAx)
156 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
158 const gp_Ax1& anAx = theAx.Axis();
159 const gp_Dir& aYDir = theAx.YDirection();
160 const gp_Dir& aXDir = theAx.XDirection();
161 theWriteData << anAx << aYDir << aXDir;