Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:21

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