]> OCCT Git - occt-copy.git/commitdiff
XCAF: notes Bin/XML drivers
authorsnn <snn@opencascade.com>
Tue, 14 Feb 2017 14:32:19 +0000 (17:32 +0300)
committersnn <snn@opencascade.com>
Thu, 16 Feb 2017 06:35:18 +0000 (09:35 +0300)
# Conflicts:
# src/XmlMXCAFDoc/XmlMXCAFDoc.hxx

25 files changed:
src/BinMXCAFDoc/BinMXCAFDoc.cxx
src/BinMXCAFDoc/BinMXCAFDoc.hxx
src/BinMXCAFDoc/BinMXCAFDoc_NoteBinDataDriver.cxx
src/BinMXCAFDoc/BinMXCAFDoc_NoteCommentDriver.cxx
src/BinMXCAFDoc/BinMXCAFDoc_NoteDriver.cxx
src/BinMXCAFDoc/BinMXCAFDoc_NoteDriver.hxx
src/XCAFDoc/XCAFDoc_Note.cxx
src/XCAFDoc/XCAFDoc_Note.hxx
src/XCAFDoc/XCAFDoc_NoteBinData.cxx
src/XCAFDoc/XCAFDoc_NoteBinData.hxx
src/XCAFDoc/XCAFDoc_NoteComment.cxx
src/XCAFDoc/XCAFDoc_NoteComment.hxx
src/XCAFDoc/XCAFDoc_NotesTool.cxx
src/XCAFDoc/XCAFDoc_NotesTool.hxx
src/XmlMXCAFDoc/FILES
src/XmlMXCAFDoc/XmlMXCAFDoc.cxx
src/XmlMXCAFDoc/XmlMXCAFDoc.hxx
src/XmlMXCAFDoc/XmlMXCAFDoc_NoteBinDataDriver.cxx [new file with mode: 0644]
src/XmlMXCAFDoc/XmlMXCAFDoc_NoteBinDataDriver.hxx [new file with mode: 0644]
src/XmlMXCAFDoc/XmlMXCAFDoc_NoteCommentDriver.cxx [new file with mode: 0644]
src/XmlMXCAFDoc/XmlMXCAFDoc_NoteCommentDriver.hxx [new file with mode: 0644]
src/XmlMXCAFDoc/XmlMXCAFDoc_NoteDriver.cxx [new file with mode: 0644]
src/XmlMXCAFDoc/XmlMXCAFDoc_NoteDriver.hxx [new file with mode: 0644]
src/XmlMXCAFDoc/XmlMXCAFDoc_NotesToolDriver.cxx [new file with mode: 0644]
src/XmlMXCAFDoc/XmlMXCAFDoc_NotesToolDriver.hxx [new file with mode: 0644]

index 5a978706575287cd0fb54197e2cccad41d9b0560..8c55dfbe94bacde9d5b5f264c26dbbbe3dd06606 100644 (file)
@@ -74,7 +74,6 @@ void BinMXCAFDoc::AddDrivers(const Handle(BinMDF_ADriverTable)& theDriverTable,
   theDriverTable->AddDriver( new BinMXCAFDoc_DimensionDriver   (theMsgDrv));
   theDriverTable->AddDriver( new BinMXCAFDoc_DimTolDriver      (theMsgDrv));
   theDriverTable->AddDriver( new BinMXCAFDoc_MaterialDriver    (theMsgDrv));
-  theDriverTable->AddDriver( new BinMXCAFDoc_NoteDriver        (theMsgDrv));
   theDriverTable->AddDriver( new BinMXCAFDoc_NoteBinDataDriver (theMsgDrv));
   theDriverTable->AddDriver( new BinMXCAFDoc_NoteCommentDriver (theMsgDrv));
   theDriverTable->AddDriver (new BinMXCAFDoc_ViewDriver        (theMsgDrv));
index d18a4ce1b2462a1c40cedf3d63140470024db770..0ef404e9b7b3343ed9adbb90b9fc0af908b3a85f 100644 (file)
@@ -34,6 +34,9 @@ class BinMXCAFDoc_GeomToleranceDriver;
 class BinMXCAFDoc_DimensionDriver;
 class BinMXCAFDoc_DimTolDriver;
 class BinMXCAFDoc_MaterialDriver;
+class BinMXCAFDoc_NoteCommentDriver;
+class BinMXCAFDoc_NoteBinDataDriver;
+class BinMXCAFDoc_NotesToolDriver;
 class BinMXCAFDoc_ColorToolDriver;
 class BinMXCAFDoc_DocumentToolDriver;
 class BinMXCAFDoc_LayerToolDriver;
index f7dce26f751b347e939f9bc7cae662e0571ec990..707bb5d9ce385a635213fb3328222c08811934fb 100644 (file)
@@ -17,7 +17,8 @@
 #include <CDM_MessageDriver.hxx>
 #include <Standard_Type.hxx>
 #include <TDF_Attribute.hxx>
-#include <TCollection_HAsciiString.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TCollection_ExtendedString.hxx>
 #include <BinMXCAFDoc_NoteBinDataDriver.hxx>
 #include <XCAFDoc_NoteBinData.hxx>
 
@@ -52,14 +53,16 @@ Standard_Boolean BinMXCAFDoc_NoteBinDataDriver::Paste(const BinObjMgt_Persistent
   if (!BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable))
     return Standard_False;
 
-  Handle(XCAFDoc_NoteBinData) aNoteBinData = Handle(XCAFDoc_NoteBinData)::DownCast(theTarget);
+  Handle(XCAFDoc_NoteBinData) aNote = Handle(XCAFDoc_NoteBinData)::DownCast(theTarget);
+  if (aNote.IsNull())
+    return Standard_False;
 
+  TCollection_ExtendedString aTitle;
   TCollection_AsciiString aData, aMIMEtype;
-  if (!(theSource >> aData >> aMIMEtype))
+  if (!(theSource >> aTitle >> aData >> aMIMEtype))
     return Standard_False;
 
-  aNoteBinData->Set(new TCollection_HAsciiString(aData), 
-                    new TCollection_HAsciiString(aMIMEtype));
+  aNote->Set(aTitle, aData, aMIMEtype);
 
   return Standard_True;
 }
@@ -74,12 +77,13 @@ void BinMXCAFDoc_NoteBinDataDriver::Paste(const Handle(TDF_Attribute)& theSource
 {
   BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable);
 
-  Handle(XCAFDoc_NoteBinData) aNoteBinData = Handle(XCAFDoc_NoteBinData)::DownCast(theSource);
-
-  Handle(TCollection_HAsciiString) aData = aNoteBinData->Data();
-  Handle(TCollection_HAsciiString) aMIMEtype = aNoteBinData->MIMEtype();
-  theTarget
-    << (aData ? aData->String() : TCollection_AsciiString(""))
-    << (aMIMEtype ? aMIMEtype->String() : TCollection_AsciiString(""))
-    ;
+  Handle(XCAFDoc_NoteBinData) aNote = Handle(XCAFDoc_NoteBinData)::DownCast(theSource);
+  if (!aNote.IsNull())
+  {
+    theTarget
+      << aNote->Title()
+      << aNote->MIMEtype()
+      << aNote->Data()
+      ;
+  }
 }
index d1e9fc1265eba3f742538e232055900b40686098..9ffadce007bf79ced65a8707a4bbe3353ed31f51 100644 (file)
@@ -51,13 +51,15 @@ Standard_Boolean BinMXCAFDoc_NoteCommentDriver::Paste(const BinObjMgt_Persistent
   if (!BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable))
     return Standard_False;
 
-  Handle(XCAFDoc_NoteComment) aNoteComment = Handle(XCAFDoc_NoteComment)::DownCast(theTarget);
+  Handle(XCAFDoc_NoteComment) aNote = Handle(XCAFDoc_NoteComment)::DownCast(theTarget);
+  if (aNote.IsNull())
+    return Standard_False;
 
   TCollection_ExtendedString aComment;
   if (!(theSource >> aComment))
     return Standard_False;
 
-  aNoteComment->Set(new TCollection_HExtendedString(aComment));
+  aNote->Set(aComment);
 
   return Standard_True;
 }
@@ -72,10 +74,7 @@ void BinMXCAFDoc_NoteCommentDriver::Paste(const Handle(TDF_Attribute)& theSource
 {
   BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable);
 
-  Handle(XCAFDoc_NoteComment) aNoteComment = Handle(XCAFDoc_NoteComment)::DownCast(theSource);
-
-  Handle(TCollection_HExtendedString) aComment = aNoteComment->TimeStamp();
-  theTarget
-    << (aComment ? aComment->String() : TCollection_ExtendedString(""))
-    ;
+  Handle(XCAFDoc_NoteComment) aNote = Handle(XCAFDoc_NoteComment)::DownCast(theSource);
+  if (!aNote.IsNull())
+    theTarget << aNote->Comment();
 }
