Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-29 09:16:21

0001 // Copyright (c) 2015 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _StdObject_gp_Axes_HeaderFile
0015 #define _StdObject_gp_Axes_HeaderFile
0016 
0017 #include <StdObject_gp_Vectors.hxx>
0018 
0019 #include <gp_Ax2d.hxx>
0020 #include <gp_Ax22d.hxx>
0021 #include <gp_Ax3.hxx>
0022 
0023 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Ax2d& theAx)
0024 {
0025   StdObjMgt_ReadData::ObjectSentry aSentry(theReadData);
0026   gp_Pnt2d                         aLoc;
0027   gp_Dir2d                         aDir;
0028   theReadData >> aLoc >> aDir;
0029   theAx = gp_Ax2d(aLoc, aDir);
0030   return theReadData;
0031 }
0032 
0033 inline StdObjMgt_WriteData& write(StdObjMgt_WriteData& theWriteData, const gp_Ax2d& theAx)
0034 {
0035   StdObjMgt_WriteData::ObjectSentry aSentry(theWriteData);
0036 
0037   const gp_Pnt2d& aLoc = theAx.Location();
0038   const gp_Dir2d& aDir = theAx.Direction();
0039   theWriteData << aLoc << aDir;
0040   return theWriteData;
0041 }
0042 
0043 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Ax2d& theAx)
0044 {
0045   StdObjMgt_WriteData::ObjectSentry aSentry(theWriteData);
0046 
0047   const gp_Pnt2d& aLoc = theAx.Location();
0048   const gp_Dir2d& aDir = theAx.Direction();
0049   theWriteData << aLoc << aDir;
0050   return theWriteData;
0051 }
0052 
0053 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Ax22d& theAx)
0054 {
0055   StdObjMgt_ReadData::ObjectSentry aSentry(theReadData);
0056   gp_Pnt2d                         aLoc;
0057   gp_Dir2d                         aYDir, aXDir;
0058   theReadData >> aLoc >> aYDir >> aXDir;
0059   theAx = gp_Ax22d(aLoc, aXDir, aYDir);
0060   return theReadData;
0061 }
0062 
0063 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Ax22d& theAx)
0064 {
0065   StdObjMgt_WriteData::ObjectSentry aSentry(theWriteData);
0066 
0067   const gp_Pnt2d& aLoc  = theAx.Location();
0068   const gp_Dir2d& aYDir = theAx.YDirection();
0069   const gp_Dir2d& aXDir = theAx.XDirection();
0070   theWriteData << aLoc << aYDir << aXDir;
0071   return theWriteData;
0072 }
0073 
0074 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Ax1& theAx)
0075 {
0076   StdObjMgt_ReadData::ObjectSentry aSentry(theReadData);
0077   gp_Pnt                           aLoc;
0078   gp_Dir                           aDir;
0079   theReadData >> aLoc >> aDir;
0080   theAx = gp_Ax1(aLoc, aDir);
0081   return theReadData;
0082 }
0083 
0084 inline StdObjMgt_WriteData& write(StdObjMgt_WriteData& theWriteData, const gp_Ax1& theAx)
0085 {
0086   StdObjMgt_WriteData::ObjectSentry aSentry(theWriteData);
0087 
0088   const gp_Pnt& aLoc = theAx.Location();
0089   const gp_Dir& aDir = theAx.Direction();
0090   theWriteData << aLoc << aDir;
0091   return theWriteData;
0092 }
0093 
0094 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Ax1& theAx)
0095 {
0096   StdObjMgt_WriteData::ObjectSentry aSentry(theWriteData);
0097 
0098   const gp_Pnt& aLoc = theAx.Location();
0099   const gp_Dir& aDir = theAx.Direction();
0100   theWriteData << aLoc << aDir;
0101   return theWriteData;
0102 }
0103 
0104 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Ax2& theAx)
0105 {
0106   StdObjMgt_ReadData::ObjectSentry aSentry(theReadData);
0107   gp_Ax1                           anAx;
0108   gp_Dir                           aYDir, aXDir;
0109   theReadData >> anAx >> aYDir >> aXDir;
0110   theAx = gp_Ax2(anAx.Location(), anAx.Direction(), aXDir);
0111   return theReadData;
0112 }
0113 
0114 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Ax2& theAx)
0115 {
0116   StdObjMgt_WriteData::ObjectSentry aSentry(theWriteData);
0117 
0118   const gp_Ax1& anAx  = theAx.Axis();
0119   const gp_Dir& aYDir = theAx.YDirection();
0120   const gp_Dir& aXDir = theAx.XDirection();
0121   theWriteData << anAx << aYDir << aXDir;
0122   return theWriteData;
0123 }
0124 
0125 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Ax3& theAx)
0126 {
0127   StdObjMgt_ReadData::ObjectSentry aSentry(theReadData);
0128   gp_Ax1                           anAx;
0129   gp_Dir                           aYDir, aXDir;
0130   theReadData >> anAx >> aYDir >> aXDir;
0131   theAx = gp_Ax3(anAx.Location(), anAx.Direction(), aXDir);
0132   if (aYDir * theAx.YDirection() < 0.)
0133     theAx.YReverse();
0134   return theReadData;
0135 }
0136 
0137 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Ax3& theAx)
0138 {
0139   StdObjMgt_WriteData::ObjectSentry aSentry(theWriteData);
0140 
0141   const gp_Ax1& anAx  = theAx.Axis();
0142   const gp_Dir& aYDir = theAx.YDirection();
0143   const gp_Dir& aXDir = theAx.XDirection();
0144   theWriteData << anAx << aYDir << aXDir;
0145   return theWriteData;
0146 }
0147 
0148 #endif