Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-30 10:29:29

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 <NCollection_DataMap.hxx>
0021 
0022 #include <TopLoc_Datum3D.hxx>
0023 #include <TopLoc_Location.hxx>
0024 class Standard_Transient;
0025 class StdObjMgt_Persistent;
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) override;
0035     //! Write persistent data to a file.
0036     void Write(StdObjMgt_WriteData& theWriteData) const override;
0037 
0038     //! Gets persistent child objects
0039     void PChildren(SequenceOfPersistent&) const override {}
0040 
0041     //! Returns persistent type name
0042     const char* PName() const override { return "PTopLoc_Datum3D"; }
0043   };
0044 
0045   class ItemLocation : public StdObjMgt_Persistent
0046   {
0047     friend class StdPersistent_TopLoc;
0048 
0049   public:
0050     //! Read persistent data from a file.
0051     Standard_EXPORT void Read(StdObjMgt_ReadData& theReadData) override;
0052     //! Write persistent data to a file.
0053     Standard_EXPORT void Write(StdObjMgt_WriteData& theWriteData) const override;
0054     //! Gets persistent child objects
0055     Standard_EXPORT void PChildren(SequenceOfPersistent& theChildren) const override;
0056 
0057     //! Returns persistent type name
0058     const char* PName() const override { return "PTopLoc_ItemLocation"; }
0059 
0060     //! Import transient object from the persistent data.
0061     Standard_EXPORT TopLoc_Location Import() const;
0062 
0063   private:
0064     occ::handle<Datum3D> myDatum;
0065     int                  myPower;
0066     StdObject_Location   myNext;
0067   };
0068 
0069 public:
0070   Standard_EXPORT static occ::handle<ItemLocation> Translate(
0071     const TopLoc_Location& theLoc,
0072     NCollection_DataMap<occ::handle<Standard_Transient>, occ::handle<StdObjMgt_Persistent>>&
0073       theMap);
0074   Standard_EXPORT static occ::handle<Datum3D> Translate(
0075     const occ::handle<TopLoc_Datum3D>& theDatum,
0076     NCollection_DataMap<occ::handle<Standard_Transient>, occ::handle<StdObjMgt_Persistent>>&
0077       theMap);
0078 };
0079 
0080 #endif