index 64e3a55bd89b057ae1e0da521916653e206d8ba3..fc00d0b83c7db14b9efe062b6586c3dc9c7896d6 100644 (file)
 
 IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NoteDriver, BinMDF_ADriver)
 
-//=======================================================================
-//function :
-//purpose  : 
-//=======================================================================
-BinMXCAFDoc_NoteDriver::BinMXCAFDoc_NoteDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
-  : BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Note)->Name())
-{
-}
-
 //=======================================================================
 //function :
 //purpose  : 
@@ -42,15 +33,6 @@ BinMXCAFDoc_NoteDriver::BinMXCAFDoc_NoteDriver(const Handle(CDM_MessageDriver)&
 
 }
 
-//=======================================================================
-//function :
-//purpose  : 
-//=======================================================================
-Handle(TDF_Attribute) BinMXCAFDoc_NoteDriver::NewEmpty() const
-{
-  return new XCAFDoc_Note();
-}
-
 //=======================================================================
 //function :
 //purpose  : 
@@ -60,13 +42,14 @@ Standard_Boolean BinMXCAFDoc_NoteDriver::Paste(const BinObjMgt_Persistent&  theS
                                                BinObjMgt_RRelocationTable&  /*theRelocTable*/) const
 {
   Handle(XCAFDoc_Note) aNote = Handle(XCAFDoc_Note)::DownCast(theTarget);
+  if (aNote.IsNull())
+    return Standard_False;
   
   TCollection_ExtendedString aUserName, aTimeStamp;
   if (!(theSource >> aUserName >> aTimeStamp))
     return Standard_False;
 
-  aNote->Set(new TCollection_HExtendedString(aUserName),
-             new TCollection_HExtendedString(aTimeStamp));
+  aNote->Set(aUserName, aTimeStamp);
 
   return Standard_True;
 }
@@ -80,10 +63,6 @@ void BinMXCAFDoc_NoteDriver::Paste(const Handle(TDF_Attribute)& theSource,
                                                                 BinObjMgt_SRelocationTable&  /*theRelocTable*/) const
 {
   Handle(XCAFDoc_Note) aNote = Handle(XCAFDoc_Note)::DownCast(theSource);
-  Handle(TCollection_HExtendedString) aUserName = aNote->UserName();
-  Handle(TCollection_HExtendedString) aTimeStamp = aNote->TimeStamp();
-  theTarget 
-    << (aUserName ? aUserName->String() : TCollection_ExtendedString(""))
-    << (aTimeStamp ? aTimeStamp->String() : TCollection_ExtendedString(""))
-    ;
+  if (!aNote.IsNull())
+    theTarget << aNote->UserName() << aNote->TimeStamp();
 }
index 8dc1b75c2dbc5d92e388dc4edb7a30eac5b29fbd..f20fd6d187556f802c27f96c5982772b632d37b2 100644 (file)
@@ -35,10 +35,6 @@ class BinMXCAFDoc_NoteDriver : public BinMDF_ADriver
 {
 public:
   
-  Standard_EXPORT BinMXCAFDoc_NoteDriver(const Handle(CDM_MessageDriver)& theMsgDriver);
-  
-  Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
-  
   Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent&  theSource, 
                                           const Handle(TDF_Attribute)& theTarget, 
                                           BinObjMgt_RRelocationTable&  theRelocTable) const Standard_OVERRIDE;
index 2fe5b76623257fab3c5c6cf526aec619f97127d4..42f16ad6a621a7b27df1b3063a49197fedd796e0 100644 (file)
 
 #include <Standard_GUID.hxx>
 #include <TDF_Label.hxx>
-#include <XCAFDoc_Note.hxx>
+#include <XCAFDoc.hxx>
+#include <XCAFDoc_GraphNode.hxx>
+#include <XCAFDoc_NoteComment.hxx>
+#include <XCAFDoc_NoteBinData.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_Note, TDF_Attribute)
 
-const Standard_GUID& XCAFDoc_Note::GetID()
+Standard_Boolean XCAFDoc_Note::IsMine(const TDF_Label& theLabel)
 {
-  static Standard_GUID s_ID("FDC0AF06-C4AC-468a-ACFB-4C9388C76D9E");
-  return s_ID;
+  return !Get(theLabel).IsNull();
 }
 
-Standard_Boolean XCAFDoc_Note::IsMine(const TDF_Label& theLabel)
+XCAFDoc_Note::XCAFDoc_Note()
 {
-  Handle(XCAFDoc_Note) anAttr;
-  return (!theLabel.IsNull() && theLabel.FindAttribute(XCAFDoc_Note::GetID(), anAttr));
 }
 
-Handle(XCAFDoc_Note) XCAFDoc_Note::Set(const TDF_Label&                  theLabel,
-                                       const Handle(TCollection_HExtendedString)& theUserName,
-                                       const Handle(TCollection_HExtendedString)& theTimeStamp)
+Handle(XCAFDoc_Note) XCAFDoc_Note::Get(const TDF_Label& theLabel)
 {
   Handle(XCAFDoc_Note) aNote;
-  if (!theLabel.IsNull() && !theLabel.FindAttribute(XCAFDoc_Note::GetID(), aNote))
-  {
-    aNote = new XCAFDoc_Note();
-    aNote->Set(theUserName, theTimeStamp);
-    theLabel.AddAttribute(aNote);
-  }
+  if (theLabel.FindAttribute(XCAFDoc_NoteComment::GetID(), aNote) ||
+      theLabel.FindAttribute(XCAFDoc_NoteBinData::GetID(), aNote))
+    return aNote;
   return aNote;
 }
 
