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 >> |
31 | (StdObjMgt_ReadData::Object theReadData, gp_XY& theXY) |
32 | { |
33 | Standard_Real aX, aY; |
34 | theReadData >> aX >> aY; |
35 | theXY.SetCoord (aX, aY); |
36 | return theReadData; |
37 | } |
38 | |
ec964372 |
39 | inline StdObjMgt_WriteData& operator << |
40 | (StdObjMgt_WriteData::Object theWriteData, const gp_XY& theXY) |
41 | { |
42 | Standard_Real aX = theXY.X(), aY = theXY.Y(); |
43 | theWriteData << aX << aY; |
44 | return theWriteData; |
45 | } |
46 | |
45d8465e |
47 | inline StdObjMgt_ReadData& operator >> |
48 | (StdObjMgt_ReadData::Object theReadData, gp_Pnt2d& thePnt) |
49 | { |
ec964372 |
50 | gp_XY aXY; |
51 | theReadData >> aXY; |
52 | thePnt.SetXY (aXY); |
45d8465e |
53 | return theReadData; |
54 | } |
55 | |
ec964372 |
56 | inline StdObjMgt_WriteData& operator << |
57 | (StdObjMgt_WriteData::Object theWriteData, const gp_Pnt2d& thePnt) |
58 | { |
59 | theWriteData << thePnt.XY(); |
60 | return theWriteData; |
61 | } |
62 | |
45d8465e |
63 | inline StdObjMgt_ReadData& operator >> |
64 | (StdObjMgt_ReadData::Object theReadData, gp_Vec2d& theVec) |
65 | { |
ec964372 |
66 | gp_XY aXY; |
67 | theReadData >> aXY; |
68 | theVec.SetXY (aXY); |
45d8465e |
69 | return theReadData; |
70 | } |
71 | |
ec964372 |
72 | inline StdObjMgt_WriteData& operator << |
73 | (StdObjMgt_WriteData::Object theWriteData, const gp_Vec2d& theVec) |
74 | { |
75 | theWriteData << theVec.XY(); |
76 | return theWriteData; |
77 | } |
78 | |
45d8465e |
79 | inline StdObjMgt_ReadData& operator >> |
80 | (StdObjMgt_ReadData::Object theReadData, gp_Dir2d& theDir) |
81 | { |
ec964372 |
82 | gp_XY aXY; |
83 | theReadData >> aXY; |
84 | theDir.SetXY (aXY); |
45d8465e |
85 | return theReadData; |
86 | } |
87 | |
ec964372 |
88 | inline StdObjMgt_WriteData& operator << |
89 | (StdObjMgt_WriteData::Object theWriteData, const gp_Dir2d& theDir) |
90 | { |
91 | theWriteData << theDir.XY(); |
92 | return theWriteData; |
93 | } |
94 | |
45d8465e |
95 | inline StdObjMgt_ReadData& operator >> |
96 | (StdObjMgt_ReadData::Object theReadData, gp_XYZ& theXYZ) |
97 | { |
98 | Standard_Real aX, aY, aZ; |
99 | theReadData >> aX >> aY >> aZ; |
ec964372 |
100 | theXYZ.SetCoord(aX, aY, aZ); |
45d8465e |
101 | return theReadData; |
102 | } |
103 | |
ec964372 |
104 | inline StdObjMgt_WriteData& operator << |
105 | (StdObjMgt_WriteData::Object theWriteData, const gp_XYZ& theXYZ) |
106 | { |
107 | Standard_Real aX = theXYZ.X(), aY = theXYZ.Y(), aZ = theXYZ.Z(); |
108 | theWriteData << aX << aY << aZ; |
109 | return theWriteData; |
110 | } |
111 | |
45d8465e |
112 | inline StdObjMgt_ReadData& operator >> |
113 | (StdObjMgt_ReadData::Object theReadData, gp_Pnt& thePnt) |
114 | { |
ec964372 |
115 | gp_XYZ aXYZ; |
116 | theReadData >> aXYZ; |
117 | thePnt.SetXYZ (aXYZ); |
45d8465e |
118 | return theReadData; |
119 | } |
120 | |
ec964372 |
121 | inline StdObjMgt_WriteData& operator << |
122 | (StdObjMgt_WriteData::Object theWriteData, const gp_Pnt& thePnt) |
123 | { |
124 | theWriteData << thePnt.XYZ(); |
125 | return theWriteData; |
126 | } |
127 | |
45d8465e |
128 | inline StdObjMgt_ReadData& operator >> |
129 | (StdObjMgt_ReadData::Object theReadData, gp_Vec& theVec) |
130 | { |
ec964372 |
131 | gp_XYZ aXYZ; |
132 | theReadData >> aXYZ; |
133 | theVec.SetXYZ (aXYZ); |
45d8465e |
134 | return theReadData; |
135 | } |
136 | |
ec964372 |
137 | inline StdObjMgt_WriteData& operator << |
138 | (StdObjMgt_WriteData::Object theWriteData, const gp_Vec& theVec) |
139 | { |
140 | theWriteData << theVec.XYZ(); |
141 | return theWriteData; |
142 | } |
143 | |
45d8465e |
144 | inline StdObjMgt_ReadData& operator >> |
145 | (StdObjMgt_ReadData::Object theReadData, gp_Dir& theDir) |
146 | { |
ec964372 |
147 | gp_XYZ aXYZ; |
148 | theReadData >> aXYZ; |
149 | theDir.SetXYZ(aXYZ); |
45d8465e |
150 | return theReadData; |
151 | } |
152 | |
ec964372 |
153 | inline StdObjMgt_WriteData& operator << |
154 | (StdObjMgt_WriteData::Object theWriteData, const gp_Dir& theDir) |
155 | { |
156 | theWriteData << theDir.XYZ(); |
157 | return theWriteData; |
158 | } |
159 | |
45d8465e |
160 | |
161 | #endif |