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 _StdPersistent_TopLoc_HeaderFile
0016 #define _StdPersistent_TopLoc_HeaderFile
0017 
0018 #include <StdObjMgt_SharedObject.hxx>
0019 #include <StdObjMgt_Persistent.hxx>
0020 #include <StdObject_Location.hxx>
0021 #include <StdObjMgt_TransientPersistentMap.hxx>
0022 
0023 #include <TopLoc_Datum3D.hxx>
0024 #include <TopLoc_Location.hxx>
0025 
0026 
0027 class StdPersistent_TopLoc
0028 {
0029 public:
0030   class Datum3D : public StdObjMgt_SharedObject::SharedBase<TopLoc_Datum3D>
0031   {
0032   public:
0033     //! Read persistent data from a file.
0034     void Read (StdObjMgt_ReadData& theReadData);
0035     //! Write persistent data to a file.
0036     void Write (StdObjMgt_WriteData& theWriteData) const;
0037     //! Gets persistent child objects
0038     virtual void PChildren(SequenceOfPersistent&) const { }
0039     //! Returns persistent type name
0040     virtual Standard_CString PName () const
0041       { return "PTopLoc_Datum3D"; }
0042   };
0043 
0044   class ItemLocation : public StdObjMgt_Persistent
0045   {
0046     friend class StdPersistent_TopLoc;
0047 
0048   public:
0049     //! Read persistent data from a file.
0050     Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData);
0051     //! Write persistent data to a file.
0052     Standard_EXPORT virtual void Write (StdObjMgt_WriteData& theWriteData) const;
0053     //! Gets persistent child objects
0054     Standard_EXPORT virtual void PChildren(SequenceOfPersistent& theChildren) const;
0055     //! Returns persistent type name
0056     virtual Standard_CString PName () const
0057       { return "PTopLoc_ItemLocation"; }
0058 
0059     //! Import transient object from the persistent data.
0060     Standard_EXPORT TopLoc_Location Import() const;
0061 
0062   private:
0063     Handle(Datum3D)    myDatum;
0064     Standard_Integer   myPower;
0065     StdObject_Location myNext;
0066   };
0067 
0068 public:
0069   Standard_EXPORT static Handle(ItemLocation) Translate (const TopLoc_Location& theLoc,
0070                                                          StdObjMgt_TransientPersistentMap& theMap);
0071   Standard_EXPORT static Handle(Datum3D) Translate (const Handle(TopLoc_Datum3D)& theDatum,
0072                                                     StdObjMgt_TransientPersistentMap& theMap);
0073 };
0074 
0075 #endif