-XCAFDoc_Note::XCAFDoc_Note()
-{
-}
-
-void XCAFDoc_Note::Set(const Handle(TCollection_HExtendedString)& theUserName,
-                       const Handle(TCollection_HExtendedString)& theTimeStamp)
+void XCAFDoc_Note::Set(const TCollection_ExtendedString& theUserName,
+                       const TCollection_ExtendedString& theTimeStamp)
 {
   Backup();
 
@@ -58,24 +49,85 @@ void XCAFDoc_Note::Set(const Handle(TCollection_HExtendedString)& theUserName,
   myTimeStamp = theTimeStamp;
 }
 
-Handle(TCollection_HExtendedString) XCAFDoc_Note::UserName() const
+const TCollection_ExtendedString& XCAFDoc_Note::UserName() const
 {
   return myUserName;
 }
 
-Handle(TCollection_HExtendedString) XCAFDoc_Note::TimeStamp() const
+const TCollection_ExtendedString& XCAFDoc_Note::TimeStamp() const
 {
   return myTimeStamp;
 }
 
-const Standard_GUID& XCAFDoc_Note::ID() const
+Standard_Boolean XCAFDoc_Note::IsAttached() const
+{
+  if (!IsMine(Label()))
+    return Standard_False;
+
+  Handle(XCAFDoc_GraphNode) aFather;
+  return Label().FindAttribute(XCAFDoc::NoteRefGUID(), aFather) &&
+         (aFather->NbChildren() > 0);
+}
+
+void XCAFDoc_Note::Attach(const TDF_LabelSequence& theLabels)
 {
-  return GetID();
+  if (!IsMine(Label()) || theLabels.Length() == 0)
+    return;
+
+  Handle(XCAFDoc_GraphNode) aFather = XCAFDoc_GraphNode::Set(Label(), XCAFDoc::NoteRefGUID());
+
+  for (Standard_Integer i = theLabels.Lower(); i <= theLabels.Upper(); i++)
+  {
+    Handle(XCAFDoc_GraphNode) aChild = XCAFDoc_GraphNode::Set(theLabels.Value(i), XCAFDoc::NoteRefGUID());
+    aChild->SetFather(aFather);
+    aFather->SetChild(aChild);
+  }
 }
 
-Handle(TDF_Attribute) XCAFDoc_Note::NewEmpty() const
+void XCAFDoc_Note::Detach(const TDF_LabelSequence& theLabels)
 {
-  return new XCAFDoc_Note();
+  if (!IsMine(Label()) || theLabels.Length() == 0)
+    return;
+
+  Handle(XCAFDoc_GraphNode) aFather;
+  if (Label().FindAttribute(XCAFDoc::NoteRefGUID(), aFather))
+  {
+    for (Standard_Integer i = theLabels.Lower(); i <= theLabels.Upper(); i++)
+    {
+      Handle(XCAFDoc_GraphNode) aChild;
+      if (theLabels.Value(i).FindAttribute(XCAFDoc::NoteRefGUID(), aChild))
+      {
+        Standard_Integer iFather = aChild->FatherIndex(aFather);
+        if (iFather > 0)
+          aChild->UnSetFather(iFather);
+        if (aChild->NbFathers() == 0)
+          theLabels.Value(i).ForgetAttribute(aChild);
+      }
+    }
+    if (aFather->NbChildren() == 0)
+      Label().ForgetAttribute(aFather);
+  }
+}
+
+void XCAFDoc_Note::DetachAll()
+{
+  if (!IsMine(Label()))
+    return;
+
+  Handle(XCAFDoc_GraphNode) aFather;
+  if (Label().FindAttribute(XCAFDoc::NoteRefGUID(), aFather))
+  {
+    Standard_Integer nbChildren = aFather->NbChildren();
+    for (Standard_Integer iChild = 1; iChild <= nbChildren; ++iChild)
+    {
+      Handle(XCAFDoc_GraphNode) aChild = aFather->GetChild(iChild);
+      aFather->UnSetChild(iChild);
+      if (aChild->NbFathers() == 0)
+        aChild->Label().ForgetAttribute(aChild);
+    }
+    if (aFather->NbChildren() == 0)
+      Label().ForgetAttribute(aFather);
+  }
 }
 
 void XCAFDoc_Note::Restore(const Handle(TDF_Attribute)& theAttr)
@@ -94,9 +146,9 @@ Standard_OStream& XCAFDoc_Note::Dump(Standard_OStream& theOS) const
 {
   theOS 
     << "Note : " 
-    << (myUserName ? myUserName->String() : "<anonymous>")
+    << (myUserName.IsEmpty() ? myUserName : "<anonymous>")
     << " on "
-    << (myTimeStamp ? myTimeStamp->String() : "<unknown>")
+    << (myTimeStamp.IsEmpty() ? myTimeStamp : "<unknown>")
     ;
   return theOS;
 }
index 3102721411e3e9bcd0049db4dfc1e8a5d9baf796..f8febfc7e19469a96d907f745e5362615c843b91 100644 (file)
 
 #include <Standard.hxx>
 #include <Standard_Type.hxx>
-#include <TCollection_HExtendedString.hxx>
+#include <TCollection_ExtendedString.hxx>
 #include <OSD_File.hxx>
 #include <TDF_Attribute.hxx>
+#include <TDF_LabelSequence.hxx>
 
 class Standard_GUID;
 class TDF_RelocationTable;
@@ -34,28 +35,25 @@ public:
 
   DEFINE_STANDARD_RTTIEXT(XCAFDoc_Note, TDF_Attribute)
 
-  Standard_EXPORT static const Standard_GUID& GetID();
-
   Standard_EXPORT static Standard_Boolean IsMine(const TDF_Label& theLabel);
 
-  Standard_EXPORT static Handle(XCAFDoc_Note) Set(const TDF_Label&                           theLabel,
-                                                  const Handle(TCollection_HExtendedString)& theUserName,
-                                                  const Handle(TCollection_HExtendedString)& theTimeStamp);
+  Standard_EXPORT static Handle(XCAFDoc_Note) Get(const TDF_Label& theLabel);
 
-  Standard_EXPORT XCAFDoc_Note();
+  Standard_EXPORT void Set(const TCollection_ExtendedString& theUserName,
+                           const TCollection_ExtendedString& theTimeStamp);
 
-  Standard_EXPORT void Set(const Handle(TCollection_HExtendedString)& theUserName,
-                           const Handle(TCollection_HExtendedString)& theTimeStamp);
+  Standard_EXPORT const TCollection_ExtendedString& UserName() const;
 
-  Standard_EXPORT Handle(TCollection_HExtendedString) UserName() const;
+  Standard_EXPORT const TCollection_ExtendedString& TimeStamp() const;
 
-  Standard_EXPORT Handle(TCollection_HExtendedString) TimeStamp() const;
+  Standard_EXPORT Standard_Boolean IsAttached() const;
 
-public:
+  Standard_EXPORT void Attach(const TDF_LabelSequence& theLabels);
 
-  Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
+  Standard_EXPORT void Detach(const TDF_LabelSequence& theLabels);
+  Standard_EXPORT void DetachAll();
 
-  Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
+public:
 
   Standard_EXPORT void Restore(const Handle(TDF_Attribute)& theAttrFrom) Standard_OVERRIDE;
 
@@ -66,8 +64,12 @@ public:
 
 protected:
 
-  Handle(TCollection_HExtendedString) myUserName;
-  Handle(TCollection_HExtendedString) myTimeStamp;
+  Standard_EXPORT XCAFDoc_Note();
+
+private:
+
+  TCollection_ExtendedString myUserName;
+  TCollection_ExtendedString myTimeStamp;
 };
 
 #endif // _XCAFDoc_Note_HeaderFile
index d4875e51a31b666f078d807321f3365cdca33aab..f45c546aa1ef12aa43735b96294cf7bbddffa4ce 100644 (file)
@@ -33,18 +33,19 @@ Standard_Boolean XCAFDoc_NoteBinData::IsMine(const TDF_Label& theLabel)
   return (!theLabel.IsNull() && theLabel.FindAttribute(XCAFDoc_NoteBinData::GetID(), anAttr));
 }
 
