Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-03 08:36:48

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