]> OCCT Git - occt-copy.git/commitdiff
0032186: PMI Visualization - PMIImportSavedView ignores assigned pmi CR32186
authordpasukhi <dpasukhi@opencascade.com>
Thu, 22 Apr 2021 19:40:44 +0000 (22:40 +0300)
committerdpasukhi <dpasukhi@opencascade.com>
Thu, 22 Apr 2021 19:45:26 +0000 (22:45 +0300)
Fixed invalid setting View
Annotations & Notes links were ignored by XCAF

src/XCAFDoc/XCAFDoc_ViewTool.cxx
src/XDEDRAW/XDEDRAW.cxx

index 58c5f8baa3b0847e16185678e2ba7a24f0c4ef18..9750398913292a68964356b1daa209051ace8780 100644 (file)
@@ -167,19 +167,19 @@ void XCAFDoc_ViewTool::SetView(const TDF_LabelSequence& theShapes,
   }
   if (theViewL.FindAttribute(XCAFDoc::ViewRefNoteGUID(), aChGNode)) {
     while (aChGNode->NbFathers() > 0) {
-      aPlaneGNode = aChGNode->GetFather(1);
-      aPlaneGNode->UnSetChild(aChGNode);
-      if (aPlaneGNode->NbChildren() == 0)
-        aPlaneGNode->ForgetAttribute(XCAFDoc::ViewRefNoteGUID());
+      aNoteGNode = aChGNode->GetFather(1);
+      aNoteGNode->UnSetChild(aChGNode);
+      if (aNoteGNode->NbChildren() == 0)
+        aNoteGNode->ForgetAttribute(XCAFDoc::ViewRefNoteGUID());
     }
     theViewL.ForgetAttribute(XCAFDoc::ViewRefNoteGUID());
   }
   if (theViewL.FindAttribute(XCAFDoc::ViewRefAnnotationGUID(), aChGNode)) {
     while (aChGNode->NbFathers() > 0) {
-      aPlaneGNode = aChGNode->GetFather(1);
-      aPlaneGNode->UnSetChild(aChGNode);
-      if (aPlaneGNode->NbChildren() == 0)
-        aPlaneGNode->ForgetAttribute(XCAFDoc::ViewRefAnnotationGUID());
+      aAnnotGNode = aChGNode->GetFather(1);
+      aAnnotGNode->UnSetChild(aChGNode);
+      if (aAnnotGNode->NbChildren() == 0)
+        aAnnotGNode->ForgetAttribute(XCAFDoc::ViewRefAnnotationGUID());
     }
     theViewL.ForgetAttribute(XCAFDoc::ViewRefAnnotationGUID());
   }
@@ -235,7 +235,7 @@ void XCAFDoc_ViewTool::SetView(const TDF_LabelSequence& theShapes,
   if (!theViewL.FindAttribute(XCAFDoc::ViewRefNoteGUID(), aChGNode) && theNotes.Length() > 0) {
     aChGNode = new XCAFDoc_GraphNode;
     aChGNode = XCAFDoc_GraphNode::Set(theViewL);
-    aChGNode->SetGraphID(XCAFDoc::ViewRefPlaneGUID());
+    aChGNode->SetGraphID(XCAFDoc::ViewRefNoteGUID());
   }
   for (Standard_Integer i = theNotes.Lower(); i <= theNotes.Upper(); i++)
   {
@@ -255,9 +255,9 @@ void XCAFDoc_ViewTool::SetView(const TDF_LabelSequence& theShapes,
   }
   for (Standard_Integer i = theAnnotations.Lower(); i <= theAnnotations.Upper(); i++)
   {
-    if (!theAnnotations.Value(i).FindAttribute(XCAFDoc::ViewRefAnnotationGUID(), aNoteGNode)) {
+    if (!theAnnotations.Value(i).FindAttribute(XCAFDoc::ViewRefAnnotationGUID(), aAnnotGNode)) {
       aAnnotGNode = new XCAFDoc_GraphNode;
-      aAnnotGNode = XCAFDoc_GraphNode::Set(theNotes.Value(i));
+      aAnnotGNode = XCAFDoc_GraphNode::Set(theAnnotations.Value(i));
     }
     aAnnotGNode->SetGraphID(XCAFDoc::ViewRefAnnotationGUID());
     aAnnotGNode->SetChild(aChGNode);
index 0d3b11181b413c4f8800fe40a287a2ed5954f269..0267c7b7a266fa275d07a27b1ebd74366830a49f 100644 (file)
@@ -1134,6 +1134,12 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
     else if (att->ID() == XCAFDoc::ViewRefPlaneGUID()) {
       type = "View Clipping Plane Link";
     }
+    else if (att->ID() == XCAFDoc::ViewRefNoteGUID()) {
+      type = "View Note Link";
+    }
+    else if (att->ID() == XCAFDoc::ViewRefAnnotationGUID()) {
+      type = "View Annotation Link";
+    }
     else return 0;
 
     Handle(XCAFDoc_GraphNode) DETGN = Handle(XCAFDoc_GraphNode)::DownCast(att);