-Handle(XCAFDoc_NoteBinData) XCAFDoc_NoteBinData::Set(const TDF_Label&                           theLabel,
-                                                     const Handle(TCollection_HExtendedString)& theUserName,
-                                                     const Handle(TCollection_HExtendedString)& theTimeStamp,
-                                                     OSD_File&                                  theFile,
-                                                     const Handle(TCollection_HAsciiString)&    theMIMEtype)
+Handle(XCAFDoc_NoteBinData) XCAFDoc_NoteBinData::Set(const TDF_Label&                  theLabel,
+                                                     const TCollection_ExtendedString& theUserName,
+                                                     const TCollection_ExtendedString& theTimeStamp,
+                                                     const TCollection_ExtendedString& theTitle,
+                                                     OSD_File&                         theFile,
+                                                     const TCollection_AsciiString&    theMIMEtype)
 {
   Handle(XCAFDoc_NoteBinData) aNoteBinData;
-  if (!theLabel.IsNull() && !theLabel.FindAttribute(XCAFDoc_Note::GetID(), aNoteBinData))
+  if (!theLabel.IsNull() && !theLabel.FindAttribute(XCAFDoc_NoteBinData::GetID(), aNoteBinData))
   {
     aNoteBinData = new XCAFDoc_NoteBinData();
     aNoteBinData->XCAFDoc_Note::Set(theUserName, theTimeStamp);
-    aNoteBinData->Set(theFile, theMIMEtype);
+    aNoteBinData->Set(theTitle, theFile, theMIMEtype);
     theLabel.AddAttribute(aNoteBinData);
   }
   return aNoteBinData;
@@ -54,36 +55,44 @@ XCAFDoc_NoteBinData::XCAFDoc_NoteBinData()
 {
 }
 
-void XCAFDoc_NoteBinData::Set(OSD_File&                               theFile,
-                              const Handle(TCollection_HAsciiString)& theMIMEtype)
+void XCAFDoc_NoteBinData::Set(const TCollection_ExtendedString& theTitle, 
+                              OSD_File&                         theFile,
+                              const TCollection_AsciiString&    theMIMEtype)
 {
   if (!theFile.IsOpen() || !theFile.IsReadable())
     return;
 
-  TCollection_AsciiString aStr;
-  theFile.Read(aStr, theFile.Size());
-
   Backup();
 
-  myData.reset(new TCollection_HAsciiString(aStr));
+  TCollection_AsciiString myData;
+  theFile.Read(myData, theFile.Size());
+
+  myTitle = theTitle;
   myMIMEtype = theMIMEtype;
 }
 
-void XCAFDoc_NoteBinData::Set(const Handle(TCollection_HAsciiString)& theData,
-                              const Handle(TCollection_HAsciiString)& theMIMEtype)
+void XCAFDoc_NoteBinData::Set(const TCollection_ExtendedString& theTitle, 
+                              const TCollection_AsciiString&    theData,
+                              const TCollection_AsciiString&    theMIMEtype)
 {
   Backup();
 
   myData = theData;
+  myTitle = theTitle;
   myMIMEtype = theMIMEtype;
 }
 
-Handle(TCollection_HAsciiString) XCAFDoc_NoteBinData::Data() const
+const TCollection_ExtendedString& XCAFDoc_NoteBinData::Title() const
+{
+  return myTitle;
+}
+
+const TCollection_AsciiString& XCAFDoc_NoteBinData::Data() const
 {
   return myData;
 }
 
-Handle(TCollection_HAsciiString) XCAFDoc_NoteBinData::MIMEtype() const
+const TCollection_AsciiString& XCAFDoc_NoteBinData::MIMEtype() const
 {
   return myMIMEtype;
 }
@@ -95,34 +104,40 @@ const Standard_GUID& XCAFDoc_NoteBinData::ID() const
 
 Handle(TDF_Attribute) XCAFDoc_NoteBinData::NewEmpty() const
 {
-  return new XCAFDoc_Note();
+  return new XCAFDoc_NoteBinData();
 }
 
 void XCAFDoc_NoteBinData::Restore(const Handle(TDF_Attribute)& theAttr)
 {
   XCAFDoc_Note::Restore(theAttr);
-  myData = Handle(XCAFDoc_NoteBinData)::DownCast(theAttr)->myData;
-  myMIMEtype = Handle(XCAFDoc_NoteBinData)::DownCast(theAttr)->myMIMEtype;
+
+  Handle(XCAFDoc_NoteBinData) aMine = Handle(XCAFDoc_NoteBinData)::DownCast(theAttr);
+  if (!aMine.IsNull())
+  {
+    myData = aMine->myData;
+    myTitle = aMine->myTitle;
+    myMIMEtype = aMine->myMIMEtype;
+  }
 }
 
 void XCAFDoc_NoteBinData::Paste(const Handle(TDF_Attribute)&       theAttrInto,
                                 const Handle(TDF_RelocationTable)& theRT) const
 {
   XCAFDoc_Note::Paste(theAttrInto, theRT);
-  Handle(XCAFDoc_NoteBinData)::DownCast(theAttrInto)->Set(myData, myMIMEtype);
+
+  Handle(XCAFDoc_NoteBinData) aMine = Handle(XCAFDoc_NoteBinData)::DownCast(theAttrInto);
+  if (!aMine.IsNull())
+    aMine->Set(myTitle, myData, myMIMEtype);
 }
 
 Standard_OStream& XCAFDoc_NoteBinData::Dump(Standard_OStream& theOS) const
 {
   XCAFDoc_Note::Dump(theOS);
-  theOS
-    << "\n"
-    << "MIME type : "
-    << (myMIMEtype ? myMIMEtype->String() : "<none>")
-    << "\n"
-    << "<BEGIN>"
-    << (myData ? myData->String() : "")
-    << "<END>"
+  theOS << "\n"
+    << "Title : " << (!myTitle.IsEmpty() ? myMIMEtype : "<untitled>") << "\n"
+    << "MIME type : " << (!myMIMEtype.IsEmpty() ? myMIMEtype : "<none>") << "\n"
+    << "Size : " << myData.Length() << " bytes" << "\n"
+    << myData
     ;
   return theOS;
 }
index 64c6ce7fde986cb9b3be0ef80303fe7265349d10..a508a36d2aefca3ad30daf21ddcba0e006da48ce 100644 (file)
@@ -19,7 +19,8 @@
 #include <XCAFDoc_Note.hxx>
 
 class OSD_File;
-class TCollection_HAsciiString;
+class TCollection_AsciiString;
+class TCollection_ExtendedString;
 
 class XCAFDoc_NoteBinData;
 DEFINE_STANDARD_HANDLE(XCAFDoc_NoteBinData, XCAFDoc_Note)
@@ -34,22 +35,26 @@ public:
 
   Standard_EXPORT static Standard_Boolean IsMine(const TDF_Label& theLabel);
 
-  Standard_EXPORT static Handle(XCAFDoc_NoteBinData) Set(const TDF_Label&                           theLabel,
-                                                         const Handle(TCollection_HExtendedString)& theUserName,
-                                                         const Handle(TCollection_HExtendedString)& theTimeStamp,
-                                                         OSD_File&                                  theFile,
-                                                         const Handle(TCollection_HAsciiString)&    theMIMEtype);
+  Standard_EXPORT static Handle(XCAFDoc_NoteBinData) Set(const TDF_Label&                  theLabel,
+                                                         const TCollection_ExtendedString& theUserName,
+                                                         const TCollection_ExtendedString& theTimeStamp,
+                                                         const TCollection_ExtendedString& theTitle,
+                                                         OSD_File&                         theFile,
+                                                         const TCollection_AsciiString&    theMIMEtype);
 
   Standard_EXPORT XCAFDoc_NoteBinData();
 
-  Standard_EXPORT void Set(OSD_File&                               theFile,
-                           const Handle(TCollection_HAsciiString)& theMIMEtype);
+  Standard_EXPORT void Set(const TCollection_ExtendedString& theTitle, 
+                           OSD_File&                         theFile,
+                           const TCollection_AsciiString&    theMIMEtype);
 
-  Standard_EXPORT void Set(const Handle(TCollection_HAsciiString)& theData,
-                           const Handle(TCollection_HAsciiString)& theMIMEtype);
+  Standard_EXPORT void Set(const TCollection_ExtendedString& theTitle, 
+                           const TCollection_AsciiString&    theData,
+                           const TCollection_AsciiString&    theMIMEtype);
 
-  Standard_EXPORT Handle(TCollection_HAsciiString) Data() const;
-  Standard_EXPORT Handle(TCollection_HAsciiString) MIMEtype() const;
+  Standard_EXPORT const TCollection_ExtendedString& Title() const;
+  Standard_EXPORT const TCollection_AsciiString& Data() const;
+  Standard_EXPORT const TCollection_AsciiString& MIMEtype() const;
 
 public:
 
@@ -66,8 +71,9 @@ public:
 
 protected:
 
-  Handle(TCollection_HAsciiString) myData;
-  Handle(TCollection_HAsciiString) myMIMEtype;
+  TCollection_ExtendedString myTitle;
+  TCollection_AsciiString myData;
+  TCollection_AsciiString myMIMEtype;
 };
 
 #endif // _XCAFDoc_NoteBinData_HeaderFile
index 23e9f568344e89f1007fe15d0bb2b896766d030d..3e6f2d68f9854340a33fae26efdde1a10cfe9578 100644 (file)
@@ -31,13 +31,13 @@ Standard_Boolean XCAFDoc_NoteComment::IsMine(const TDF_Label& theLabel)
   return (!theLabel.IsNull() && theLabel.FindAttribute(XCAFDoc_NoteComment::GetID(), anAttr));
 }
 
-Handle(XCAFDoc_NoteComment) XCAFDoc_NoteComment::Set(const TDF_Label&                           theLabel,
-                                                     const Handle(TCollection_HExtendedString)& theUserName,
-                                                     const Handle(TCollection_HExtendedString)& theTimeStamp,
-                                                     const Handle(TCollection_HExtendedString)& 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_Note::GetID(), aNoteComment))
+  if (!theLabel.IsNull() && !theLabel.FindAttribute(XCAFDoc_NoteComment::GetID(), aNoteComment))
   {
     aNoteComment = new XCAFDoc_NoteComment();
     aNoteComment->XCAFDoc_Note::Set(theUserName, theTimeStamp);
@@ -51,14 +51,14 @@ XCAFDoc_NoteComment::XCAFDoc_NoteComment()
 {
 }
 
-void XCAFDoc_NoteComment::Set(const Handle(TCollection_HExtendedString)& theComment)
+void XCAFDoc_NoteComment::Set(const TCollection_ExtendedString& theComment)
 {
   Backup();
 
   myComment = theComment;
 }
 
-Handle(TCollection_HExtendedString) XCAFDoc_NoteComment::Comment() const
+const TCollection_ExtendedString& XCAFDoc_NoteComment::Comment() const
 {
   return myComment;
 }
@@ -70,29 +70,33 @@ const Standard_GUID& XCAFDoc_NoteComment::ID() const
 
 Handle(TDF_Attribute) XCAFDoc_NoteComment::NewEmpty() const
 {
-  return new XCAFDoc_Note();
+  return new XCAFDoc_NoteComment();
 }
 
 void XCAFDoc_NoteComment::Restore(const Handle(TDF_Attribute)& theAttr)
 {
   XCAFDoc_Note::Restore(theAttr);
-  myComment = Handle(XCAFDoc_NoteComment)::DownCast(theAttr)->myComment;
+
+  Handle(XCAFDoc_NoteComment) aMine = Handle(XCAFDoc_NoteComment)::DownCast(theAttr);
+  if (!aMine.IsNull())
+    myComment = aMine->myComment;
 }
 
 void XCAFDoc_NoteComment::Paste(const Handle(TDF_Attribute)&       theAttrInto,
                                 const Handle(TDF_RelocationTable)& theRT) const
 {
   XCAFDoc_Note::Paste(theAttrInto, theRT);
-  Handle(XCAFDoc_NoteComment)::DownCast(theAttrInto)->Set(myComment);
+
+  Handle(XCAFDoc_NoteComment) aMine = Handle(XCAFDoc_NoteComment)::DownCast(theAttrInto);
+  if (!aMine.IsNull())
+    aMine->Set(myComment);
 }
 
 Standard_OStream& XCAFDoc_NoteComment::Dump(Standard_OStream& theOS) const
 {
   XCAFDoc_Note::Dump(theOS);
-  theOS
-    << "\n"
-    << "Comment : "
-    << (myComment ? myComment->String() : "<empty>")
+  theOS << "\n"
+    << "Comment : " << (!myComment.IsEmpty() ? myComment : "<empty>")
     ;
   return theOS;
 }
index 99c9363fb222a32b95261241c271de1b533aa0e9..04f6a15865e37be1d0719a664f20d2474bec5f8b 100644 (file)
@@ -31,16 +31,16 @@ public:
 
   Standard_EXPORT static Standard_Boolean IsMine(const TDF_Label& theLabel);
 
-  Standard_EXPORT static Handle(XCAFDoc_NoteComment) Set(const TDF_Label&                           theLabel,
-                                                         const Handle(TCollection_HExtendedString)& theUserName,
-                                                         const Handle(TCollection_HExtendedString)& theTimeStamp,
-                                                         const Handle(TCollection_HExtendedString)& theComment);
+  Standard_EXPORT static Handle(XCAFDoc_NoteComment) Set(const TDF_Label&                  theLabel,
+                                                         const TCollection_ExtendedString& theUserName,
+                                                         const TCollection_ExtendedString& theTimeStamp,
+                                                         const TCollection_ExtendedString& theComment);
 
   Standard_EXPORT XCAFDoc_NoteComment();
 
-  Standard_EXPORT void Set(const Handle(TCollection_HExtendedString)& theComment);
+  Standard_EXPORT void Set(const TCollection_ExtendedString& theComment);
 
-  Standard_EXPORT Handle(TCollection_HExtendedString) Comment() const;
+  Standard_EXPORT const TCollection_ExtendedString& Comment() const;
 
 public:
 
@@ -57,7 +57,7 @@ public:
 
 protected:
 
-  Handle(TCollection_HExtendedString) myComment;
+  TCollection_ExtendedString myComment;
 };
 
 #endif // _XCAFDoc_NoteComment_HeaderFile
