// Created on: 1999-06-24 // Created by: Sergey ZARITCHNY // Copyright (c) 1999-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and / or modify it // under the terms of the GNU Lesser General Public version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // The bug concerns the COPY operation of some attributes of a non-self-contained label. // The attributes making the label non-self-contained are not involved by the operation. // Therefore, these attributes shouldn't be considered by the COPY mechanism and // the label should be considered as a self-contained. // Correction of the bug consists of ignoring the attributes not involved by the COPY operation. #define BUC60813 //======================================================================= //function : TDF_CopyLabel //purpose : //======================================================================= TDF_CopyLabel::TDF_CopyLabel() :myFilter(Standard_False), myIsDone(Standard_False) { mySL.Nullify(); myTL.Nullify(); } //======================================================================= //function : TDF_CopyLabel //purpose : //======================================================================= TDF_CopyLabel::TDF_CopyLabel(const TDF_Label& aSource,const TDF_Label& aTarget ) :myFilter(Standard_False), myIsDone(Standard_False) { mySL = aSource; myTL = aTarget; } //======================================================================= //function : Load //purpose : //======================================================================= void TDF_CopyLabel::Load(const TDF_Label& aSource, const TDF_Label& aTarget) { mySL = aSource; myTL = aTarget; } //======================================================================= //function : ExternalReferences //purpose : internal //======================================================================= void TDF_CopyLabel::ExternalReferences(const TDF_Label& aRefLabel, const TDF_Label& aLabel, TDF_AttributeMap& aExternals, const TDF_IDFilter& aFilter, Handle(TDF_DataSet)& ds) { // TCollection_AsciiString entr1,entr2; //d for (TDF_AttributeIterator itr(aLabel); itr.More(); itr.Next()) { itr.Value()->References(ds); const TDF_AttributeMap& attMap = ds->Attributes(); //attMap // TDF_Tool::Entry(itr.Value()->Label(), entr1); //d // cout<<"\tSource Attribute dynamic type = "<DynamicType()<<" Label = "<Label(), entr1); // cout<<"\t\tReferences attribute dynamic type = "<DynamicType()<<" Label = "<Label().IsNull()) { if (aFilter.IsKept(att) && att->Label().IsDifferent(aRefLabel) && !att->Label().IsDescendant(aRefLabel)) { aExternals.Add(att); } } } // const TDF_LabelMap& labMap = ds->Labels(); // for (TDF_MapIteratorOfLabelMap labMItr(labMap);labMItr.More(); labMItr.Next()) { // TDF_Tool::Entry(labMItr.Key(), entr1); // cout<<"\t\tLABELS from DS of Attr:: Lab = "<AddLabel(mySL); myRT->SetRelocation(mySL, myTL); TDF_ClosureTool::Closure(ds, myFilter, mode); if(extReferers) { for (TDF_MapIteratorOfAttributeMap attMItr(myMapOfExt);attMItr.More(); attMItr.Next()) { Handle(TDF_Attribute) att = attMItr.Key(); myRT->SetRelocation(att, att); #ifdef DEB PrintEntry(att->Label(), Standard_True); #endif } } TDF_CopyTool::Copy(ds,myRT); myIsDone = Standard_True; } //======================================================================= //function : RelocationTable //purpose : //======================================================================= const Handle(TDF_RelocationTable)& TDF_CopyLabel::RelocationTable() const { return myRT; } //======================================================================= //function : UseFilter //purpose : //======================================================================= void TDF_CopyLabel::UseFilter(const TDF_IDFilter& aFilter) { myFilter = aFilter; }