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 _TDF_CopyTool_HeaderFile
17 #define _TDF_CopyTool_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <Standard_Boolean.hxx>
24 #include <TDF_LabelDataMap.hxx>
25 #include <TDF_AttributeDataMap.hxx>
26 #include <TDF_LabelMap.hxx>
27 #include <TDF_AttributeMap.hxx>
29 class TDF_RelocationTable;
34 //! This class provides services to build, copy or
35 //! paste a set of information.
40 //! * Copy(aSourceDataSet, aTargetLabel,
41 //! aRelocationTable) copies a source DataSet under
42 //! its target place (see below: IMPORTANT NOTICE 1).
44 //! * Copy(aSourceDataSet, anTargetLabel,
45 //! aRelocationTable, aFilter) does the same job as
46 //! the previous method. But <aFilter> gives a list of
47 //! IDs for which a target attribute prevails over a
48 //! source one. In this special case, the source
49 //! attribute will be copied only if there will be no
52 //! IMPORTANT NOTICE : Label pre-binding
53 //! ------------------
55 //! For it is possible to copy root labels in another
56 //! place in the same Data or in a different one with
57 //! other tags, it is necessary to inform the Copy
58 //! algorithm about the target place. To do so:
60 //! * first get or create new target root labels;
62 //! * then bind them with the source root labels using
63 //! the relocation table method:
64 //! SetRelocation(aSourceLabel, aTargetLabel);
66 //! * finally call Copy(...) with the relocation table
67 //! previously set. In this way, this method will take
68 //! these relocations in account.
76 //! Copy <aSourceDataSet> with using and updating
77 //! <aRelocationTable>. This method ignores target
78 //! attributes privilege over source ones.
79 Standard_EXPORT static void Copy (const Handle(TDF_DataSet)& aSourceDataSet, const Handle(TDF_RelocationTable)& aRelocationTable);
81 //! Copy <aSourceDataSet> using and updating
82 //! <aRelocationTable>. Use <aPrivilegeFilter> to give
83 //! a list of IDs for which the target attribute
84 //! prevails over the source one.
85 Standard_EXPORT static void Copy (const Handle(TDF_DataSet)& aSourceDataSet, const Handle(TDF_RelocationTable)& aRelocationTable, const TDF_IDFilter& aPrivilegeFilter);
87 //! Copy <aSourceDataSet> using and updating
88 //! <aRelocationTable>. Use <aPrivilegeFilter> to give
89 //! a list of IDs for which the target attribute
90 //! prevails over the source one. If
91 //! <setSelfContained> is set to true, every
92 //! TDF_Reference will be replaced by the referenced
93 //! structure according to <aRefFilter>.
95 //! NB: <aRefFilter> is used only if
96 //! <setSelfContained> is true.
97 //! Internal root label copy recursive method.
98 Standard_EXPORT static void Copy (const Handle(TDF_DataSet)& aSourceDataSet, const Handle(TDF_RelocationTable)& aRelocationTable, const TDF_IDFilter& aPrivilegeFilter, const TDF_IDFilter& aRefFilter, const Standard_Boolean setSelfContained);
112 //! Internal root label copy recursive method.
113 Standard_EXPORT static void CopyLabels (const TDF_Label& aSLabel, TDF_Label& aTargetLabel, TDF_LabelDataMap& aLabMap, TDF_AttributeDataMap& aAttMap, const TDF_LabelMap& aSrcLabelMap, const TDF_AttributeMap& aSrcAttributeMap);
115 //! Internal attribute copy method.
116 Standard_EXPORT static void CopyAttributes (const TDF_Label& aSLabel, TDF_Label& aTargetLabel, TDF_AttributeDataMap& aAttMap, const TDF_AttributeMap& aSrcAttributeMap);
129 #endif // _TDF_CopyTool_HeaderFile