index 6dfcb387bd5b8e93f6c79661eaf7eebf08d78c25..4d5d4b32ca690439078c0ac3620bcc273a98e841 100644 (file)
@@ -20,7 +20,8 @@
 #include <XCAFDoc.hxx>
 #include <XCAFDoc_GraphNode.hxx>
 #include <XCAFDoc_NotesTool.hxx>
-#include <XCAFDoc_Note.hxx>
+#include <XCAFDoc_NoteComment.hxx>
+#include <XCAFDoc_NoteBinData.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_NotesTool, TDF_Attribute)
 
@@ -45,6 +46,20 @@ XCAFDoc_NotesTool::XCAFDoc_NotesTool()
 {
 }
 
+Standard_Integer XCAFDoc_NotesTool::NbNotes() const
+{
+  Standard_Integer nbNotes = 0;
+  for (TDF_ChildIterator anIter(Label()); anIter.More(); anIter.Next())
+  {
+    const TDF_Label aLabel = anIter.Value();
+    if (XCAFDoc_Note::IsMine(aLabel))
+    {
+      ++nbNotes;
+    }
+  }
+  return nbNotes;
+}
+
 void XCAFDoc_NotesTool::GetNotes(TDF_LabelSequence& theNoteLabels) const
 {
   theNoteLabels.Clear();
@@ -58,13 +73,117 @@ void XCAFDoc_NotesTool::GetNotes(TDF_LabelSequence& theNoteLabels) const
   }
 }
 
-Handle(XCAFDoc_Note) XCAFDoc_NotesTool::AddNote(const Handle(TCollection_HExtendedString)& theUserName,
-                                                const Handle(TCollection_HExtendedString)& theTimeStamp)
+Handle(XCAFDoc_Note) 
+XCAFDoc_NotesTool::AddComment(const TCollection_ExtendedString& theUserName,
+                              const TCollection_ExtendedString& theTimeStamp,
+                              const TCollection_ExtendedString& theComment)
 {
   TDF_Label aNoteLabel;
   TDF_TagSource aTag;
   aNoteLabel = aTag.NewChild(Label());
-  return XCAFDoc_Note::Set(aNoteLabel, theUserName, theTimeStamp);
+  return XCAFDoc_NoteComment::Set(aNoteLabel, theUserName, theTimeStamp, theComment);
+}
+
+Handle(XCAFDoc_Note) 
+XCAFDoc_NotesTool::AddBinData(const TCollection_ExtendedString& theUserName,
+                              const TCollection_ExtendedString& theTimeStamp,
+                              const TCollection_ExtendedString& theTitle,
+                              OSD_File&                         theFile,
+                              const TCollection_AsciiString&    theMIMEtype)
+{
+  TDF_Label aNoteLabel;
+  TDF_TagSource aTag;
+  aNoteLabel = aTag.NewChild(Label());
+  return XCAFDoc_NoteBinData::Set(aNoteLabel, theUserName, theTimeStamp, theTitle, theFile, theMIMEtype);
+}
+
+Standard_Boolean XCAFDoc_NotesTool::HasAttachedNotes(const TDF_Label& theLabel) const
+{
+  Handle(XCAFDoc_GraphNode) aChild;
+  return !theLabel.IsNull() && 
+         theLabel.FindAttribute(XCAFDoc::NoteRefGUID(), aChild) &&
+         (aChild->NbFathers() > 0);
+}
+
+void XCAFDoc_NotesTool::GetAttachedNotes(const TDF_Label&   theLabel,
+                                         TDF_LabelSequence& theNoteLabels) const
+{
+  theNoteLabels.Clear();
+
+  Handle(XCAFDoc_GraphNode) aChild;
+  if (!theLabel.IsNull() && theLabel.FindAttribute(XCAFDoc::NoteRefGUID(), aChild))
+  {
+    Standard_Integer nbNotes = aChild->NbFathers();
+    for (Standard_Integer iNote = 1; iNote <= nbNotes; ++iNote)
+    {
+      Handle(XCAFDoc_GraphNode) aNote = aChild->GetFather(iNote);
+      if (XCAFDoc_Note::IsMine(aNote->Label()))
+        theNoteLabels.Append(aNote->Label());
+    }
+  }
+}
+
+Standard_Integer XCAFDoc_NotesTool::DetachAllNotes(const TDF_Label& theLabel) const
+{
+  Standard_Integer nbNotes = 0;
+  Handle(XCAFDoc_GraphNode) aChild;
+  if (!theLabel.IsNull() && theLabel.FindAttribute(XCAFDoc::NoteRefGUID(), aChild))
+  {
+    Standard_Integer nbNotes = aChild->NbFathers();
+    for (Standard_Integer iNote = 1; iNote <= nbNotes; ++iNote)
+    {
+      aChild->UnSetFather(iNote);
+      ++nbNotes;
+    }
+  }
+  theLabel.ForgetAttribute(aChild);
+  return nbNotes;
+}
+
+Standard_Boolean XCAFDoc_NotesTool::RemoveNote(const TDF_Label& theNoteLabel)
+{
+  Handle(XCAFDoc_Note) aNote = XCAFDoc_Note::Get(theNoteLabel);
+  if (!aNote.IsNull())
+  {
+    aNote->DetachAll();
+    theNoteLabel.ForgetAllAttributes(Standard_True);
+    return Standard_True;
+  }
+  return Standard_False;
+}
+
+Standard_Integer XCAFDoc_NotesTool::RemoveNotes(TDF_LabelSequence& theNoteLabels)
+{
+  Standard_Integer nbNotes = 0;
+  for (TDF_LabelSequence::Iterator anIter(theNoteLabels); anIter.More(); anIter.Next())
+  {
+    if (RemoveNote(anIter.Value()))
+      ++nbNotes;
+  }
+  return nbNotes;
+}
+
+Standard_Integer XCAFDoc_NotesTool::RemoveDetachedNotes()
+{
+  Standard_Integer nbNotes = 0;
+  for (TDF_ChildIterator anIter(Label()); anIter.More(); anIter.Next())
+  {
+    Handle(XCAFDoc_Note) aNote = XCAFDoc_Note::Get(anIter.Value());
+    if (!aNote.IsNull() && !aNote->IsAttached() && RemoveNote(anIter.Value()))
+      ++nbNotes;
+  }
+  return nbNotes;
+}
+
+Standard_Integer XCAFDoc_NotesTool::RemoveAllNotes()
+{
+  Standard_Integer nbNotes = 0;
+  for (TDF_ChildIterator anIter(Label()); anIter.More(); anIter.Next())
+  {
+    if (RemoveNote(anIter.Value()))
+      ++nbNotes;
+  }
+  return nbNotes;
 }
 
 const Standard_GUID& XCAFDoc_NotesTool::ID() const
index 0ba2e14d2a708ec5e54e52b92731835b560f19f0..19702f5d9be564447a0cfac31d1736dac7808494 100644 (file)
 #include <TDF_Attribute.hxx>
 #include <TDF_LabelSequence.hxx>
 
