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_ComparisonTool_HeaderFile
0017 #define _TDF_ComparisonTool_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 class TDF_DataSet;
0025 class TDF_IDFilter;
0026 class TDF_RelocationTable;
0027 class TDF_Label;
0028 
0029 
0030 //! This class provides services to compare sets of
0031 //! information. The use of this tool can works after
0032 //! a copy, acted by a CopyTool.
0033 //!
0034 //! * Compare(...) compares two DataSet and returns the result.
0035 //!
0036 //! * SourceUnbound(...) builds the difference between
0037 //! a relocation dictionary and a source set of information.
0038 //!
0039 //! * TargetUnbound(...) does the same between a
0040 //! relocation dictionary and a target set of information.
0041 //!
0042 //! * Cut(aDataSet, anLabel) removes a set of attributes.
0043 //!
0044 //! * IsSelfContained(...) returns true if all the
0045 //! labels of the attributes of the given DataSet are
0046 //! descendant of the given label.
0047 class TDF_ComparisonTool 
0048 {
0049 public:
0050 
0051   DEFINE_STANDARD_ALLOC
0052 
0053   
0054   //! Compares <aSourceDataSet> with <aTargetDataSet>,
0055   //! updating <aRelocationTable> with labels and
0056   //! attributes found in both sets.
0057   Standard_EXPORT static void Compare (const Handle(TDF_DataSet)& aSourceDataSet, const Handle(TDF_DataSet)& aTargetDataSet, const TDF_IDFilter& aFilter, const Handle(TDF_RelocationTable)& aRelocationTable);
0058   
0059   //! Finds from <aRefDataSet> all the keys not bound
0060   //! into <aRelocationTable> and put them into
0061   //! <aDiffDataSet>. Returns True if the difference
0062   //! contains at least one key. (A key is a source
0063   //! object).
0064   //!
0065   //! <anOption> may take the following values:
0066   //! 1 : labels treatment only;
0067   //! 2 : attributes treatment only (default value);
0068   //! 3 : both labels & attributes treatment.
0069   Standard_EXPORT static Standard_Boolean SourceUnbound (const Handle(TDF_DataSet)& aRefDataSet, const Handle(TDF_RelocationTable)& aRelocationTable, const TDF_IDFilter& aFilter, const Handle(TDF_DataSet)& aDiffDataSet, const Standard_Integer anOption = 2);
0070   
0071   //! Substracts from <aRefDataSet> all the items bound
0072   //! into <aRelocationTable>. The result is put into
0073   //! <aDiffDataSet>. Returns True if the difference
0074   //! contains at least one item. (An item is a target
0075   //! object).
0076   //!
0077   //! <anOption> may take the following values:
0078   //! 1 : labels treatment only;
0079   //! 2 : attributes treatment  only(default value);
0080   //! 3 : both labels & attributes treatment.
0081   Standard_EXPORT static Standard_Boolean TargetUnbound (const Handle(TDF_DataSet)& aRefDataSet, const Handle(TDF_RelocationTable)& aRelocationTable, const TDF_IDFilter& aFilter, const Handle(TDF_DataSet)& aDiffDataSet, const Standard_Integer anOption = 2);
0082   
0083   //! Removes attributes from <aDataSet>.
0084   Standard_EXPORT static void Cut (const Handle(TDF_DataSet)& aDataSet);
0085   
0086   //! Returns true if all the labels of <aDataSet> are
0087   //! descendant of <aLabel>.
0088   Standard_EXPORT static Standard_Boolean IsSelfContained (const TDF_Label& aLabel, const Handle(TDF_DataSet)& aDataSet);
0089 
0090 
0091 
0092 
0093 protected:
0094 
0095 
0096 
0097 
0098 
0099 private:
0100 
0101   
0102   //! Internal comparison method used by Compare(...).
0103   Standard_EXPORT static void Compare (const TDF_Label& aSrcLabel, const TDF_Label& aTrgLabel, const Handle(TDF_DataSet)& aSourceDataSet, const Handle(TDF_DataSet)& aTargetDataSet, const TDF_IDFilter& aFilter, const Handle(TDF_RelocationTable)& aRelocationTable);
0104   
0105   //! Internal function used by SourceUnbound() and
0106   //! TargetUnbound().
0107   Standard_EXPORT static Standard_Boolean Unbound (const Handle(TDF_DataSet)& aRefDataSet, const Handle(TDF_RelocationTable)& aRelocationTable, const TDF_IDFilter& aFilter, const Handle(TDF_DataSet)& aDiffDataSet, const Standard_Integer anOption, const Standard_Boolean theSource);
0108 
0109 
0110 
0111 
0112 };
0113 
0114 
0115 
0116 
0117 
0118 
0119 
0120 #endif // _TDF_ComparisonTool_HeaderFile