1 // Created by: DAUTRY Philippe
2 // Copyright (c) 1997-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _TDocStd_XLinkRoot_HeaderFile
17 #define _TDocStd_XLinkRoot_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <TDocStd_XLinkPtr.hxx>
23 #include <TDF_Attribute.hxx>
24 #include <Standard_OStream.hxx>
25 class TDocStd_XLinkIterator;
29 class TDF_RelocationTable;
32 class TDocStd_XLinkRoot;
33 DEFINE_STANDARD_HANDLE(TDocStd_XLinkRoot, TDF_Attribute)
35 //! This attribute is the root of all external
36 //! references contained in a Data from TDF. Only one
37 //! instance of this class is added to the TDF_Data
38 //! root label. Starting from this attribute all the
39 //! Reference are linked together, to be found
41 class TDocStd_XLinkRoot : public TDF_Attribute
47 //! Returns the ID: 2a96b61d-ec8b-11d0-bee7-080009dc3333
48 Standard_EXPORT static const Standard_GUID& GetID();
50 //! Sets an empty XLinkRoot to Root or gets the
51 //! existing one. Only one attribute per TDF_Data.
52 Standard_EXPORT static Handle(TDocStd_XLinkRoot) Set (const Handle(TDF_Data)& aDF);
54 //! Inserts <anXLinkPtr> at the beginning of the XLink chain.
55 Standard_EXPORT static void Insert (const TDocStd_XLinkPtr& anXLinkPtr);
57 //! Removes <anXLinkPtr> from the XLink chain, if it exists.
58 Standard_EXPORT static void Remove (const TDocStd_XLinkPtr& anXLinkPtr);
60 //! Returns the ID of the attribute.
61 Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
63 //! Returns a null handle.
64 Standard_EXPORT Handle(TDF_Attribute) BackupCopy() const Standard_OVERRIDE;
67 Standard_EXPORT void Restore (const Handle(TDF_Attribute)& anAttribute) Standard_OVERRIDE;
69 //! Returns a null handle.
70 Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
73 Standard_EXPORT void Paste (const Handle(TDF_Attribute)& intoAttribute, const Handle(TDF_RelocationTable)& aRelocationTable) const Standard_OVERRIDE;
75 //! Dumps the attribute on <aStream>.
76 Standard_EXPORT Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
79 friend class TDocStd_XLinkIterator;
82 DEFINE_STANDARD_RTTIEXT(TDocStd_XLinkRoot,TDF_Attribute)
92 //! Initializes fields.
93 Standard_EXPORT TDocStd_XLinkRoot();
95 //! Sets the field <myFirst> with <anXLinkPtr>.
96 void First (const TDocStd_XLinkPtr& anXLinkPtr);
98 //! Returns the contents of the field <myFirst>.
99 TDocStd_XLinkPtr First() const;
101 TDocStd_XLinkPtr myFirst;
107 #include <TDocStd_XLinkRoot.lxx>
113 #endif // _TDocStd_XLinkRoot_HeaderFile