1 // Copyright (c) 2015 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #ifndef _StdPersistent_TopLoc_HeaderFile
16 #define _StdPersistent_TopLoc_HeaderFile
18 #include <StdObjMgt_SharedObject.hxx>
19 #include <StdObjMgt_Persistent.hxx>
20 #include <StdObject_Location.hxx>
21 #include <StdObjMgt_TransientPersistentMap.hxx>
23 #include <TopLoc_Datum3D.hxx>
24 #include <TopLoc_Location.hxx>
27 class StdPersistent_TopLoc
30 class Datum3D : public StdObjMgt_SharedObject::SharedBase<TopLoc_Datum3D>
33 //! Read persistent data from a file.
34 void Read (StdObjMgt_ReadData& theReadData);
35 //! Write persistent data to a file.
36 void Write (StdObjMgt_WriteData& theWriteData) const;
37 //! Gets persistent child objects
38 virtual void PChildren(SequenceOfPersistent&) const { }
39 //! Returns persistent type name
40 virtual Standard_CString PName () const
41 { return "PTopLoc_Datum3D"; }
44 class ItemLocation : public StdObjMgt_Persistent
46 friend class StdPersistent_TopLoc;
49 //! Read persistent data from a file.
50 Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData);
51 //! Write persistent data to a file.
52 Standard_EXPORT virtual void Write (StdObjMgt_WriteData& theWriteData) const;
53 //! Gets persistent child objects
54 Standard_EXPORT virtual void PChildren(SequenceOfPersistent& theChildren) const;
55 //! Returns persistent type name
56 virtual Standard_CString PName () const
57 { return "PTopLoc_ItemLocation"; }
59 //! Import transient object from the persistent data.
60 Standard_EXPORT TopLoc_Location Import() const;
63 Handle(Datum3D) myDatum;
64 Standard_Integer myPower;
65 StdObject_Location myNext;
69 Standard_EXPORT static Handle(ItemLocation) Translate (const TopLoc_Location& theLoc,
70 StdObjMgt_TransientPersistentMap& theMap);
71 Standard_EXPORT static Handle(Datum3D) Translate (const Handle(TopLoc_Datum3D)& theDatum,
72 StdObjMgt_TransientPersistentMap& theMap);