Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:29:41

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_XLink_HeaderFile
0017 #define _TDocStd_XLink_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 
0021 #include <TCollection_AsciiString.hxx>
0022 #include <TDocStd_XLinkPtr.hxx>
0023 #include <TDF_Attribute.hxx>
0024 #include <Standard_OStream.hxx>
0025 class TDF_Label;
0026 class TDF_Reference;
0027 class Standard_GUID;
0028 class TDF_AttributeDelta;
0029 class TDF_RelocationTable;
0030 
0031 //! An attribute to store the path and the entry of
0032 //! external links.
0033 //! These refer from one data structure to a data
0034 //! structure in another document.
0035 class TDocStd_XLink : public TDF_Attribute
0036 {
0037 
0038 public:
0039   //! Sets an empty external reference, at the label aLabel.
0040   Standard_EXPORT static occ::handle<TDocStd_XLink> Set(const TDF_Label& atLabel);
0041 
0042   //! Initializes fields.
0043   Standard_EXPORT TDocStd_XLink();
0044 
0045   //! Updates the data referenced in this external link attribute.
0046   Standard_EXPORT occ::handle<TDF_Reference> Update();
0047 
0048   //! Returns the ID of the attribute.
0049   Standard_EXPORT const Standard_GUID& ID() const override;
0050 
0051   //! Returns the GUID for external links.
0052   Standard_EXPORT static const Standard_GUID& GetID();
0053 
0054   //! Sets the name aDocEntry for the external
0055   //! document in this external link attribute.
0056   Standard_EXPORT void DocumentEntry(const TCollection_AsciiString& aDocEntry);
0057 
0058   //! Returns the contents of the document identified by aDocEntry.
0059   //! aDocEntry provides external data to this external link attribute.
0060   Standard_EXPORT const TCollection_AsciiString& DocumentEntry() const;
0061 
0062   //! Sets the label entry for this external link attribute with the label aLabel.
0063   //! aLabel pilots the importation of data from the document entry.
0064   Standard_EXPORT void LabelEntry(const TDF_Label& aLabel);
0065 
0066   //! Sets the label entry for this external link attribute
0067   //! as a document identified by aLabEntry.
0068   Standard_EXPORT void LabelEntry(const TCollection_AsciiString& aLabEntry);
0069 
0070   //! Returns the contents of the field <myLabelEntry>.
0071   Standard_EXPORT const TCollection_AsciiString& LabelEntry() const;
0072 
0073   //! Updates the XLinkRoot attribute by adding <me>
0074   //! to its list.
0075   Standard_EXPORT void AfterAddition() override;
0076 
0077   //! Updates the XLinkRoot attribute by removing <me>
0078   //! from its list.
0079   Standard_EXPORT void BeforeRemoval() override;
0080 
0081   //! Something to do before applying <anAttDelta>.
0082   Standard_EXPORT bool BeforeUndo(const occ::handle<TDF_AttributeDelta>& anAttDelta,
0083                                   const bool                             forceIt = false) override;
0084 
0085   //! Something to do after applying <anAttDelta>.
0086   Standard_EXPORT bool AfterUndo(const occ::handle<TDF_AttributeDelta>& anAttDelta,
0087                                  const bool                             forceIt = false) override;
0088 
0089   //! Returns a null handle. Raise always for it is
0090   //! nonsense to use this method.
0091   Standard_EXPORT occ::handle<TDF_Attribute> BackupCopy() const override;
0092 
0093   //! Does nothing.
0094   Standard_EXPORT void Restore(const occ::handle<TDF_Attribute>& anAttribute) override;
0095 
0096   //! Returns a null handle.
0097   Standard_EXPORT occ::handle<TDF_Attribute> NewEmpty() const override;
0098 
0099   //! Does nothing.
0100   Standard_EXPORT void Paste(
0101     const occ::handle<TDF_Attribute>&       intoAttribute,
0102     const occ::handle<TDF_RelocationTable>& aRelocationTable) const override;
0103 
0104   //! Dumps the attribute on <aStream>.
0105   Standard_EXPORT Standard_OStream& Dump(Standard_OStream& anOS) const override;
0106 
0107   friend class TDocStd_XLinkRoot;
0108   friend class TDocStd_XLinkIterator;
0109 
0110   DEFINE_STANDARD_RTTIEXT(TDocStd_XLink, TDF_Attribute)
0111 
0112 private:
0113   //! Sets the field <myNext> with <anXLinkPtr>.
0114   void Next(const TDocStd_XLinkPtr& anXLinkPtr);
0115 
0116   //! Returns the contents of the field <myNext>.
0117   TDocStd_XLinkPtr Next() const;
0118 
0119   TCollection_AsciiString myDocEntry;
0120   TCollection_AsciiString myLabelEntry;
0121   TDocStd_XLinkPtr        myNext;
0122 };
0123 
0124 #include <TDocStd_XLink.lxx>
0125 
0126 #endif // _TDocStd_XLink_HeaderFile