aChGNode->SetFather(aPlaneGNode);
}
}
+
+//=======================================================================
+//function : SetSections
+//purpose :
+//=======================================================================
+void XCAFDoc_ViewTool::SetSections(const TDF_LabelSequence& theSectionsLabels,
+ const TDF_Label& theViewL) const
+{
+ if (!IsView(theViewL))
+ return;
+
+ Handle(XCAFDoc_GraphNode) aChGNode;
+ Handle(XCAFDoc_GraphNode) aSectionGNode;
+
+ if (theViewL.FindAttribute(XCAFDoc::ViewRefSectionGUID(), aChGNode)) {
+ while (aChGNode->NbFathers() > 0) {
+ aSectionGNode = aChGNode->GetFather(1);
+ aSectionGNode->UnSetChild(aChGNode);
+ if (aSectionGNode->NbChildren() == 0)
+ aSectionGNode->ForgetAttribute(XCAFDoc::ViewRefSectionGUID());
+ }
+ theViewL.ForgetAttribute(XCAFDoc::ViewRefSectionGUID());
+ }
+
+ if (!theViewL.FindAttribute(XCAFDoc::ViewRefSectionGUID(), aChGNode) && theSectionsLabels.Length() > 0) {
+ aChGNode = new XCAFDoc_GraphNode;
+ aChGNode = XCAFDoc_GraphNode::Set(theViewL);
+ aChGNode->SetGraphID(XCAFDoc::ViewRefSectionGUID());
+ }
+ for (Standard_Integer i = theSectionsLabels.Lower(); i <= theSectionsLabels.Upper(); i++) {
+ if (!theSectionsLabels.Value(i).FindAttribute(XCAFDoc::ViewRefSectionGUID(), aSectionGNode)) {
+ aSectionGNode = new XCAFDoc_GraphNode;
+ aSectionGNode = XCAFDoc_GraphNode::Set(theSectionsLabels.Value(i));
+ }
+ aSectionGNode->SetGraphID(XCAFDoc::ViewRefSectionGUID());
+ aSectionGNode->SetChild(aChGNode);
+ aChGNode->SetFather(aSectionGNode);
+ }
+}
+
//=======================================================================
//function : SetEnabledShapes
//purpose :
return Standard_True;
}
+//=======================================================================
+//function : GetRefSectionsLabels
+//purpose :
+//=======================================================================
+Standard_Boolean XCAFDoc_ViewTool::GetRefSectionsLabels(const TDF_Label& theViewL,
+ TDF_LabelSequence& theSectionsLabels) const
+{
+ theSectionsLabels.Clear();
+ Handle(TDataStd_TreeNode) aNode;
+ if (!theViewL.FindAttribute(XCAFDoc::ViewRefGUID(), aNode) || !aNode->HasFather()) {
+ Handle(XCAFDoc_GraphNode) aGNode;
+ if (theViewL.FindAttribute(XCAFDoc::ViewRefSectionGUID(), aGNode) && aGNode->NbFathers() > 0) {
+ for (Standard_Integer i = 1; i <= aGNode->NbFathers(); i++)
+ theSectionsLabels.Append(aGNode->GetFather(i)->Label());
+ return Standard_True;
+ } else
+ return Standard_False;
+ }
+
+ theSectionsLabels.Append(aNode->Father()->Label());
+ return Standard_True;
+}
+
//=======================================================================
//function : GetRefEnabledShapesLabel
//purpose :
//! Set Clipping planes to given View
Standard_EXPORT void SetClippingPlanes(const TDF_LabelSequence& theClippingPlaneLabels,
const TDF_Label& theViewL) const;
+
+ //! Set Sections to given View
+ Standard_EXPORT void SetSections(const TDF_LabelSequence& theSectionsLabels,
+ const TDF_Label& theViewL) const;
+
Standard_EXPORT void SetEnabledShapes(const TDF_LabelSequence& theShapesTransparencyLabels,
const TDF_Label& theViewL) const;
//! Returns False if the theViewL is not in View table
Standard_EXPORT Standard_Boolean GetRefClippingPlaneLabel(const TDF_Label& theViewL, TDF_LabelSequence& theClippingPlaneLabels) const;
+ //! Returns Sections labels defined for label theViewL
+ //! Returns False if the theViewL is not in View table
+ Standard_EXPORT Standard_Boolean GetRefSectionsLabels(const TDF_Label& theViewL, TDF_LabelSequence& theSectionsLabels) const;
+
//! Returns shapes transparency labels defined for label theViewL
//! Returns False if the theViewL is not in View table
Standard_EXPORT Standard_Boolean GetRefEnabledShapesLabel(const TDF_Label& theViewL, TDF_LabelSequence& theShapesTranspanencyLabels) const;