0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / StdObject / StdObject_gp_Axes.hxx
CommitLineData
45d8465e 1// Copyright (c) 2015 OPEN CASCADE SAS
2//
3// This file is part of Open CASCADE Technology software library.
4//
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.
10//
11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
13
14
15#ifndef _StdObject_gp_Axes_HeaderFile
16#define _StdObject_gp_Axes_HeaderFile
17
18
19#include <StdObject_gp_Vectors.hxx>
20
21#include <gp_Ax2d.hxx>
22#include <gp_Ax22d.hxx>
45d8465e 23#include <gp_Ax3.hxx>
24
25
26inline StdObjMgt_ReadData& operator >>
472433e2 27 (StdObjMgt_ReadData& theReadData, gp_Ax2d& theAx)
45d8465e 28{
472433e2 29 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
45d8465e 30 gp_Pnt2d aLoc;
31 gp_Dir2d aDir;
32 theReadData >> aLoc >> aDir;
33 theAx = gp_Ax2d (aLoc, aDir);
34 return theReadData;
35}
36
ec964372 37inline StdObjMgt_WriteData&
472433e2 38 write (StdObjMgt_WriteData& theWriteData, const gp_Ax2d& theAx)
ec964372 39{
472433e2 40 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
41
ec964372 42 const gp_Pnt2d& aLoc = theAx.Location();
43 const gp_Dir2d& aDir = theAx.Direction();
44 theWriteData << aLoc << aDir;
45 return theWriteData;
46}
47
48inline StdObjMgt_WriteData& operator <<
472433e2 49 (StdObjMgt_WriteData& theWriteData, const gp_Ax2d& theAx)
ec964372 50{
472433e2 51 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
52
ec964372 53 const gp_Pnt2d& aLoc = theAx.Location();
54 const gp_Dir2d& aDir = theAx.Direction();
55 theWriteData << aLoc << aDir;
56 return theWriteData;
57}
58
45d8465e 59inline StdObjMgt_ReadData& operator >>
472433e2 60 (StdObjMgt_ReadData& theReadData, gp_Ax22d& theAx)
45d8465e 61{
472433e2 62 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
45d8465e 63 gp_Pnt2d aLoc;
64 gp_Dir2d aYDir, aXDir;
65 theReadData >> aLoc >> aYDir >> aXDir;
66 theAx = gp_Ax22d (aLoc, aXDir, aYDir);
67 return theReadData;
68}
69
ec964372 70inline StdObjMgt_WriteData& operator <<
472433e2 71 (StdObjMgt_WriteData& theWriteData, const gp_Ax22d& theAx)
ec964372 72{
472433e2 73 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
74
ec964372 75 const gp_Pnt2d& aLoc = theAx.Location();
76 const gp_Dir2d& aYDir = theAx.YDirection();
77 const gp_Dir2d& aXDir = theAx.XDirection();
78 theWriteData << aLoc << aYDir << aXDir;
79 return theWriteData;
80}
81
45d8465e 82inline StdObjMgt_ReadData& operator >>
472433e2 83 (StdObjMgt_ReadData& theReadData, gp_Ax1& theAx)
45d8465e 84{
472433e2 85 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
ec964372 86 gp_Pnt aLoc;
45d8465e 87 gp_Dir aDir;
88 theReadData >> aLoc >> aDir;
89 theAx = gp_Ax1 (aLoc, aDir);
90 return theReadData;
91}
92
ec964372 93inline StdObjMgt_WriteData&
472433e2 94 write(StdObjMgt_WriteData& theWriteData, const gp_Ax1& theAx)
ec964372 95{
472433e2 96 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
97
ec964372 98 const gp_Pnt& aLoc = theAx.Location();
99 const gp_Dir& aDir = theAx.Direction();
100 theWriteData << aLoc << aDir;
101 return theWriteData;
102}
103
104inline StdObjMgt_WriteData& operator <<
472433e2 105 (StdObjMgt_WriteData& theWriteData, const gp_Ax1& theAx)
ec964372 106{
472433e2 107 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
108
ec964372 109 const gp_Pnt& aLoc = theAx.Location();
110 const gp_Dir& aDir = theAx.Direction();
111 theWriteData << aLoc << aDir;
112 return theWriteData;
113}
114
45d8465e 115inline StdObjMgt_ReadData& operator >>
472433e2 116 (StdObjMgt_ReadData& theReadData, gp_Ax2& theAx)
45d8465e 117{
472433e2 118 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
45d8465e 119 gp_Ax1 anAx;
120 gp_Dir aYDir, aXDir;
121 theReadData >> anAx >> aYDir >> aXDir;
122 theAx = gp_Ax2 (anAx.Location(), anAx.Direction(), aXDir);
123 return theReadData;
124}
125
ec964372 126inline StdObjMgt_WriteData& operator <<
472433e2 127 (StdObjMgt_WriteData& theWriteData, const gp_Ax2& theAx)
ec964372 128{
472433e2 129 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
130
ec964372 131 const gp_Ax1& anAx = theAx.Axis();
132 const gp_Dir& aYDir = theAx.YDirection();
133 const gp_Dir& aXDir = theAx.XDirection();
134 theWriteData << anAx << aYDir << aXDir;
135 return theWriteData;
136}
137
45d8465e 138inline StdObjMgt_ReadData& operator >>
472433e2 139 (StdObjMgt_ReadData& theReadData, gp_Ax3& theAx)
45d8465e 140{
472433e2 141 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
45d8465e 142 gp_Ax1 anAx;
143 gp_Dir aYDir, aXDir;
144 theReadData >> anAx >> aYDir >> aXDir;
145 theAx = gp_Ax3 (anAx.Location(), anAx.Direction(), aXDir);
146 if (aYDir * theAx.YDirection() < 0.)
147 theAx.YReverse();
148 return theReadData;
149}
150
ec964372 151inline StdObjMgt_WriteData& operator <<
472433e2 152 (StdObjMgt_WriteData& theWriteData, const gp_Ax3& theAx)
ec964372 153{
472433e2 154 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
155
ec964372 156 const gp_Ax1& anAx = theAx.Axis();
157 const gp_Dir& aYDir = theAx.YDirection();
158 const gp_Dir& aXDir = theAx.XDirection();
159 theWriteData << anAx << aYDir << aXDir;
160 return theWriteData;
161}
162
45d8465e 163
164#endif