Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:00

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 
0015 #ifndef _StdObject_gp_Axes_HeaderFile
0016 #define _StdObject_gp_Axes_HeaderFile
0017 
0018 
0019 #include <StdObject_gp_Vectors.hxx>
0020 
0021 #include <gp_Ax2d.hxx>
0022 #include <gp_Ax22d.hxx>
0023 #include <gp_Ax3.hxx>
0024 
0025 
0026 inline StdObjMgt_ReadData& operator >>
0027   (StdObjMgt_ReadData& theReadData, gp_Ax2d& theAx)
0028 {
0029   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0030   gp_Pnt2d aLoc;
0031   gp_Dir2d aDir;
0032   theReadData >> aLoc >> aDir;
0033   theAx = gp_Ax2d (aLoc, aDir);
0034   return theReadData;
0035 }
0036 
0037 inline StdObjMgt_WriteData& 
0038   write (StdObjMgt_WriteData& theWriteData, const gp_Ax2d& theAx)
0039 {
0040   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0041 
0042   const gp_Pnt2d& aLoc = theAx.Location();
0043   const gp_Dir2d& aDir = theAx.Direction();
0044   theWriteData << aLoc << aDir;
0045   return theWriteData;
0046 }
0047 
0048 inline StdObjMgt_WriteData& operator <<
0049   (StdObjMgt_WriteData& theWriteData, const gp_Ax2d& theAx)
0050 {
0051   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0052 
0053   const gp_Pnt2d& aLoc = theAx.Location();
0054   const gp_Dir2d& aDir = theAx.Direction();
0055   theWriteData << aLoc << aDir;
0056   return theWriteData;
0057 }
0058 
0059 inline StdObjMgt_ReadData& operator >>
0060   (StdObjMgt_ReadData& theReadData, gp_Ax22d& theAx)
0061 {
0062   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0063   gp_Pnt2d aLoc;
0064   gp_Dir2d aYDir, aXDir;
0065   theReadData >> aLoc >> aYDir >> aXDir;
0066   theAx = gp_Ax22d (aLoc, aXDir, aYDir);
0067   return theReadData;
0068 }
0069 
0070 inline StdObjMgt_WriteData& operator <<
0071   (StdObjMgt_WriteData& theWriteData, const gp_Ax22d& theAx)
0072 {
0073   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0074 
0075   const gp_Pnt2d& aLoc = theAx.Location();
0076   const gp_Dir2d& aYDir = theAx.YDirection();
0077   const gp_Dir2d& aXDir = theAx.XDirection();
0078   theWriteData << aLoc << aYDir << aXDir;
0079   return theWriteData;
0080 }
0081 
0082 inline StdObjMgt_ReadData& operator >>
0083   (StdObjMgt_ReadData& theReadData, gp_Ax1& theAx)
0084 {
0085   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0086   gp_Pnt aLoc;
0087   gp_Dir aDir;
0088   theReadData >> aLoc >> aDir;
0089   theAx = gp_Ax1 (aLoc, aDir);
0090   return theReadData;
0091 }
0092 
0093 inline StdObjMgt_WriteData&
0094   write(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_WriteData& operator <<
0105   (StdObjMgt_WriteData& theWriteData, const gp_Ax1& theAx)
0106 {
0107   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0108 
0109   const gp_Pnt& aLoc = theAx.Location();
0110   const gp_Dir& aDir = theAx.Direction();
0111   theWriteData << aLoc << aDir;
0112   return theWriteData;
0113 }
0114 
0115 inline StdObjMgt_ReadData& operator >>
0116   (StdObjMgt_ReadData& theReadData, gp_Ax2& theAx)
0117 {
0118   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0119   gp_Ax1 anAx;
0120   gp_Dir aYDir, aXDir;
0121   theReadData >> anAx >> aYDir >> aXDir;
0122   theAx = gp_Ax2 (anAx.Location(), anAx.Direction(), aXDir);
0123   return theReadData;
0124 }
0125 
0126 inline StdObjMgt_WriteData& operator <<
0127   (StdObjMgt_WriteData& theWriteData, const gp_Ax2& theAx)
0128 {
0129   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0130 
0131   const gp_Ax1& anAx = theAx.Axis();
0132   const gp_Dir& aYDir = theAx.YDirection();
0133   const gp_Dir& aXDir = theAx.XDirection();
0134   theWriteData << anAx << aYDir << aXDir;
0135   return theWriteData;
0136 }
0137 
0138 inline StdObjMgt_ReadData& operator >>
0139   (StdObjMgt_ReadData& theReadData, gp_Ax3& theAx)
0140 {
0141   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0142   gp_Ax1 anAx;
0143   gp_Dir aYDir, aXDir;
0144   theReadData >> anAx >> aYDir >> aXDir;
0145   theAx = gp_Ax3 (anAx.Location(), anAx.Direction(), aXDir);
0146   if (aYDir * theAx.YDirection() < 0.)
0147     theAx.YReverse();
0148   return theReadData;
0149 }
0150 
0151 inline StdObjMgt_WriteData& operator <<
0152   (StdObjMgt_WriteData& theWriteData, const gp_Ax3& theAx)
0153 {
0154   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0155 
0156   const gp_Ax1& anAx = theAx.Axis();
0157   const gp_Dir& aYDir = theAx.YDirection();
0158   const gp_Dir& aXDir = theAx.XDirection();
0159   theWriteData << anAx << aYDir << aXDir;
0160   return theWriteData;
0161 }
0162 
0163 
0164 #endif