return s_ID;
}
-Standard_Boolean
-XCAFDoc_AssemblyItemRef::IsMine(const TDF_Label& theLabel)
-{
- Handle(XCAFDoc_AssemblyItemRef) aThis;
- return !theLabel.IsNull() &&
- theLabel.FindAttribute(XCAFDoc_AssemblyItemRef::GetID(), aThis) &&
- !aThis.IsNull();
-}
-
Handle(XCAFDoc_AssemblyItemRef)
XCAFDoc_AssemblyItemRef::Get(const TDF_Label& theLabel)
{
Standard_EXPORT static const Standard_GUID& GetID();
- Standard_EXPORT static Standard_Boolean IsMine(const TDF_Label& theLabel);
-
Standard_EXPORT static Handle(XCAFDoc_AssemblyItemRef) Get(const TDF_Label& theLabel);
Standard_EXPORT static Handle(XCAFDoc_AssemblyItemRef) Set(const TDF_Label& theLabel,
Handle(XCAFDoc_Note) aNote;
if (!theLabel.IsNull() &&
(theLabel.FindAttribute(XCAFDoc_NoteComment::GetID(), aNote) ||
- theLabel.FindAttribute(XCAFDoc_NoteBinData::GetID(), aNote)))
+ theLabel.FindAttribute(XCAFDoc_NoteBinData::GetID(), aNote)))
return aNote;
return aNote;
}
IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_NoteBinData, XCAFDoc_Note)
-const Standard_GUID& XCAFDoc_NoteBinData::GetID()
+const Standard_GUID&
+XCAFDoc_NoteBinData::GetID()
{
static Standard_GUID s_ID("E9055501-F0FC-4864-BE4B-284FDA7DDEAC");
return s_ID;
}
-Standard_Boolean XCAFDoc_NoteBinData::IsMine(const TDF_Label& theLabel)
+Handle(XCAFDoc_NoteBinData)
+XCAFDoc_NoteBinData::Get(const TDF_Label& theLabel)
{
- Handle(XCAFDoc_NoteBinData) anAttr;
- return (!theLabel.IsNull() && theLabel.FindAttribute(XCAFDoc_NoteBinData::GetID(), anAttr));
+ Handle(XCAFDoc_NoteBinData) aThis;
+ theLabel.FindAttribute(XCAFDoc_NoteBinData::GetID(), aThis);
+ return aThis;
}
Handle(XCAFDoc_NoteBinData)
{
}
-Standard_Boolean XCAFDoc_NoteBinData::Set(const TCollection_ExtendedString& theTitle,
- const TCollection_AsciiString& theMIMEtype,
- OSD_File& theFile)
+Standard_Boolean
+XCAFDoc_NoteBinData::Set(const TCollection_ExtendedString& theTitle,
+ const TCollection_AsciiString& theMIMEtype,
+ OSD_File& theFile)
{
if (!theFile.IsOpen() || !theFile.IsReadable())
return Standard_False;
return Standard_True;
}
-void XCAFDoc_NoteBinData::Set(const TCollection_ExtendedString& theTitle,
- const TCollection_AsciiString& theMIMEtype,
- const Handle(TColStd_HArray1OfByte)& theData)
+void
+XCAFDoc_NoteBinData::Set(const TCollection_ExtendedString& theTitle,
+ const TCollection_AsciiString& theMIMEtype,
+ const Handle(TColStd_HArray1OfByte)& theData)
{
Backup();
myMIMEtype = theMIMEtype;
}
-const TCollection_ExtendedString& XCAFDoc_NoteBinData::Title() const
+const TCollection_ExtendedString&
+XCAFDoc_NoteBinData::Title() const
{
return myTitle;
}
-const TCollection_AsciiString& XCAFDoc_NoteBinData::MIMEtype() const
+const TCollection_AsciiString&
+XCAFDoc_NoteBinData::MIMEtype() const
{
return myMIMEtype;
}
-Standard_Integer XCAFDoc_NoteBinData::Size() const
+Standard_Integer
+XCAFDoc_NoteBinData::Size() const
{
return (!myData.IsNull() ? myData->Length() : 0);
}
-const Handle(TColStd_HArray1OfByte)& XCAFDoc_NoteBinData::Data() const
+const Handle(TColStd_HArray1OfByte)&
+XCAFDoc_NoteBinData::Data() const
{
return myData;
}
-const Standard_GUID& XCAFDoc_NoteBinData::ID() const
+const
+Standard_GUID& XCAFDoc_NoteBinData::ID() const
{
return GetID();
}
-Handle(TDF_Attribute) XCAFDoc_NoteBinData::NewEmpty() const
+Handle(TDF_Attribute)
+XCAFDoc_NoteBinData::NewEmpty() const
{
return new XCAFDoc_NoteBinData();
}
-void XCAFDoc_NoteBinData::Restore(const Handle(TDF_Attribute)& theAttr)
+void
+XCAFDoc_NoteBinData::Restore(const Handle(TDF_Attribute)& theAttr)
{
XCAFDoc_Note::Restore(theAttr);
}
}
-void XCAFDoc_NoteBinData::Paste(const Handle(TDF_Attribute)& theAttrInto,
- const Handle(TDF_RelocationTable)& theRT) const
+void
+XCAFDoc_NoteBinData::Paste(const Handle(TDF_Attribute)& theAttrInto,
+ const Handle(TDF_RelocationTable)& theRT) const
{
XCAFDoc_Note::Paste(theAttrInto, theRT);
aMine->Set(myTitle, myMIMEtype, myData);
}
-Standard_OStream& XCAFDoc_NoteBinData::Dump(Standard_OStream& theOS) const
+Standard_OStream&
+XCAFDoc_NoteBinData::Dump(Standard_OStream& theOS) const
{
XCAFDoc_Note::Dump(theOS);
theOS << "\n"
Standard_EXPORT static const Standard_GUID& GetID();
- Standard_EXPORT static Standard_Boolean IsMine(const TDF_Label& theLabel);
+ Standard_EXPORT static Handle(XCAFDoc_NoteBinData) Get(const TDF_Label& theLabel);
Standard_EXPORT static Handle(XCAFDoc_NoteBinData) Set(const TDF_Label& theLabel,
const TCollection_ExtendedString& theUserName,
IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_NoteComment, XCAFDoc_Note)
-const Standard_GUID& XCAFDoc_NoteComment::GetID()
+const Standard_GUID&
+XCAFDoc_NoteComment::GetID()
{
static Standard_GUID s_ID("FDEA4C52-0F54-484c-B590-579E18F7B5D4");
return s_ID;
}
-Standard_Boolean XCAFDoc_NoteComment::IsMine(const TDF_Label& theLabel)
+Handle(XCAFDoc_NoteComment)
+XCAFDoc_NoteComment::Get(const TDF_Label& theLabel)
{
- Handle(XCAFDoc_NoteComment) anAttr;
- return (!theLabel.IsNull() && theLabel.FindAttribute(XCAFDoc_NoteComment::GetID(), anAttr));
+ Handle(XCAFDoc_NoteComment) aThis;
+ theLabel.FindAttribute(XCAFDoc_NoteComment::GetID(), aThis);
+ return aThis;
}
-Handle(XCAFDoc_NoteComment) XCAFDoc_NoteComment::Set(const TDF_Label& theLabel,
- const TCollection_ExtendedString& theUserName,
- const TCollection_ExtendedString& theTimeStamp,
- const TCollection_ExtendedString& theComment)
+Handle(XCAFDoc_NoteComment)
+XCAFDoc_NoteComment::Set(const TDF_Label& theLabel,
+ const TCollection_ExtendedString& theUserName,
+ const TCollection_ExtendedString& theTimeStamp,
+ const TCollection_ExtendedString& theComment)
{
Handle(XCAFDoc_NoteComment) aNoteComment;
if (!theLabel.IsNull() && !theLabel.FindAttribute(XCAFDoc_NoteComment::GetID(), aNoteComment))
{
}
-void XCAFDoc_NoteComment::Set(const TCollection_ExtendedString& theComment)
+void
+XCAFDoc_NoteComment::Set(const TCollection_ExtendedString& theComment)
{
Backup();
myComment = theComment;
}
-const TCollection_ExtendedString& XCAFDoc_NoteComment::Comment() const
+const TCollection_ExtendedString&
+XCAFDoc_NoteComment::Comment() const
{
return myComment;
}
-const Standard_GUID& XCAFDoc_NoteComment::ID() const
+const Standard_GUID&
+XCAFDoc_NoteComment::ID() const
{
return GetID();
}
-Handle(TDF_Attribute) XCAFDoc_NoteComment::NewEmpty() const
+Handle(TDF_Attribute)
+XCAFDoc_NoteComment::NewEmpty() const
{
return new XCAFDoc_NoteComment();
}
-void XCAFDoc_NoteComment::Restore(const Handle(TDF_Attribute)& theAttr)
+void
+XCAFDoc_NoteComment::Restore(const Handle(TDF_Attribute)& theAttr)
{
XCAFDoc_Note::Restore(theAttr);
myComment = aMine->myComment;
}
-void XCAFDoc_NoteComment::Paste(const Handle(TDF_Attribute)& theAttrInto,
- const Handle(TDF_RelocationTable)& theRT) const
+void
+XCAFDoc_NoteComment::Paste(const Handle(TDF_Attribute)& theAttrInto,
+ const Handle(TDF_RelocationTable)& theRT) const
{
XCAFDoc_Note::Paste(theAttrInto, theRT);
aMine->Set(myComment);
}
-Standard_OStream& XCAFDoc_NoteComment::Dump(Standard_OStream& theOS) const
+Standard_OStream&
+XCAFDoc_NoteComment::Dump(Standard_OStream& theOS) const
{
XCAFDoc_Note::Dump(theOS);
theOS << "\n"
Standard_EXPORT static const Standard_GUID& GetID();
- Standard_EXPORT static Standard_Boolean IsMine(const TDF_Label& theLabel);
+ Standard_EXPORT static Handle(XCAFDoc_NoteComment) Get(const TDF_Label& theLabel);
Standard_EXPORT static Handle(XCAFDoc_NoteComment) Set(const TDF_Label& theLabel,
const TCollection_ExtendedString& theUserName,
#include <TColStd_HArray1OfByte.hxx>
#include <TDF_Label.hxx>
#include <TDF_LabelMapHasher.hxx>
-#include <TDF_ChildIterator.hxx>
+#include <TDF_ChildIDIterator.hxx>
#include <TDF_LabelSequence.hxx>
#include <XCAFDoc.hxx>
#include <XCAFDoc_GraphNode.hxx>
for (TDF_ChildIterator anIter(GetNotesLabel()); anIter.More(); anIter.Next())
{
const TDF_Label aLabel = anIter.Value();
- if (XCAFDoc_Note::IsMine(aLabel))
+ if (!XCAFDoc_Note::Get(aLabel).IsNull())
++nbNotes;
}
return nbNotes;
XCAFDoc_NotesTool::NbAnnotatedItems() const
{
Standard_Integer nbItems = 0;
- for (TDF_ChildIterator anIter(GetAnnotatedItemsLabel()); anIter.More(); anIter.Next())
+ for (TDF_ChildIDIterator anIter(GetAnnotatedItemsLabel(), XCAFDoc_AssemblyItemRef::GetID()); anIter.More(); anIter.Next())
{
- const TDF_Label aLabel = anIter.Value();
- if (XCAFDoc_AssemblyItemRef::IsMine(aLabel))
++nbItems;
}
return nbItems;
for (TDF_ChildIterator anIter(GetNotesLabel()); anIter.More(); anIter.Next())
{
const TDF_Label aLabel = anIter.Value();
- if (XCAFDoc_Note::IsMine(aLabel))
+ if (!XCAFDoc_Note::Get(aLabel).IsNull())
theNoteLabels.Append(aLabel);
}
}
void
XCAFDoc_NotesTool::GetAnnotatedItems(TDF_LabelSequence& theItemLabels) const
{
- for (TDF_ChildIterator anIter(GetAnnotatedItemsLabel()); anIter.More(); anIter.Next())
+ for (TDF_ChildIDIterator anIter(GetAnnotatedItemsLabel(), XCAFDoc_AssemblyItemRef::GetID()); anIter.More(); anIter.Next())
{
- const TDF_Label aLabel = anIter.Value();
- if (XCAFDoc_AssemblyItemRef::IsMine(aLabel))
- theItemLabels.Append(aLabel);
+ theItemLabels.Append(anIter.Value()->Label());
}
}
TDF_Label
XCAFDoc_NotesTool::FindAnnotatedItem(const XCAFDoc_AssemblyItemId& theItemId) const
{
- for (TDF_ChildIterator anIter(GetAnnotatedItemsLabel()); anIter.More(); anIter.Next())
+ for (TDF_ChildIDIterator anIter(GetAnnotatedItemsLabel(), XCAFDoc_AssemblyItemRef::GetID()); anIter.More(); anIter.Next())
{
- const TDF_Label aLabel = anIter.Value();
- Handle(XCAFDoc_AssemblyItemRef) anItemRef = XCAFDoc_AssemblyItemRef::Get(aLabel);
+ Handle(XCAFDoc_AssemblyItemRef) anItemRef = Handle(XCAFDoc_AssemblyItemRef)::DownCast(anIter.Value());
if (!anItemRef.IsNull() && anItemRef->Get().IsEqual(theItemId))
- return aLabel;
+ return anItemRef->Label();
}
return TDF_Label();
}