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_Vectors_HeaderFile
0016 #define _StdObject_gp_Vectors_HeaderFile
0017 
0018 
0019 #include <StdObjMgt_ReadData.hxx>
0020 #include <StdObjMgt_WriteData.hxx>
0021 
0022 #include <gp_Pnt2d.hxx>
0023 #include <gp_Vec2d.hxx>
0024 #include <gp_Dir2d.hxx>
0025 #include <gp_Pnt.hxx>
0026 #include <gp_Vec.hxx>
0027 #include <gp_Dir.hxx>
0028 
0029 
0030 inline StdObjMgt_ReadData& operator >>
0031   (StdObjMgt_ReadData& theReadData, gp_XY& theXY)
0032 {
0033   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0034 
0035   Standard_Real aX, aY;
0036   theReadData >> aX >> aY;
0037   theXY.SetCoord (aX, aY);
0038   return theReadData;
0039 }
0040 
0041 inline StdObjMgt_WriteData& operator <<
0042   (StdObjMgt_WriteData& theWriteData, const gp_XY& theXY)
0043 {
0044   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0045 
0046   Standard_Real aX = theXY.X(), aY = theXY.Y();
0047   theWriteData << aX << aY;
0048   return theWriteData;
0049 }
0050 
0051 inline StdObjMgt_ReadData& operator >>
0052   (StdObjMgt_ReadData& theReadData, gp_Pnt2d& thePnt)
0053 {
0054   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0055 
0056   gp_XY aXY;
0057   theReadData >> aXY;
0058   thePnt.SetXY (aXY);
0059   return theReadData;
0060 }
0061 
0062 inline StdObjMgt_WriteData& operator <<
0063   (StdObjMgt_WriteData& theWriteData, const gp_Pnt2d& thePnt)
0064 {
0065   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0066 
0067   theWriteData << thePnt.XY();
0068   return theWriteData;
0069 }
0070 
0071 inline StdObjMgt_ReadData& operator >>
0072   (StdObjMgt_ReadData& theReadData, gp_Vec2d& theVec)
0073 {
0074   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0075 
0076   gp_XY aXY;
0077   theReadData >> aXY;
0078   theVec.SetXY (aXY);
0079   return theReadData;
0080 }
0081 
0082 inline StdObjMgt_WriteData& operator <<
0083   (StdObjMgt_WriteData& theWriteData, const gp_Vec2d& theVec)
0084 {
0085   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0086 
0087   theWriteData << theVec.XY();
0088   return theWriteData;
0089 }
0090 
0091 inline StdObjMgt_ReadData& operator >>
0092   (StdObjMgt_ReadData& theReadData, gp_Dir2d& theDir)
0093 {
0094   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0095 
0096   gp_XY aXY;
0097   theReadData >> aXY;
0098   theDir.SetXY (aXY);
0099   return theReadData;
0100 }
0101 
0102 inline StdObjMgt_WriteData& operator <<
0103   (StdObjMgt_WriteData& theWriteData, const gp_Dir2d& theDir)
0104 {
0105   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0106 
0107   theWriteData << theDir.XY();
0108   return theWriteData;
0109 }
0110 
0111 inline StdObjMgt_ReadData& operator >>
0112   (StdObjMgt_ReadData& theReadData, gp_XYZ& theXYZ)
0113 {
0114   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0115 
0116   Standard_Real aX, aY, aZ;
0117   theReadData >> aX >> aY >> aZ;
0118   theXYZ.SetCoord(aX, aY, aZ);
0119   return theReadData;
0120 }
0121 
0122 inline StdObjMgt_WriteData& operator <<
0123   (StdObjMgt_WriteData& theWriteData, const gp_XYZ& theXYZ)
0124 {
0125   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0126 
0127   Standard_Real aX = theXYZ.X(), aY = theXYZ.Y(), aZ = theXYZ.Z();
0128   theWriteData << aX << aY << aZ;
0129   return theWriteData;
0130 }
0131 
0132 inline StdObjMgt_ReadData& operator >>
0133   (StdObjMgt_ReadData& theReadData, gp_Pnt& thePnt)
0134 {
0135   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0136 
0137   gp_XYZ aXYZ;
0138   theReadData >> aXYZ;
0139   thePnt.SetXYZ (aXYZ);
0140   return theReadData;
0141 }
0142 
0143 inline StdObjMgt_WriteData& operator <<
0144   (StdObjMgt_WriteData& theWriteData, const gp_Pnt& thePnt)
0145 {
0146   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0147 
0148   theWriteData << thePnt.XYZ();
0149   return theWriteData;
0150 }
0151 
0152 inline StdObjMgt_ReadData& operator >>
0153   (StdObjMgt_ReadData& theReadData, gp_Vec& theVec)
0154 {
0155   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0156 
0157   gp_XYZ aXYZ;
0158   theReadData >> aXYZ;
0159   theVec.SetXYZ (aXYZ);
0160   return theReadData;
0161 }
0162 
0163 inline StdObjMgt_WriteData& operator <<
0164   (StdObjMgt_WriteData& theWriteData, const gp_Vec& theVec)
0165 {
0166   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0167 
0168   theWriteData << theVec.XYZ();
0169   return theWriteData;
0170 }
0171 
0172 inline StdObjMgt_ReadData& operator >>
0173   (StdObjMgt_ReadData& theReadData, gp_Dir& theDir)
0174 {
0175   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0176 
0177   gp_XYZ aXYZ;
0178   theReadData >> aXYZ;
0179   theDir.SetXYZ(aXYZ);
0180   return theReadData;
0181 }
0182 
0183 inline StdObjMgt_WriteData& operator <<
0184   (StdObjMgt_WriteData& theWriteData, const gp_Dir& theDir)
0185 {
0186   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0187 
0188   theWriteData << theDir.XYZ();
0189   return theWriteData;
0190 }
0191 
0192 
0193 #endif