+// copies named shapes: we need the implementation of this
+static void CopyNS(const Handle(TNaming_NamedShape)& theFrom,
+ const Handle(TDF_Attribute)& theTo)
+{
+ TDF_Label aLab = theTo->Label();
+ TNaming_Builder B(aLab);
+
+ // TNaming_Iterator iterates in reversed way than it was put in Builder, so, keep it in container
+ // and iterate from end to begin
+ NCollection_List<TopoDS_Shape> aOlds;
+ NCollection_List<TopoDS_Shape> aNews;
+ NCollection_List<TNaming_Evolution> aStatuses;
+
+ TNaming_Iterator anIt (theFrom);
+ for ( ;anIt.More() ; anIt.Next()) {
+ aOlds.Prepend(anIt.OldShape());
+ aNews.Prepend(anIt.NewShape());
+ aStatuses.Prepend(anIt.Evolution());
+ }
+
+ NCollection_List<TopoDS_Shape>::Iterator aOldIter(aOlds);
+ NCollection_List<TopoDS_Shape>::Iterator aNewIter(aNews);
+ NCollection_List<TNaming_Evolution>::Iterator aStatIter(aStatuses);
+ for(; aOldIter.More(); aOldIter.Next(), aNewIter.Next(), aStatIter.Next()) {
+ switch (aStatIter.Value()) {
+ case TNaming_PRIMITIVE :
+ B.Generated(aNewIter.Value());
+ break;
+ case TNaming_GENERATED :
+ B.Generated(aOldIter.Value(), aNewIter.Value());
+ break;
+ case TNaming_MODIFY :
+ B.Modify(aOldIter.Value(), aNewIter.Value());
+ break;
+ case TNaming_DELETE :
+ B.Delete (aOldIter.Value());
+ break;
+ case TNaming_SELECTED :
+ B.Select(aNewIter.Value(), aOldIter.Value());
+ break;
+ default:
+ break;
+ }
+ }
+}
+