Back to home page

EIC code displayed by LXR

 
 

    


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

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 _TDF_CopyTool_HeaderFile
0017 #define _TDF_CopyTool_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <TDF_LabelDataMap.hxx>
0024 #include <TDF_AttributeDataMap.hxx>
0025 #include <TDF_LabelMap.hxx>
0026 #include <TDF_AttributeMap.hxx>
0027 class TDF_DataSet;
0028 class TDF_RelocationTable;
0029 class TDF_IDFilter;
0030 class TDF_Label;
0031 
0032 
0033 //! This class provides services to build, copy or
0034 //! paste a set of information.
0035 //!
0036 //! Copy methods:
0037 //! -------------
0038 //!
0039 //! * Copy(aSourceDataSet, aTargetLabel,
0040 //! aRelocationTable) copies a source DataSet under
0041 //! its target place (see below: IMPORTANT NOTICE 1).
0042 //!
0043 //! * Copy(aSourceDataSet, anTargetLabel,
0044 //! aRelocationTable, aFilter) does the same job as
0045 //! the previous method. But <aFilter> gives a list of
0046 //! IDs for which a target attribute prevails over a
0047 //! source one. In this special case, the source
0048 //! attribute will be copied only if there will be no
0049 //! target attribute.
0050 //!
0051 //! IMPORTANT NOTICE : Label pre-binding
0052 //! ------------------
0053 //!
0054 //! For it is possible to copy root labels in another
0055 //! place in the same Data or in a different one with
0056 //! other tags, it is necessary to inform the Copy
0057 //! algorithm about the target place. To do so:
0058 //!
0059 //! * first get or create new target root labels;
0060 //!
0061 //! * then bind them with the source root labels using
0062 //! the relocation table method:
0063 //! SetRelocation(aSourceLabel, aTargetLabel);
0064 //!
0065 //! * finally call Copy(...) with the relocation table
0066 //! previously set. In this way, this method will take
0067 //! these relocations in account.
0068 class TDF_CopyTool 
0069 {
0070 public:
0071 
0072   DEFINE_STANDARD_ALLOC
0073 
0074   
0075   //! Copy   <aSourceDataSet> with using  and  updating
0076   //! <aRelocationTable>. This  method ignores   target
0077   //! attributes privilege over source ones.
0078   Standard_EXPORT static void Copy (const Handle(TDF_DataSet)& aSourceDataSet, const Handle(TDF_RelocationTable)& aRelocationTable);
0079   
0080   //! Copy  <aSourceDataSet>  using      and updating
0081   //! <aRelocationTable>. Use <aPrivilegeFilter> to give
0082   //! a list  of   IDs for which  the target  attribute
0083   //! prevails over the source one.
0084   Standard_EXPORT static void Copy (const Handle(TDF_DataSet)& aSourceDataSet, const Handle(TDF_RelocationTable)& aRelocationTable, const TDF_IDFilter& aPrivilegeFilter);
0085   
0086   //! Copy    <aSourceDataSet>   using and    updating
0087   //! <aRelocationTable>. Use <aPrivilegeFilter> to give
0088   //! a  list of IDs   for which  the target  attribute
0089   //! prevails    over    the    source     one.   If
0090   //! <setSelfContained>   is   set  to   true,  every
0091   //! TDF_Reference will  be replaced  by the referenced
0092   //! structure according to <aRefFilter>.
0093   //!
0094   //! NB: <aRefFilter> is used only if
0095   //! <setSelfContained> is true.
0096   //! Internal root label copy recursive method.
0097   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);
0098 
0099 
0100 
0101 
0102 protected:
0103 
0104 
0105 
0106 
0107 
0108 private:
0109 
0110   
0111   //! Internal root label copy recursive method.
0112   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);
0113   
0114   //! Internal attribute copy method.
0115   Standard_EXPORT static void CopyAttributes (const TDF_Label& aSLabel, TDF_Label& aTargetLabel, TDF_AttributeDataMap& aAttMap, const TDF_AttributeMap& aSrcAttributeMap);
0116 
0117 
0118 
0119 
0120 };
0121 
0122 
0123 
0124 
0125 
0126 
0127 
0128 #endif // _TDF_CopyTool_HeaderFile