Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-31 08:31:10

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_Shape_HeaderFile
0015 #define _StdObject_Shape_HeaderFile
0016 
0017 #include <StdObject_Location.hxx>
0018 #include <StdPersistent_TopoDS.hxx>
0019 
0020 #include <TopoDS_Shape.hxx>
0021 
0022 class StdObject_Shape
0023 {
0024   friend class ShapePersistent_TopoDS;
0025 
0026 public:
0027   //! Empty constructor.
0028   StdObject_Shape()
0029       : myOrient(0)
0030   {
0031   }
0032 
0033   //! Import transient object from the persistent data.
0034   Standard_EXPORT TopoDS_Shape Import() const;
0035 
0036   Standard_EXPORT void PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const;
0037 
0038 protected:
0039   //! Read persistent data from a file.
0040   inline void read(StdObjMgt_ReadData& theReadData)
0041   {
0042     theReadData >> myTShape >> myLocation >> myOrient;
0043   }
0044 
0045   //! Write persistent data to a file.
0046   inline void write(StdObjMgt_WriteData& theWriteData) const
0047   {
0048     theWriteData << myTShape << myLocation << myOrient;
0049   }
0050 
0051 protected:
0052   Handle(StdPersistent_TopoDS::TShape) myTShape;
0053   StdObject_Location                   myLocation;
0054   Standard_Integer                     myOrient;
0055 
0056   friend StdObjMgt_ReadData&  operator>>(StdObjMgt_ReadData&, StdObject_Shape&);
0057   friend StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData&, const StdObject_Shape&);
0058 };
0059 
0060 //! Read persistent data from a file.
0061 inline StdObjMgt_ReadData& operator>>(StdObjMgt_ReadData& theReadData, StdObject_Shape& theShape)
0062 {
0063   StdObjMgt_ReadData::ObjectSentry aSentry(theReadData);
0064   theShape.read(theReadData);
0065   return theReadData;
0066 }
0067 
0068 //! Write persistent data to a file.
0069 inline StdObjMgt_WriteData& operator<<(StdObjMgt_WriteData&   theWriteData,
0070                                        const StdObject_Shape& theShape)
0071 {
0072   StdObjMgt_WriteData::ObjectSentry aSentry(theWriteData);
0073   theShape.write(theWriteData);
0074   return theWriteData;
0075 }
0076 
0077 #endif