From f5b7a266ca88d52e209475f4d8cbf9bddb609d5d Mon Sep 17 00:00:00 2001 From: dpasukhi Date: Thu, 22 Apr 2021 22:40:44 +0300 Subject: [PATCH] 0032186: PMI Visualization - PMIImportSavedView ignores assigned pmi Fixed invalid setting View Annotations & Notes links were ignored by XCAF --- src/XCAFDoc/XCAFDoc_ViewTool.cxx | 22 +++++++++++----------- src/XDEDRAW/XDEDRAW.cxx | 6 ++++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/XCAFDoc/XCAFDoc_ViewTool.cxx b/src/XCAFDoc/XCAFDoc_ViewTool.cxx index 58c5f8baa3..9750398913 100644 --- a/src/XCAFDoc/XCAFDoc_ViewTool.cxx +++ b/src/XCAFDoc/XCAFDoc_ViewTool.cxx @@ -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); diff --git a/src/XDEDRAW/XDEDRAW.cxx b/src/XDEDRAW/XDEDRAW.cxx index 0d3b11181b..0267c7b7a2 100644 --- a/src/XDEDRAW/XDEDRAW.cxx +++ b/src/XDEDRAW/XDEDRAW.cxx @@ -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); -- 2.39.5