|
||||
File indexing completed on 2025-01-18 10:05:21
0001 // Created on: 1998-05-12 0002 // Created by: Isabelle GRIGNON 0003 // Copyright (c) 1998-1999 Matra Datavision 0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS 0005 // 0006 // This file is part of Open CASCADE Technology software library. 0007 // 0008 // This library is free software; you can redistribute it and/or modify it under 0009 // the terms of the GNU Lesser General Public License version 2.1 as published 0010 // by the Free Software Foundation, with special exception defined in the file 0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0012 // distribution for complete text of the license and disclaimer of any warranty. 0013 // 0014 // Alternatively, this file may be used under the terms of Open CASCADE 0015 // commercial license or contractual agreement. 0016 0017 #ifndef _TDocStd_XLinkTool_HeaderFile 0018 #define _TDocStd_XLinkTool_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_DefineAlloc.hxx> 0022 #include <Standard_Handle.hxx> 0023 0024 #include <Standard_Boolean.hxx> 0025 class TDF_DataSet; 0026 class TDF_RelocationTable; 0027 class TDF_Label; 0028 0029 0030 //! This tool class is used to copy the content of 0031 //! source label under target label. Only child 0032 //! labels and attributes of source are copied. 0033 //! attributes located out of source scope are not 0034 //! copied by this algorithm. 0035 //! Depending of the called method an external 0036 //! reference is set in the target document to 0037 //! registered the externallink. 0038 //! Provide services to set, update and perform 0039 //! external references. 0040 //! Warning1: Nothing is provided in this class about the 0041 //! opportunity to copy, set a link or update it. 0042 //! Such decisions must be under application control. 0043 //! Warning2: If the document manages shapes, use after copy 0044 //! TNaming::ChangeShapes(target,M) to make copy of 0045 //! shapes. 0046 class TDocStd_XLinkTool 0047 { 0048 public: 0049 0050 DEFINE_STANDARD_ALLOC 0051 0052 0053 Standard_EXPORT TDocStd_XLinkTool(); 0054 0055 //! Copies the content of the label <fromsource> to the label <intarget>. 0056 //! The link is registered with an XLink attribute by <intarget> 0057 //! label. if the content of <fromsource> is not 0058 //! self-contained, and/or <intarget> has already an XLink 0059 //! attribute, an exception is raised. 0060 Standard_EXPORT void CopyWithLink (const TDF_Label& intarget, const TDF_Label& fromsource); 0061 0062 //! Update the external reference set at <L>. 0063 //! Example 0064 //! Handle(TDocStd_Document) aDoc; 0065 //! if 0066 //! (!OCAFTest::GetDocument(1,aDoc)) return 1; 0067 //! Handle(TDataStd_Reference) aRef; 0068 //! TDocStd_XLinkTool xlinktool; 0069 //! if 0070 //! (!OCAFTest::Find(aDoc,2),TDataStd_Reference::GetID(),aRef) return 1; 0071 //! xlinktool.UpdateLink(aRef->Label()); 0072 //! Exceptions 0073 //! Standard_DomainError if <L> has no XLink attribute. 0074 Standard_EXPORT void UpdateLink (const TDF_Label& L); 0075 0076 //! Copy the content of <fromsource> under 0077 //! <intarget>. No link is registered. No check is done. 0078 //! Example 0079 //! Handle(TDocStd_Document) DOC, XDOC; 0080 //! TDF_Label L, XL; 0081 //! TDocStd_XLinkTool xlinktool; 0082 //! xlinktool.Copy(L,XL); 0083 //! Exceptions: 0084 //! Standard_DomainError if the contents of 0085 //! fromsource are not entirely in the scope of this 0086 //! label, in other words, are not self-contained. 0087 //! !!! ==> Warning: 0088 //! If the document manages shapes use the next way: 0089 //! TDocStd_XLinkTool xlinktool; 0090 //! xlinktool.Copy(L,XL); 0091 //! TopTools_DataMapOfShapeShape M; 0092 //! TNaming::ChangeShapes(target,M); 0093 Standard_EXPORT virtual void Copy (const TDF_Label& intarget, const TDF_Label& fromsource); 0094 0095 Standard_EXPORT Standard_Boolean IsDone() const; 0096 0097 Standard_EXPORT Handle(TDF_DataSet) DataSet() const; 0098 0099 Standard_EXPORT Handle(TDF_RelocationTable) RelocationTable() const; 0100 0101 0102 0103 0104 protected: 0105 0106 0107 0108 Standard_Boolean isDone; 0109 0110 0111 private: 0112 0113 0114 0115 Handle(TDF_DataSet) myDS; 0116 Handle(TDF_RelocationTable) myRT; 0117 0118 0119 }; 0120 0121 0122 0123 0124 0125 0126 0127 #endif // _TDocStd_XLinkTool_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |