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_Vectors_HeaderFile
16 #define _StdObject_gp_Vectors_HeaderFile
19 #include <StdObjMgt_ReadData.hxx>
20 #include <StdObjMgt_WriteData.hxx>
22 #include <gp_Pnt2d.hxx>
23 #include <gp_Vec2d.hxx>
24 #include <gp_Dir2d.hxx>
30 inline StdObjMgt_ReadData& operator >>
31 (StdObjMgt_ReadData& theReadData, gp_XY& theXY)
33 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
36 theReadData >> aX >> aY;
37 theXY.SetCoord (aX, aY);
41 inline StdObjMgt_WriteData& operator <<
42 (StdObjMgt_WriteData& theWriteData, const gp_XY& theXY)
44 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
46 Standard_Real aX = theXY.X(), aY = theXY.Y();
47 theWriteData << aX << aY;
51 inline StdObjMgt_ReadData& operator >>
52 (StdObjMgt_ReadData& theReadData, gp_Pnt2d& thePnt)
54 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
62 inline StdObjMgt_WriteData& operator <<
63 (StdObjMgt_WriteData& theWriteData, const gp_Pnt2d& thePnt)
65 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
67 theWriteData << thePnt.XY();
71 inline StdObjMgt_ReadData& operator >>
72 (StdObjMgt_ReadData& theReadData, gp_Vec2d& theVec)
74 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
82 inline StdObjMgt_WriteData& operator <<
83 (StdObjMgt_WriteData& theWriteData, const gp_Vec2d& theVec)
85 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
87 theWriteData << theVec.XY();
91 inline StdObjMgt_ReadData& operator >>
92 (StdObjMgt_ReadData& theReadData, gp_Dir2d& theDir)
94 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
102 inline StdObjMgt_WriteData& operator <<
103 (StdObjMgt_WriteData& theWriteData, const gp_Dir2d& theDir)
105 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
107 theWriteData << theDir.XY();
111 inline StdObjMgt_ReadData& operator >>
112 (StdObjMgt_ReadData& theReadData, gp_XYZ& theXYZ)
114 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
116 Standard_Real aX, aY, aZ;
117 theReadData >> aX >> aY >> aZ;
118 theXYZ.SetCoord(aX, aY, aZ);
122 inline StdObjMgt_WriteData& operator <<
123 (StdObjMgt_WriteData& theWriteData, const gp_XYZ& theXYZ)
125 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
127 Standard_Real aX = theXYZ.X(), aY = theXYZ.Y(), aZ = theXYZ.Z();
128 theWriteData << aX << aY << aZ;
132 inline StdObjMgt_ReadData& operator >>
133 (StdObjMgt_ReadData& theReadData, gp_Pnt& thePnt)
135 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
139 thePnt.SetXYZ (aXYZ);
143 inline StdObjMgt_WriteData& operator <<
144 (StdObjMgt_WriteData& theWriteData, const gp_Pnt& thePnt)
146 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
148 theWriteData << thePnt.XYZ();
152 inline StdObjMgt_ReadData& operator >>
153 (StdObjMgt_ReadData& theReadData, gp_Vec& theVec)
155 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
159 theVec.SetXYZ (aXYZ);
163 inline StdObjMgt_WriteData& operator <<
164 (StdObjMgt_WriteData& theWriteData, const gp_Vec& theVec)
166 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
168 theWriteData << theVec.XYZ();
172 inline StdObjMgt_ReadData& operator >>
173 (StdObjMgt_ReadData& theReadData, gp_Dir& theDir)
175 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
183 inline StdObjMgt_WriteData& operator <<
184 (StdObjMgt_WriteData& theWriteData, const gp_Dir& theDir)
186 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
188 theWriteData << theDir.XYZ();