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_Vectors_HeaderFile |
16 | #define _StdObject_gp_Vectors_HeaderFile |
17 | |
18 | |
19 | #include <StdObjMgt_ReadData.hxx> |
ec964372 |
20 | #include <StdObjMgt_WriteData.hxx> |
45d8465e |
21 | |
22 | #include <gp_Pnt2d.hxx> |
23 | #include <gp_Vec2d.hxx> |
24 | #include <gp_Dir2d.hxx> |
25 | #include <gp_Pnt.hxx> |
26 | #include <gp_Vec.hxx> |
27 | #include <gp_Dir.hxx> |
28 | |
29 | |
30 | inline StdObjMgt_ReadData& operator >> |
472433e2 |
31 | (StdObjMgt_ReadData& theReadData, gp_XY& theXY) |
45d8465e |
32 | { |
472433e2 |
33 | StdObjMgt_ReadData::ObjectSentry aSentry (theReadData); |
34 | |
45d8465e |
35 | Standard_Real aX, aY; |
36 | theReadData >> aX >> aY; |
37 | theXY.SetCoord (aX, aY); |
38 | return theReadData; |
39 | } |
40 | |
ec964372 |
41 | inline StdObjMgt_WriteData& operator << |
472433e2 |
42 | (StdObjMgt_WriteData& theWriteData, const gp_XY& theXY) |
ec964372 |
43 | { |
472433e2 |
44 | StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData); |
45 | |
ec964372 |
46 | Standard_Real aX = theXY.X(), aY = theXY.Y(); |
47 | theWriteData << aX << aY; |
48 | return theWriteData; |
49 | } |
50 | |
45d8465e |
51 | inline StdObjMgt_ReadData& operator >> |
472433e2 |
52 | (StdObjMgt_ReadData& theReadData, gp_Pnt2d& thePnt) |
45d8465e |
53 | { |
472433e2 |
54 | StdObjMgt_ReadData::ObjectSentry aSentry (theReadData); |
55 | |
ec964372 |
56 | gp_XY aXY; |
57 | theReadData >> aXY; |
58 | thePnt.SetXY (aXY); |
45d8465e |
59 | return theReadData; |
60 | } |
61 | |
ec964372 |
62 | inline StdObjMgt_WriteData& operator << |
472433e2 |
63 | (StdObjMgt_WriteData& theWriteData, const gp_Pnt2d& thePnt) |
ec964372 |
64 | { |
472433e2 |
65 | StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData); |
66 | |
ec964372 |
67 | theWriteData << thePnt.XY(); |
68 | return theWriteData; |
69 | } |
70 | |
45d8465e |
71 | inline StdObjMgt_ReadData& operator >> |
472433e2 |
72 | (StdObjMgt_ReadData& theReadData, gp_Vec2d& theVec) |
45d8465e |
73 | { |
472433e2 |
74 | StdObjMgt_ReadData::ObjectSentry aSentry (theReadData); |
75 | |
ec964372 |
76 | gp_XY aXY; |
77 | theReadData >> aXY; |
78 | theVec.SetXY (aXY); |
45d8465e |
79 | return theReadData; |
80 | } |
81 | |
ec964372 |
82 | inline StdObjMgt_WriteData& operator << |
472433e2 |
83 | (StdObjMgt_WriteData& theWriteData, const gp_Vec2d& theVec) |
ec964372 |
84 | { |
472433e2 |
85 | StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData); |
86 | |
ec964372 |
87 | theWriteData << theVec.XY(); |
88 | return theWriteData; |
89 | } |
90 | |
45d8465e |
91 | inline StdObjMgt_ReadData& operator >> |
472433e2 |
92 | (StdObjMgt_ReadData& theReadData, gp_Dir2d& theDir) |
45d8465e |
93 | { |
472433e2 |
94 | StdObjMgt_ReadData::ObjectSentry aSentry (theReadData); |
95 | |
ec964372 |
96 | gp_XY aXY; |
97 | theReadData >> aXY; |
98 | theDir.SetXY (aXY); |
45d8465e |
99 | return theReadData; |
100 | } |
101 | |
ec964372 |
102 | inline StdObjMgt_WriteData& operator << |
472433e2 |
103 | (StdObjMgt_WriteData& theWriteData, const gp_Dir2d& theDir) |
ec964372 |
104 | { |
472433e2 |
105 | StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData); |
106 | |
ec964372 |
107 | theWriteData << theDir.XY(); |
108 | return theWriteData; |
109 | } |
110 | |
45d8465e |
111 | inline StdObjMgt_ReadData& operator >> |
472433e2 |
112 | (StdObjMgt_ReadData& theReadData, gp_XYZ& theXYZ) |
45d8465e |
113 | { |
472433e2 |
114 | StdObjMgt_ReadData::ObjectSentry aSentry (theReadData); |
115 | |
45d8465e |
116 | Standard_Real aX, aY, aZ; |
117 | theReadData >> aX >> aY >> aZ; |
ec964372 |
118 | theXYZ.SetCoord(aX, aY, aZ); |
45d8465e |
119 | return theReadData; |
120 | } |
121 | |
ec964372 |
122 | inline StdObjMgt_WriteData& operator << |
472433e2 |
123 | (StdObjMgt_WriteData& theWriteData, const gp_XYZ& theXYZ) |
ec964372 |
124 | { |
472433e2 |
125 | StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData); |
126 | |
ec964372 |
127 | Standard_Real aX = theXYZ.X(), aY = theXYZ.Y(), aZ = theXYZ.Z(); |
128 | theWriteData << aX << aY << aZ; |
129 | return theWriteData; |
130 | } |
131 | |
45d8465e |
132 | inline StdObjMgt_ReadData& operator >> |
472433e2 |
133 | (StdObjMgt_ReadData& theReadData, gp_Pnt& thePnt) |
45d8465e |
134 | { |
472433e2 |
135 | StdObjMgt_ReadData::ObjectSentry aSentry (theReadData); |
136 | |
ec964372 |
137 | gp_XYZ aXYZ; |
138 | theReadData >> aXYZ; |
139 | thePnt.SetXYZ (aXYZ); |
45d8465e |
140 | return theReadData; |
141 | } |
142 | |
ec964372 |
143 | inline StdObjMgt_WriteData& operator << |
472433e2 |
144 | (StdObjMgt_WriteData& theWriteData, const gp_Pnt& thePnt) |
ec964372 |
145 | { |
472433e2 |
146 | StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData); |
147 | |
ec964372 |
148 | theWriteData << thePnt.XYZ(); |
149 | return theWriteData; |
150 | } |
151 | |
45d8465e |
152 | inline StdObjMgt_ReadData& operator >> |
472433e2 |
153 | (StdObjMgt_ReadData& theReadData, gp_Vec& theVec) |
45d8465e |
154 | { |
472433e2 |
155 | StdObjMgt_ReadData::ObjectSentry aSentry (theReadData); |
156 | |
ec964372 |
157 | gp_XYZ aXYZ; |
158 | theReadData >> aXYZ; |
159 | theVec.SetXYZ (aXYZ); |
45d8465e |
160 | return theReadData; |
161 | } |
162 | |
ec964372 |
163 | inline StdObjMgt_WriteData& operator << |
472433e2 |
164 | (StdObjMgt_WriteData& theWriteData, const gp_Vec& theVec) |
ec964372 |
165 | { |
472433e2 |
166 | StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData); |
167 | |
ec964372 |
168 | theWriteData << theVec.XYZ(); |
169 | return theWriteData; |
170 | } |
171 | |
45d8465e |
172 | inline StdObjMgt_ReadData& operator >> |
472433e2 |
173 | (StdObjMgt_ReadData& theReadData, gp_Dir& theDir) |
45d8465e |
174 | { |
472433e2 |
175 | StdObjMgt_ReadData::ObjectSentry aSentry (theReadData); |
176 | |
ec964372 |
177 | gp_XYZ aXYZ; |
178 | theReadData >> aXYZ; |
179 | theDir.SetXYZ(aXYZ); |
45d8465e |
180 | return theReadData; |
181 | } |
182 | |
ec964372 |
183 | inline StdObjMgt_WriteData& operator << |
472433e2 |
184 | (StdObjMgt_WriteData& theWriteData, const gp_Dir& theDir) |
ec964372 |
185 | { |
472433e2 |
186 | StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData); |
187 | |
ec964372 |
188 | theWriteData << theDir.XYZ(); |
189 | return theWriteData; |
190 | } |
191 | |
45d8465e |
192 | |
193 | #endif |