0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[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>
23#include <gp_Ax1.hxx>
24#include <gp_Ax2.hxx>
25#include <gp_Ax3.hxx>
26
27
28inline StdObjMgt_ReadData& operator >>
472433e2 29 (StdObjMgt_ReadData& theReadData, gp_Ax2d& theAx)
45d8465e 30{
472433e2 31 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
45d8465e 32 gp_Pnt2d aLoc;
33 gp_Dir2d aDir;
34 theReadData >> aLoc >> aDir;
35 theAx = gp_Ax2d (aLoc, aDir);
36 return theReadData;
37}
38
ec964372 39inline StdObjMgt_WriteData&
472433e2 40 write (StdObjMgt_WriteData& theWriteData, const gp_Ax2d& theAx)
ec964372 41{
472433e2 42 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
43
ec964372 44 const gp_Pnt2d& aLoc = theAx.Location();
45 const gp_Dir2d& aDir = theAx.Direction();
46 theWriteData << aLoc << aDir;
47 return theWriteData;
48}
49
50inline StdObjMgt_WriteData& operator <<
472433e2 51 (StdObjMgt_WriteData& theWriteData, const gp_Ax2d& theAx)
ec964372 52{
472433e2 53 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
54
ec964372 55 const gp_Pnt2d& aLoc = theAx.Location();
56 const gp_Dir2d& aDir = theAx.Direction();
57 theWriteData << aLoc << aDir;
58 return theWriteData;
59}
60
45d8465e 61inline StdObjMgt_ReadData& operator >>
472433e2 62 (StdObjMgt_ReadData& theReadData, gp_Ax22d& theAx)
45d8465e 63{
472433e2 64 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
45d8465e 65 gp_Pnt2d aLoc;
66 gp_Dir2d aYDir, aXDir;
67 theReadData >> aLoc >> aYDir >> aXDir;
68 theAx = gp_Ax22d (aLoc, aXDir, aYDir);
69 return theReadData;
70}
71
ec964372 72inline StdObjMgt_WriteData& operator <<
472433e2 73 (StdObjMgt_WriteData& theWriteData, const gp_Ax22d& theAx)
ec964372 74{
472433e2 75 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
76
ec964372 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;
81 return theWriteData;
82}
83
45d8465e 84inline StdObjMgt_ReadData& operator >>
472433e2 85 (StdObjMgt_ReadData& theReadData, gp_Ax1& theAx)
45d8465e 86{
472433e2 87 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
ec964372 88 gp_Pnt aLoc;
45d8465e 89 gp_Dir aDir;
90 theReadData >> aLoc >> aDir;
91 theAx = gp_Ax1 (aLoc, aDir);
92 return theReadData;
93}
94
ec964372 95inline StdObjMgt_WriteData&
472433e2 96 write(StdObjMgt_WriteData& theWriteData, const gp_Ax1& theAx)
ec964372 97{
472433e2 98 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
99
ec964372 100 const gp_Pnt& aLoc = theAx.Location();
101 const gp_Dir& aDir = theAx.Direction();
102 theWriteData << aLoc << aDir;
103 return theWriteData;
104}
105
106inline StdObjMgt_WriteData& operator <<
472433e2 107 (StdObjMgt_WriteData& theWriteData, const gp_Ax1& theAx)
ec964372 108{
472433e2 109 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
110
ec964372 111 const gp_Pnt& aLoc = theAx.Location();
112 const gp_Dir& aDir = theAx.Direction();
113 theWriteData << aLoc << aDir;
114 return theWriteData;
115}
116
45d8465e 117inline StdObjMgt_ReadData& operator >>
472433e2 118 (StdObjMgt_ReadData& theReadData, gp_Ax2& theAx)
45d8465e 119{
472433e2 120 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
45d8465e 121 gp_Ax1 anAx;
122 gp_Dir aYDir, aXDir;
123 theReadData >> anAx >> aYDir >> aXDir;
124 theAx = gp_Ax2 (anAx.Location(), anAx.Direction(), aXDir);
125 return theReadData;
126}
127
ec964372 128inline StdObjMgt_WriteData& operator <<
472433e2 129 (StdObjMgt_WriteData& theWriteData, const gp_Ax2& theAx)
ec964372 130{
472433e2 131 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
132
ec964372 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;
137 return theWriteData;
138}
139
45d8465e 140inline StdObjMgt_ReadData& operator >>
472433e2 141 (StdObjMgt_ReadData& theReadData, gp_Ax3& theAx)
45d8465e 142{
472433e2 143 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
45d8465e 144 gp_Ax1 anAx;
145 gp_Dir aYDir, aXDir;
146 theReadData >> anAx >> aYDir >> aXDir;
147 theAx = gp_Ax3 (anAx.Location(), anAx.Direction(), aXDir);
148 if (aYDir * theAx.YDirection() < 0.)
149 theAx.YReverse();
150 return theReadData;
151}
152
ec964372 153inline StdObjMgt_WriteData& operator <<
472433e2 154 (StdObjMgt_WriteData& theWriteData, const gp_Ax3& theAx)
ec964372 155{
472433e2 156 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
157
ec964372 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;
162 return theWriteData;
163}
164
45d8465e 165
166#endif