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