Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-14 08:30:04

0001 // Created by: DAUTRY Philippe
0002 // Copyright (c) 1997-1999 Matra Datavision
0003 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _TDocStd_XLinkRoot_HeaderFile
0017 #define _TDocStd_XLinkRoot_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021 
0022 #include <TDocStd_XLinkPtr.hxx>
0023 #include <TDF_Attribute.hxx>
0024 #include <Standard_OStream.hxx>
0025 class Standard_GUID;
0026 class TDF_Data;
0027 class TDF_RelocationTable;
0028 
0029 class TDocStd_XLinkRoot;
0030 DEFINE_STANDARD_HANDLE(TDocStd_XLinkRoot, TDF_Attribute)
0031 
0032 //! This attribute is the root of all external
0033 //! references contained in a Data from TDF. Only one
0034 //! instance of this class is added to the TDF_Data
0035 //! root label. Starting from this attribute all the
0036 //! Reference are linked together, to be found easily.
0037 class TDocStd_XLinkRoot : public TDF_Attribute
0038 {
0039 
0040 public:
0041   //! Returns the ID: 2a96b61d-ec8b-11d0-bee7-080009dc3333
0042   Standard_EXPORT static const Standard_GUID& GetID();
0043 
0044   //! Sets an empty XLinkRoot to Root or gets the
0045   //! existing one. Only one attribute per TDF_Data.
0046   Standard_EXPORT static Handle(TDocStd_XLinkRoot) Set(const Handle(TDF_Data)& aDF);
0047 
0048   //! Inserts <anXLinkPtr> at the beginning of the XLink chain.
0049   Standard_EXPORT static void Insert(const TDocStd_XLinkPtr& anXLinkPtr);
0050 
0051   //! Removes <anXLinkPtr> from the XLink chain, if it exists.
0052   Standard_EXPORT static void Remove(const TDocStd_XLinkPtr& anXLinkPtr);
0053 
0054   //! Returns the ID of the attribute.
0055   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
0056 
0057   //! Returns a null handle.
0058   Standard_EXPORT Handle(TDF_Attribute) BackupCopy() const Standard_OVERRIDE;
0059 
0060   //! Does nothing.
0061   Standard_EXPORT void Restore(const Handle(TDF_Attribute)& anAttribute) Standard_OVERRIDE;
0062 
0063   //! Returns a null handle.
0064   Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
0065 
0066   //! Does nothing.
0067   Standard_EXPORT void Paste(const Handle(TDF_Attribute)&       intoAttribute,
0068                              const Handle(TDF_RelocationTable)& aRelocationTable) const
0069     Standard_OVERRIDE;
0070 
0071   //! Dumps the attribute on <aStream>.
0072   Standard_EXPORT Standard_OStream& Dump(Standard_OStream& anOS) const Standard_OVERRIDE;
0073 
0074   friend class TDocStd_XLinkIterator;
0075 
0076   DEFINE_STANDARD_RTTIEXT(TDocStd_XLinkRoot, TDF_Attribute)
0077 
0078 protected:
0079 private:
0080   //! Initializes fields.
0081   Standard_EXPORT TDocStd_XLinkRoot();
0082 
0083   //! Sets the field <myFirst> with <anXLinkPtr>.
0084   void First(const TDocStd_XLinkPtr& anXLinkPtr);
0085 
0086   //! Returns the contents of the field <myFirst>.
0087   TDocStd_XLinkPtr First() const;
0088 
0089   TDocStd_XLinkPtr myFirst;
0090 };
0091 
0092 #include <TDocStd_XLinkRoot.lxx>
0093 
0094 #endif // _TDocStd_XLinkRoot_HeaderFile