+class OSD_File;
 class Standard_GUID;
-class TCollection_HExtendedString;
+class TCollection_AsciiString;
+class TCollection_ExtendedString;
 class TDF_RelocationTable;
 class XCAFDoc_Note;
 
@@ -37,18 +39,34 @@ public:
 
   Standard_EXPORT static const Standard_GUID& GetID();
 
-  //! Create (if not exist) NotesTool from XCAFDoc on <L>.
   Standard_EXPORT static Handle(XCAFDoc_NotesTool) Set(const TDF_Label& theLabel);
 
-  //! Creates an empty tool
   Standard_EXPORT XCAFDoc_NotesTool();
 
-  //! Returns a sequence of note labels currently stored in the tool table
+  Standard_EXPORT Standard_Integer NbNotes() const;
+
   Standard_EXPORT void GetNotes(TDF_LabelSequence& theNoteLabels) const;
 
-  //! Adds a new note and returns a handle to it
-  Standard_EXPORT Handle(XCAFDoc_Note) AddNote(const Handle(TCollection_HExtendedString)& theUserName,
-                                               const Handle(TCollection_HExtendedString)& theTimeStamp);
+  Standard_EXPORT Handle(XCAFDoc_Note) AddComment(const TCollection_ExtendedString& theUserName,
+                                                  const TCollection_ExtendedString& theTimeStamp,
+                                                  const TCollection_ExtendedString& theComment);
+
+  Standard_EXPORT Handle(XCAFDoc_Note) AddBinData(const TCollection_ExtendedString& theUserName,
+                                                  const TCollection_ExtendedString& theTimeStamp,
+                                                  const TCollection_ExtendedString& theTitle,
+                                                  OSD_File&                         theFile,
+                                                  const TCollection_AsciiString&    theMIMEtype);
+
+  Standard_EXPORT Standard_Boolean HasAttachedNotes(const TDF_Label& theLabel) const;
+
+  Standard_EXPORT void GetAttachedNotes(const TDF_Label&   theLabel,
+                                        TDF_LabelSequence& theNoteLabels) const;
+  Standard_EXPORT Standard_Integer DetachAllNotes(const TDF_Label& theLabel) const;
+
+  Standard_EXPORT Standard_Boolean RemoveNote(const TDF_Label& theNoteLabel);
+  Standard_EXPORT Standard_Integer RemoveNotes(TDF_LabelSequence& theNoteLabels);
+  Standard_EXPORT Standard_Integer RemoveDetachedNotes();
+  Standard_EXPORT Standard_Integer RemoveAllNotes();
 
 public:
 
index d93ba3b27c0b408dd74393538e388bc6cdf8423e..d56d8aea6cc0bc56e7f2946d8bedaaf59e539cb1 100644 (file)
@@ -29,6 +29,14 @@ XmlMXCAFDoc_MaterialDriver.cxx
 XmlMXCAFDoc_MaterialDriver.hxx
 XmlMXCAFDoc_MaterialToolDriver.cxx
 XmlMXCAFDoc_MaterialToolDriver.hxx
+XmlMXCAFDoc_NoteDriver.cxx
+XmlMXCAFDoc_NoteDriver.hxx
+XmlMXCAFDoc_NoteCommentDriver.cxx
+XmlMXCAFDoc_NoteCommentDriver.hxx
+XmlMXCAFDoc_NoteBinDataDriver.cxx
+XmlMXCAFDoc_NoteBinDataDriver.hxx
+XmlMXCAFDoc_NotesToolDriver.cxx
+XmlMXCAFDoc_NotesToolDriver.hxx
 XmlMXCAFDoc_ShapeToolDriver.cxx
 XmlMXCAFDoc_ShapeToolDriver.hxx
 XmlMXCAFDoc_ViewToolDriver.cxx
index fe596313b00919851ac831e4b8356a8c591665ba..7c959f9ee928bd45c94b8af93d9cac84894fab43 100644 (file)
@@ -32,6 +32,9 @@
 #include <XmlMXCAFDoc_LayerToolDriver.hxx>
 #include <XmlMXCAFDoc_LocationDriver.hxx>
 #include <XmlMXCAFDoc_MaterialDriver.hxx>
+#include <XmlMXCAFDoc_NotesToolDriver.hxx>
+#include <XmlMXCAFDoc_NoteCommentDriver.hxx>
+#include <XmlMXCAFDoc_NoteBinDataDriver.hxx>
 #include <XmlMXCAFDoc_MaterialToolDriver.hxx>
 #include <XmlMXCAFDoc_ShapeToolDriver.hxx>
 #include <XmlMXCAFDoc_ViewToolDriver.hxx>
@@ -66,6 +69,8 @@ void XmlMXCAFDoc::AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable,
   aDriverTable -> AddDriver (new XmlMXCAFDoc_DatumDriver     (anMsgDrv));
   aDriverTable -> AddDriver (new XmlMXCAFDoc_DimTolDriver    (anMsgDrv));
   aDriverTable -> AddDriver (new XmlMXCAFDoc_MaterialDriver  (anMsgDrv));
+  aDriverTable -> AddDriver (new XmlMXCAFDoc_NoteCommentDriver(anMsgDrv));
+  aDriverTable -> AddDriver (new XmlMXCAFDoc_NoteBinDataDriver(anMsgDrv));
 
   aDriverTable -> AddDriver (new XmlMXCAFDoc_ColorToolDriver    (anMsgDrv));
   aDriverTable -> AddDriver (new XmlMXCAFDoc_DocumentToolDriver (anMsgDrv));
@@ -73,6 +78,7 @@ void XmlMXCAFDoc::AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable,
   aDriverTable -> AddDriver (new XmlMXCAFDoc_ShapeToolDriver    (anMsgDrv));
   aDriverTable -> AddDriver (new XmlMXCAFDoc_DimTolToolDriver   (anMsgDrv));
   aDriverTable -> AddDriver (new XmlMXCAFDoc_MaterialToolDriver (anMsgDrv));
+  aDriverTable -> AddDriver (new XmlMXCAFDoc_NotesToolDriver    (anMsgDrv));
   aDriverTable -> AddDriver (new XmlMXCAFDoc_ViewToolDriver     (anMsgDrv));
   aDriverTable -> AddDriver (new XmlMXCAFDoc_ClippingPlaneToolDriver(anMsgDrv));
 }
index 1d9fb8545fd86e6d16f3ede798eda946d854b237..0bf1036945a2477b69ee74989fae03752f0333ee 100644 (file)
@@ -32,6 +32,11 @@ class XmlMXCAFDoc_VolumeDriver;
 class XmlMXCAFDoc_DatumDriver;
 class XmlMXCAFDoc_DimTolDriver;
 class XmlMXCAFDoc_MaterialDriver;
+class XmlMXCAFDoc_NotesToolDriver;
+class XmlMXCAFDoc_NoteDriver;
+class XmlMXCAFDoc_NoteCommentDriver;
+class XmlMXCAFDoc_NoteBinDataDriver;
+class XmlMXCAFDoc_ClippingPlaneToolDriver;
 class XmlMXCAFDoc_ColorToolDriver;
 class XmlMXCAFDoc_DocumentToolDriver;
 class XmlMXCAFDoc_LayerToolDriver;
@@ -77,6 +82,7 @@ friend class XmlMXCAFDoc_VolumeDriver;
 friend class XmlMXCAFDoc_DatumDriver;
 friend class XmlMXCAFDoc_DimTolDriver;
 friend class XmlMXCAFDoc_MaterialDriver;
+friend class XmlMXCAFDoc_ClippingPlaneToolDriver;
 friend class XmlMXCAFDoc_ColorToolDriver;
 friend class XmlMXCAFDoc_DocumentToolDriver;
 friend class XmlMXCAFDoc_LayerToolDriver;
diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_NoteBinDataDriver.cxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_NoteBinDataDriver.cxx
new file mode 100644 (file)
index 0000000..b53d3bc
--- /dev/null
@@ -0,0 +1,92 @@
+// Created on: 2017-02-14
+// Created by: Sergey NIKONOV
+// Copyright (c) 2008-2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <CDM_MessageDriver.hxx>
+#include <Standard_Type.hxx>
+#include <TDF_Attribute.hxx>
+#include <XCAFDoc_NoteBinData.hxx>
+#include <XmlMXCAFDoc_NoteBinDataDriver.hxx>
+#include <XmlObjMgt_Persistent.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(XmlMXCAFDoc_NoteBinDataDriver, XmlMXCAFDoc_NoteDriver)
+IMPLEMENT_DOMSTRING(Title, "title")
+IMPLEMENT_DOMSTRING(MIMEtype, "mime_type")
+IMPLEMENT_DOMSTRING(Data, "data")
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+XmlMXCAFDoc_NoteBinDataDriver::XmlMXCAFDoc_NoteBinDataDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
+  : XmlMXCAFDoc_NoteDriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_NoteBinData)->Name())
+{
+}
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+Handle(TDF_Attribute) XmlMXCAFDoc_NoteBinDataDriver::NewEmpty() const
+{
+  return new XCAFDoc_NoteBinData();
+}
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+Standard_Boolean XmlMXCAFDoc_NoteBinDataDriver::Paste(const XmlObjMgt_Persistent&  theSource,
+                                                      const Handle(TDF_Attribute)& theTarget,
+                                                      XmlObjMgt_RRelocationTable&  theRelocTable) const
+{
+  XmlMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable);
+
+  const XmlObjMgt_Element& anElement = theSource;
+
+  XmlObjMgt_DOMString aTitle = anElement.getAttribute(::Title());
+  XmlObjMgt_DOMString aMIMEtype = anElement.getAttribute(::MIMEtype());
+  XmlObjMgt_DOMString aData = anElement.getAttribute(::Data());
+  if (aTitle == NULL || aMIMEtype == NULL || aData == NULL)
+    return Standard_False;
+
+  Handle(XCAFDoc_NoteBinData) aNote = Handle(XCAFDoc_NoteBinData)::DownCast(theTarget);
+  if (aNote.IsNull())
+    return Standard_False;
+
+  aNote->Set(aTitle.GetString(), aData.GetString(), aMIMEtype.GetString());
+
+  return Standard_True;
+}
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+void XmlMXCAFDoc_NoteBinDataDriver::Paste(const Handle(TDF_Attribute)& theSource,
+                                          XmlObjMgt_Persistent&        theTarget,
+                                          XmlObjMgt_SRelocationTable&  theRelocTable) const
+{
+  XmlMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable);
+
+  Handle(XCAFDoc_NoteBinData) aNote = Handle(XCAFDoc_NoteBinData)::DownCast(theSource);
+
+  XmlObjMgt_DOMString aTitle(TCollection_AsciiString(aNote->Title()).ToCString());
+  XmlObjMgt_DOMString aMIMEtype(aNote->MIMEtype().ToCString());
+  XmlObjMgt_DOMString aData(aNote->Data().ToCString());
+
+  theTarget.Element().setAttribute(::Title(), aTitle);
+  theTarget.Element().setAttribute(::MIMEtype(), aMIMEtype);
+  theTarget.Element().setAttribute(::Data(), aData);
+}
diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_NoteBinDataDriver.hxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_NoteBinDataDriver.hxx
new file mode 100644 (file)
index 0000000..cca07af
--- /dev/null
@@ -0,0 +1,45 @@
+// Created on: 2017-02-14
+// Created by: Sergey NIKONOV
+// Copyright (c) 2008-2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _XmlMXCAFDoc_NoteBinDataDriver_HeaderFile
+#define _XmlMXCAFDoc_NoteBinDataDriver_HeaderFile
+
+#include <XmlMXCAFDoc_NoteDriver.hxx>
+
+class XmlMXCAFDoc_NoteBinDataDriver;
+DEFINE_STANDARD_HANDLE(XmlMXCAFDoc_NoteBinDataDriver, XmlMXCAFDoc_NoteDriver)
+
+//! Attribute Driver.
+class XmlMXCAFDoc_NoteBinDataDriver : public XmlMXCAFDoc_NoteDriver
+{
+public:
+
+  Standard_EXPORT XmlMXCAFDoc_NoteBinDataDriver(const Handle(CDM_MessageDriver)& theMessageDriver);
+
+  Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
+
+  Standard_EXPORT Standard_Boolean Paste(const XmlObjMgt_Persistent&  theSource,
+                                         const Handle(TDF_Attribute)& theTarget,
+                                         XmlObjMgt_RRelocationTable&  theRelocTable) const Standard_OVERRIDE;
+
+  Standard_EXPORT void Paste(const Handle(TDF_Attribute)& theSource,
+                             XmlObjMgt_Persistent&        theTarget,
+                             XmlObjMgt_SRelocationTable&  theRelocTable) const Standard_OVERRIDE;
+
+  DEFINE_STANDARD_RTTIEXT(XmlMXCAFDoc_NoteBinDataDriver, XmlMXCAFDoc_NoteDriver)
+
+};
+
+#endif // _XmlMXCAFDoc_NoteBinDataDriver_HeaderFile
diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_NoteCommentDriver.cxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_NoteCommentDriver.cxx
new file mode 100644 (file)
index 0000000..c32baf6
--- /dev/null
@@ -0,0 +1,84 @@
+// Created on: 2017-02-14
+// Created by: Sergey NIKONOV
+// Copyright (c) 2008-2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <CDM_MessageDriver.hxx>
+#include <Standard_Type.hxx>
+#include <TDF_Attribute.hxx>
+#include <XCAFDoc_NoteComment.hxx>
+#include <XmlMXCAFDoc_NoteCommentDriver.hxx>
+#include <XmlObjMgt_Persistent.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(XmlMXCAFDoc_NoteCommentDriver, XmlMXCAFDoc_NoteDriver)
+IMPLEMENT_DOMSTRING(Comment, "comment")
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+XmlMXCAFDoc_NoteCommentDriver::XmlMXCAFDoc_NoteCommentDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
+  : XmlMXCAFDoc_NoteDriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_NoteComment)->Name())
+{
+}
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+Handle(TDF_Attribute) XmlMXCAFDoc_NoteCommentDriver::NewEmpty() const
+{
+  return new XCAFDoc_NoteComment();
+}
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+Standard_Boolean XmlMXCAFDoc_NoteCommentDriver::Paste(const XmlObjMgt_Persistent&  theSource,
+                                                      const Handle(TDF_Attribute)& theTarget,
+                                                      XmlObjMgt_RRelocationTable&  theRelocTable) const
+{
+  XmlMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable);
+
+  const XmlObjMgt_Element& anElement = theSource;
+
+  XmlObjMgt_DOMString aComment = anElement.getAttribute(::Comment());
+  if (aComment == NULL)
+    return Standard_False;
+
+  Handle(XCAFDoc_NoteComment) aNote = Handle(XCAFDoc_NoteComment)::DownCast(theTarget);
+  if (aNote.IsNull())
+    return Standard_False;
+
+  aNote->Set(aComment.GetString());
+
+  return Standard_True;
+}
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+void XmlMXCAFDoc_NoteCommentDriver::Paste(const Handle(TDF_Attribute)& theSource,
+                                          XmlObjMgt_Persistent&        theTarget,
+                                          XmlObjMgt_SRelocationTable&  theRelocTable) const
+{
+  XmlMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable);
+
+  Handle(XCAFDoc_NoteComment) aNote = Handle(XCAFDoc_NoteComment)::DownCast(theSource);
+
+  XmlObjMgt_DOMString aComment(TCollection_AsciiString(aNote->TimeStamp()).ToCString());
+
+  theTarget.Element().setAttribute(::Comment(), aComment);
+}
diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_NoteCommentDriver.hxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_NoteCommentDriver.hxx
new file mode 100644 (file)
index 0000000..fd478cf
--- /dev/null
@@ -0,0 +1,45 @@
+// Created on: 2017-02-14
+// Created by: Sergey NIKONOV
+// Copyright (c) 2008-2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _XmlMXCAFDoc_NoteCommentDriver_HeaderFile
+#define _XmlMXCAFDoc_NoteCommentDriver_HeaderFile
+
+#include <XmlMXCAFDoc_NoteDriver.hxx>
+
+class XmlMXCAFDoc_NoteCommentDriver;
+DEFINE_STANDARD_HANDLE(XmlMXCAFDoc_NoteCommentDriver, XmlMXCAFDoc_NoteDriver)
+
+//! Attribute Driver.
+class XmlMXCAFDoc_NoteCommentDriver : public XmlMXCAFDoc_NoteDriver
+{
+public:
+
+  Standard_EXPORT XmlMXCAFDoc_NoteCommentDriver(const Handle(CDM_MessageDriver)& theMessageDriver);
+
+  Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
+
+  Standard_EXPORT Standard_Boolean Paste(const XmlObjMgt_Persistent&  theSource,
+                                         const Handle(TDF_Attribute)& theTarget,
+                                         XmlObjMgt_RRelocationTable&  theRelocTable) const Standard_OVERRIDE;
+
+  Standard_EXPORT void Paste(const Handle(TDF_Attribute)& theSource,
+                             XmlObjMgt_Persistent&        theTarget,
+                             XmlObjMgt_SRelocationTable&  theRelocTable) const Standard_OVERRIDE;
+
+  DEFINE_STANDARD_RTTIEXT(XmlMXCAFDoc_NoteCommentDriver, XmlMXCAFDoc_NoteDriver)
+
+};
+
+#endif // _XmlMXCAFDoc_NoteCommentDriver_HeaderFile
diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_NoteDriver.cxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_NoteDriver.cxx
new file mode 100644 (file)
index 0000000..63b2b8d
--- /dev/null
@@ -0,0 +1,78 @@
+// Created on: 2017-02-14
+// Created by: Sergey NIKONOV
+// Copyright (c) 2008-2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <CDM_MessageDriver.hxx>
+#include <Standard_Type.hxx>
+#include <TDF_Attribute.hxx>
+#include <XCAFDoc_Note.hxx>
+#include <XmlMXCAFDoc_NoteDriver.hxx>
+#include <XmlObjMgt_Persistent.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(XmlMXCAFDoc_NoteDriver, XmlMDF_ADriver)
+IMPLEMENT_DOMSTRING(UserName, "user_name")
+IMPLEMENT_DOMSTRING(TimeStamp, "time_stamp")
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+XmlMXCAFDoc_NoteDriver::XmlMXCAFDoc_NoteDriver(const Handle(CDM_MessageDriver)& theMsgDriver,
+                                               Standard_CString                 theName)
+  : XmlMDF_ADriver(theMsgDriver, theName)
+{
+}
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+Standard_Boolean XmlMXCAFDoc_NoteDriver::Paste(const XmlObjMgt_Persistent&  theSource,
+                                               const Handle(TDF_Attribute)& theTarget,
+                                               XmlObjMgt_RRelocationTable&  /*theRelocTable*/) const
+{
+  const XmlObjMgt_Element& anElement = theSource;
+
+  XmlObjMgt_DOMString aUserName = anElement.getAttribute(::UserName());
+  XmlObjMgt_DOMString aTimeStamp = anElement.getAttribute(::TimeStamp());
+  if (aUserName == NULL || aTimeStamp == NULL) 
+    return Standard_False;
+
+  Handle(XCAFDoc_Note) aNote = Handle(XCAFDoc_Note)::DownCast(theTarget);
+  if (aNote.IsNull())
+    return Standard_False;
+
+  aNote->Set(aUserName.GetString(), aTimeStamp.GetString());
+
+  return Standard_True;
+}
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+void XmlMXCAFDoc_NoteDriver::Paste(const Handle(TDF_Attribute)& theSource,
+                                   XmlObjMgt_Persistent&        theTarget,
+                                   XmlObjMgt_SRelocationTable&  /*theRelocTable*/) const
+{
+  Handle(XCAFDoc_Note) aNote = Handle(XCAFDoc_Note)::DownCast(theSource);
+  if (aNote.IsNull())
+    return;
+
+  XmlObjMgt_DOMString aUserName(TCollection_AsciiString(aNote->UserName()).ToCString());
+  XmlObjMgt_DOMString aTimeStamp(TCollection_AsciiString(aNote->TimeStamp()).ToCString());
+
+  theTarget.Element().setAttribute(::UserName(), aUserName);
+  theTarget.Element().setAttribute(::TimeStamp(), aTimeStamp);
+}
diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_NoteDriver.hxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_NoteDriver.hxx
new file mode 100644 (file)
index 0000000..c5578f7
--- /dev/null
@@ -0,0 +1,56 @@
+// Created on: 2017-02-14
+// Created by: Sergey NIKONOV
+// Copyright (c) 2008-2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _XmlMXCAFDoc_NoteDriver_HeaderFile
+#define _XmlMXCAFDoc_NoteDriver_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_Type.hxx>
+
+#include <XmlMDF_ADriver.hxx>
+#include <Standard_Boolean.hxx>
+#include <XmlObjMgt_RRelocationTable.hxx>
+#include <XmlObjMgt_SRelocationTable.hxx>
+
+class CDM_MessageDriver;
+class TDF_Attribute;
+class XmlObjMgt_Persistent;
+
+class XmlMXCAFDoc_NoteDriver;
+DEFINE_STANDARD_HANDLE(XmlMXCAFDoc_NoteDriver, XmlMDF_ADriver)
+
+//! Attribute Driver.
+class XmlMXCAFDoc_NoteDriver : public XmlMDF_ADriver
+{
+public:
+
+  Standard_EXPORT Standard_Boolean Paste(const XmlObjMgt_Persistent&  theSource,
+    const Handle(TDF_Attribute)& theTarget,
+    XmlObjMgt_RRelocationTable&  theRelocTable) const Standard_OVERRIDE;
+
+  Standard_EXPORT void Paste(const Handle(TDF_Attribute)& theSource,
+    XmlObjMgt_Persistent&        theTarget,
+    XmlObjMgt_SRelocationTable&  theRelocTable) const Standard_OVERRIDE;
+
+  DEFINE_STANDARD_RTTIEXT(XmlMXCAFDoc_NoteDriver, XmlMDF_ADriver)
+
+protected:
+
+  Standard_EXPORT XmlMXCAFDoc_NoteDriver(const Handle(CDM_MessageDriver)& theMsgDriver,
+                                         Standard_CString                 theName);
+
+};
+
+#endif // _XmlMXCAFDoc_NoteDriver_HeaderFile
diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_NotesToolDriver.cxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_NotesToolDriver.cxx
new file mode 100644 (file)
index 0000000..dd946f5
--- /dev/null
@@ -0,0 +1,62 @@
+// Created on: 2017-02-14
+// Created by: Sergey NIKONOV
+// Copyright (c) 2008-2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <CDM_MessageDriver.hxx>
+#include <Standard_Type.hxx>
+#include <TDF_Attribute.hxx>
+#include <XCAFDoc_NotesTool.hxx>
+#include <XmlMXCAFDoc_NotesToolDriver.hxx>
+#include <XmlObjMgt_Persistent.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(XmlMXCAFDoc_NotesToolDriver, XmlMDF_ADriver)
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+XmlMXCAFDoc_NotesToolDriver::XmlMXCAFDoc_NotesToolDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
+  : XmlMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_NotesTool)->Name())
+{
+}
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+Handle(TDF_Attribute) XmlMXCAFDoc_NotesToolDriver::NewEmpty() const
+{
+  return new XCAFDoc_NotesTool();
+}
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+Standard_Boolean XmlMXCAFDoc_NotesToolDriver::Paste(const XmlObjMgt_Persistent&  /*theSource*/,
+                                                    const Handle(TDF_Attribute)& /*theTarget*/,
+                                                    XmlObjMgt_RRelocationTable&  /*theRelocTable*/) const
+{
+  return Standard_True;
+}
+
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+void XmlMXCAFDoc_NotesToolDriver::Paste(const Handle(TDF_Attribute)& /*theSource*/,
+                                        XmlObjMgt_Persistent&        /*theTarget*/,
+                                        XmlObjMgt_SRelocationTable&  /*theRelocTable*/) const
+{
+}
diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_NotesToolDriver.hxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_NotesToolDriver.hxx
new file mode 100644 (file)
index 0000000..6de16cb
--- /dev/null
@@ -0,0 +1,55 @@
+// Created on: 2017-02-14
+// Created by: Sergey NIKONOV
+// Copyright (c) 2008-2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _XmlMXCAFDoc_NotesToolDriver_HeaderFile
+#define _XmlMXCAFDoc_NotesToolDriver_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_Type.hxx>
+
+#include <XmlMDF_ADriver.hxx>
+#include <Standard_Boolean.hxx>
+#include <XmlObjMgt_RRelocationTable.hxx>
+#include <XmlObjMgt_SRelocationTable.hxx>
+
+class CDM_MessageDriver;
+class TDF_Attribute;
+class XmlObjMgt_Persistent;
+
+class XmlMXCAFDoc_NotesToolDriver;
+DEFINE_STANDARD_HANDLE(XmlMXCAFDoc_NotesToolDriver, XmlMDF_ADriver)
+
+//! Attribute Driver.
+class XmlMXCAFDoc_NotesToolDriver : public XmlMDF_ADriver
+{
+public:
+  
+  Standard_EXPORT XmlMXCAFDoc_NotesToolDriver(const Handle(CDM_MessageDriver)& theMsgDriver);
+  
+  Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
+  
+  Standard_EXPORT Standard_Boolean Paste(const XmlObjMgt_Persistent&  theSource, 
+                                         const Handle(TDF_Attribute)& theTarget, 
+                                         XmlObjMgt_RRelocationTable&  theRelocTable) const Standard_OVERRIDE;
+  
+  Standard_EXPORT void Paste(const Handle(TDF_Attribute)& theSource, 
+                             XmlObjMgt_Persistent&        theTarget, 
+                             XmlObjMgt_SRelocationTable&  theRelocTable) const Standard_OVERRIDE;
+
+  DEFINE_STANDARD_RTTIEXT(XmlMXCAFDoc_NotesToolDriver, XmlMDF_ADriver)
+
+};
+
+#endif // _XmlMXCAFDoc_NotesToolDriver_HeaderFile