}
TDF_Label
-XCAFDoc_NotesTool::FindAnnotatedItemGUID(const XCAFDoc_AssemblyItemId& theItemId,
+XCAFDoc_NotesTool::FindAnnotatedItemAttr(const XCAFDoc_AssemblyItemId& theItemId,
const Standard_GUID& theGUID) const
{
for (TDF_ChildIDIterator anIter(GetAnnotatedItemsLabel(), XCAFDoc_AssemblyItemRef::GetID()); anIter.More(); anIter.Next())
return theNoteLabels.Length();
}
+
+Standard_Integer
+XCAFDoc_NotesTool::GetAttrNotes(const XCAFDoc_AssemblyItemId& theItemId,
+ const Standard_GUID& theGUID,
+ TDF_LabelSequence& theNoteLabels) const
+{
+ TDF_Label anAnnotatedItem = FindAnnotatedItemAttr(theItemId, theGUID);
+ if (anAnnotatedItem.IsNull())
+ return 0;
+
+ Handle(XCAFDoc_GraphNode) aChild;
+ if (!anAnnotatedItem.FindAttribute(XCAFDoc::NoteRefGUID(), aChild))
+ return 0;
+
+ Standard_Integer nbFathers = aChild->NbFathers();
+ for (Standard_Integer iFather = 1; iFather <= nbFathers; ++iFather)
+ {
+ Handle(XCAFDoc_GraphNode) aFather = aChild->GetFather(iFather);
+ theNoteLabels.Append(aFather->Label());
+ }
+
+ return theNoteLabels.Length();
+}
+
+Standard_Integer
+XCAFDoc_NotesTool::GetSubshapeNotes(const XCAFDoc_AssemblyItemId& theItemId,
+ Standard_Integer theSubshapeIndex,
+ TDF_LabelSequence& theNoteLabels) const
+{
+ TDF_Label anAnnotatedItem = FindAnnotatedItemSubshape(theItemId, theSubshapeIndex);
+ if (anAnnotatedItem.IsNull())
+ return 0;
+
+ Handle(XCAFDoc_GraphNode) aChild;
+ if (!anAnnotatedItem.FindAttribute(XCAFDoc::NoteRefGUID(), aChild))
+ return 0;
+
+ Standard_Integer nbFathers = aChild->NbFathers();
+ for (Standard_Integer iFather = 1; iFather <= nbFathers; ++iFather)
+ {
+ Handle(XCAFDoc_GraphNode) aFather = aChild->GetFather(iFather);
+ theNoteLabels.Append(aFather->Label());
+ }
+
+ return theNoteLabels.Length();
+}
+
Handle(XCAFDoc_AssemblyItemRef)
XCAFDoc_NotesTool::AddNote(const TDF_Label& theNoteLabel,
const XCAFDoc_AssemblyItemId& theItemId)
return anItemRef;
Handle(XCAFDoc_GraphNode) aChild;
- TDF_Label anAnnotatedItem = FindAnnotatedItemGUID(theItemId, theGUID);
+ TDF_Label anAnnotatedItem = FindAnnotatedItemAttr(theItemId, theGUID);
if (anAnnotatedItem.IsNull())
{
TDF_TagSource aTag;
Standard_EXPORT Standard_Boolean IsAnnotatedItem(const XCAFDoc_AssemblyItemId& theItemId) const;
Standard_EXPORT TDF_Label FindAnnotatedItem(const XCAFDoc_AssemblyItemId& theItemId) const;
- Standard_EXPORT TDF_Label FindAnnotatedItemGUID(const XCAFDoc_AssemblyItemId& theItemId,
+ Standard_EXPORT TDF_Label FindAnnotatedItemAttr(const XCAFDoc_AssemblyItemId& theItemId,
const Standard_GUID& theGUID) const;
Standard_EXPORT TDF_Label FindAnnotatedItemSubshape(const XCAFDoc_AssemblyItemId& theItemId,
Standard_Integer theSubshapeIndex) const;
Standard_EXPORT Standard_Integer GetNotes(const XCAFDoc_AssemblyItemId& theItemId,
TDF_LabelSequence& theNoteLabels) const;
+ Standard_EXPORT Standard_Integer GetAttrNotes(const XCAFDoc_AssemblyItemId& theItemId,
+ const Standard_GUID& theGUID,
+ TDF_LabelSequence& theNoteLabels) const;
+ Standard_EXPORT Standard_Integer GetSubshapeNotes(const XCAFDoc_AssemblyItemId& theItemId,
+ Standard_Integer theSubshapeIndex,
+ TDF_LabelSequence& theNoteLabels) const;
Standard_EXPORT Handle(XCAFDoc_AssemblyItemRef) AddNote(const TDF_Label& theNoteLabel,
const XCAFDoc_AssemblyItemId& theItemId);