Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 08:36:57

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_Curves_HeaderFile
0015 #define _StdObject_gp_Curves_HeaderFile
0016 
0017 #include <StdObject_gp_Axes.hxx>
0018 
0019 #include <gp_Lin2d.hxx>
0020 #include <gp_Circ2d.hxx>
0021 #include <gp_Elips2d.hxx>
0022 #include <gp_Hypr2d.hxx>
0023 #include <gp_Parab2d.hxx>
0024 #include <gp_Circ.hxx>
0025 #include <gp_Elips.hxx>
0026 #include <gp_Hypr.hxx>
0027 #include <gp_Parab.hxx>
0028 
0029 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Lin2d& theLin)
0030 {
0031   gp_Ax2d anAx;
0032   theReadData >> anAx;
0033   theLin.SetPosition(anAx);
0034   return theReadData;
0035 }
0036 
0037 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Lin2d& theLin)
0038 {
0039   const gp_Ax2d& anAx = theLin.Position();
0040   write(theWriteData, anAx);
0041   return theWriteData;
0042 }
0043 
0044 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Circ2d& theCirc)
0045 {
0046   gp_Ax22d      anAx;
0047   Standard_Real aRadius;
0048 
0049   theReadData >> anAx >> aRadius;
0050 
0051   theCirc.SetAxis(anAx);
0052   theCirc.SetRadius(aRadius);
0053 
0054   return theReadData;
0055 }
0056 
0057 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Circ2d& theCirc)
0058 {
0059   const gp_Ax22d& anAx    = theCirc.Position();
0060   Standard_Real   aRadius = theCirc.Radius();
0061   theWriteData << anAx << aRadius;
0062   return theWriteData;
0063 }
0064 
0065 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Elips2d& theElips)
0066 {
0067   gp_Ax22d      anAx;
0068   Standard_Real aMajorRadius, aMinorRadius;
0069 
0070   theReadData >> anAx >> aMajorRadius >> aMinorRadius;
0071 
0072   theElips.SetAxis(anAx);
0073   theElips.SetMajorRadius(aMajorRadius);
0074   theElips.SetMinorRadius(aMinorRadius);
0075 
0076   return theReadData;
0077 }
0078 
0079 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData,
0080                                        const gp_Elips2d&    theElips)
0081 {
0082   const gp_Ax22d& anAx         = theElips.Axis();
0083   Standard_Real   aMajorRadius = theElips.MajorRadius();
0084   Standard_Real   aMinorRadius = theElips.MinorRadius();
0085   theWriteData << anAx << aMajorRadius << aMinorRadius;
0086   return theWriteData;
0087 }
0088 
0089 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Hypr2d& theHypr)
0090 {
0091   gp_Ax22d      anAx;
0092   Standard_Real aMajorRadius, aMinorRadius;
0093 
0094   theReadData >> anAx >> aMajorRadius >> aMinorRadius;
0095 
0096   theHypr.SetAxis(anAx);
0097   theHypr.SetMajorRadius(aMajorRadius);
0098   theHypr.SetMinorRadius(aMinorRadius);
0099 
0100   return theReadData;
0101 }
0102 
0103 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Hypr2d& theHypr)
0104 {
0105   const gp_Ax22d& anAx         = theHypr.Axis();
0106   Standard_Real   aMajorRadius = theHypr.MajorRadius();
0107   Standard_Real   aMinorRadius = theHypr.MinorRadius();
0108   theWriteData << anAx << aMajorRadius << aMinorRadius;
0109   return theWriteData;
0110 }
0111 
0112 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Parab2d& theParab)
0113 {
0114   gp_Ax22d      anAx;
0115   Standard_Real aFocalLength;
0116 
0117   theReadData >> anAx >> aFocalLength;
0118 
0119   theParab.SetAxis(anAx);
0120   theParab.SetFocal(aFocalLength);
0121 
0122   return theReadData;
0123 }
0124 
0125 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData,
0126                                        const gp_Parab2d&    theParab)
0127 {
0128   const gp_Ax22d& anAx         = theParab.Axis();
0129   Standard_Real   aFocalLength = theParab.Focal();
0130   theWriteData << anAx << aFocalLength;
0131   return theWriteData;
0132 }
0133 
0134 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Lin& theLin)
0135 {
0136   gp_Ax1 anAx;
0137   theReadData >> anAx;
0138   theLin.SetPosition(anAx);
0139   return theReadData;
0140 }
0141 
0142 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Lin& theLin)
0143 {
0144   const gp_Ax1& anAx = theLin.Position();
0145   write(theWriteData, anAx);
0146   return theWriteData;
0147 }
0148 
0149 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Circ& theCirc)
0150 {
0151   gp_Ax2        anAx;
0152   Standard_Real aRadius;
0153 
0154   theReadData >> anAx >> aRadius;
0155 
0156   theCirc.SetPosition(anAx);
0157   theCirc.SetRadius(aRadius);
0158 
0159   return theReadData;
0160 }
0161 
0162 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Circ& theCirc)
0163 {
0164   const gp_Ax2& anAx    = theCirc.Position();
0165   Standard_Real aRadius = theCirc.Radius();
0166   theWriteData << anAx << aRadius;
0167   return theWriteData;
0168 }
0169 
0170 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Elips& theElips)
0171 {
0172   gp_Ax2        anAx;
0173   Standard_Real aMajorRadius, aMinorRadius;
0174 
0175   theReadData >> anAx >> aMajorRadius >> aMinorRadius;
0176 
0177   theElips.SetPosition(anAx);
0178   theElips.SetMajorRadius(aMajorRadius);
0179   theElips.SetMinorRadius(aMinorRadius);
0180 
0181   return theReadData;
0182 }
0183 
0184 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Elips& theElips)
0185 {
0186   const gp_Ax2& anAx         = theElips.Position();
0187   Standard_Real aMajorRadius = theElips.MajorRadius();
0188   Standard_Real aMinorRadius = theElips.MinorRadius();
0189   theWriteData << anAx << aMajorRadius << aMinorRadius;
0190   return theWriteData;
0191 }
0192 
0193 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Hypr& theHypr)
0194 {
0195   gp_Ax2        anAx;
0196   Standard_Real aMajorRadius, aMinorRadius;
0197 
0198   theReadData >> anAx >> aMajorRadius >> aMinorRadius;
0199 
0200   theHypr.SetPosition(anAx);
0201   theHypr.SetMajorRadius(aMajorRadius);
0202   theHypr.SetMinorRadius(aMinorRadius);
0203 
0204   return theReadData;
0205 }
0206 
0207 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Hypr& theHypr)
0208 {
0209   const gp_Ax2& anAx         = theHypr.Position();
0210   Standard_Real aMajorRadius = theHypr.MajorRadius();
0211   Standard_Real aMinorRadius = theHypr.MinorRadius();
0212   theWriteData << anAx << aMajorRadius << aMinorRadius;
0213   return theWriteData;
0214 }
0215 
0216 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, gp_Parab& theParab)
0217 {
0218   gp_Ax2        anAx;
0219   Standard_Real aFocalLength;
0220 
0221   theReadData >> anAx >> aFocalLength;
0222 
0223   theParab.SetPosition(anAx);
0224   theParab.SetFocal(aFocalLength);
0225 
0226   return theReadData;
0227 }
0228 
0229 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData& theWriteData, const gp_Parab& theParab)
0230 {
0231   const gp_Ax2& anAx         = theParab.Position();
0232   Standard_Real aFocalLength = theParab.Focal();
0233   theWriteData << anAx << aFocalLength;
0234   return theWriteData;
0235 }
0236 
0237 #endif