diff --git a/src/BinMXCAFDoc/BinMXCAFDoc.cxx b/src/BinMXCAFDoc/BinMXCAFDoc.cxx index c0ba1d8d57..5e9c340dc6 100644 --- a/src/BinMXCAFDoc/BinMXCAFDoc.cxx +++ b/src/BinMXCAFDoc/BinMXCAFDoc.cxx @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include #include @@ -44,7 +46,8 @@ //purpose : //======================================================================= void BinMXCAFDoc::AddDrivers(const Handle(BinMDF_ADriverTable)& theDriverTable, - const Handle(CDM_MessageDriver)& theMsgDrv) { + const Handle(CDM_MessageDriver)& theMsgDrv) +{ theDriverTable->AddDriver( new BinMXCAFDoc_AreaDriver (theMsgDrv)); theDriverTable->AddDriver( new BinMXCAFDoc_CentroidDriver (theMsgDrv)); theDriverTable->AddDriver( new BinMXCAFDoc_ColorDriver (theMsgDrv)); @@ -63,13 +66,14 @@ void BinMXCAFDoc::AddDrivers(const Handle(BinMDF_ADriverTable)& theDriverTable, } theDriverTable->AddDriver( aLocationDriver); - theDriverTable->AddDriver( new BinMXCAFDoc_VolumeDriver (theMsgDrv)); - theDriverTable->AddDriver( new BinMXCAFDoc_DatumDriver (theMsgDrv)); + theDriverTable->AddDriver( new BinMXCAFDoc_VolumeDriver (theMsgDrv)); + theDriverTable->AddDriver( new BinMXCAFDoc_DatumDriver (theMsgDrv)); theDriverTable->AddDriver( new BinMXCAFDoc_GeomToleranceDriver (theMsgDrv)); - theDriverTable->AddDriver( new BinMXCAFDoc_DimensionDriver (theMsgDrv)); - theDriverTable->AddDriver( new BinMXCAFDoc_DimTolDriver (theMsgDrv)); - theDriverTable->AddDriver( new BinMXCAFDoc_MaterialDriver (theMsgDrv)); - theDriverTable->AddDriver( new BinMXCAFDoc_ViewDriver (theMsgDrv)); + 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_ViewDriver (theMsgDrv)); theDriverTable->AddDriver( new BinMXCAFDoc_ColorToolDriver (theMsgDrv)); theDriverTable->AddDriver( new BinMXCAFDoc_DocumentToolDriver(theMsgDrv)); @@ -77,5 +81,6 @@ void BinMXCAFDoc::AddDrivers(const Handle(BinMDF_ADriverTable)& theDriverTable, theDriverTable->AddDriver( new BinMXCAFDoc_ShapeToolDriver (theMsgDrv)); theDriverTable->AddDriver( new BinMXCAFDoc_DimTolToolDriver (theMsgDrv)); theDriverTable->AddDriver( new BinMXCAFDoc_MaterialToolDriver(theMsgDrv)); + theDriverTable->AddDriver( new BinMXCAFDoc_NotesToolDriver (theMsgDrv)); theDriverTable->AddDriver( new BinMXCAFDoc_ViewToolDriver (theMsgDrv)); } diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_NoteDriver.cxx b/src/BinMXCAFDoc/BinMXCAFDoc_NoteDriver.cxx new file mode 100644 index 0000000000..c950ecca65 --- /dev/null +++ b/src/BinMXCAFDoc/BinMXCAFDoc_NoteDriver.cxx @@ -0,0 +1,62 @@ +// Created on: 2017-02-10 +// Created by: Eugeny NIKONOV +// Copyright (c) 2005-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 +#include +#include +#include +#include +#include + +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 : +//======================================================================= +Handle(TDF_Attribute) BinMXCAFDoc_NoteDriver::NewEmpty() const +{ + return new XCAFDoc_Note(); +} + +//======================================================================= +//function : +//purpose : +//======================================================================= +Standard_Boolean BinMXCAFDoc_NoteDriver::Paste(const BinObjMgt_Persistent& /*theSource*/, + const Handle(TDF_Attribute)& /*theTarget*/, + BinObjMgt_RRelocationTable& /*theRelocTable*/) const +{ + return Standard_True; +} + +//======================================================================= +//function : +//purpose : +//======================================================================= +void BinMXCAFDoc_NoteDriver::Paste(const Handle(TDF_Attribute)& /*theSource*/, + BinObjMgt_Persistent& /*theTarget*/, + BinObjMgt_SRelocationTable& /*theRelocTable*/) const +{ +} diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_NoteDriver.hxx b/src/BinMXCAFDoc/BinMXCAFDoc_NoteDriver.hxx new file mode 100644 index 0000000000..18b94160c5 --- /dev/null +++ b/src/BinMXCAFDoc/BinMXCAFDoc_NoteDriver.hxx @@ -0,0 +1,54 @@ +// Created on: 2017-02-10 +// Created by: Sergey NIKONOV +// Copyright (c) 2005-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 _BinMXCAFDoc_NoteDriver_HeaderFile +#define _BinMXCAFDoc_NoteDriver_HeaderFile + +#include +#include + +#include +#include +#include +#include + +class CDM_MessageDriver; +class TDF_Attribute; +class BinObjMgt_Persistent; + +class BinMXCAFDoc_NoteDriver; +DEFINE_STANDARD_HANDLE(BinMXCAFDoc_NoteDriver, BinMDF_ADriver) + +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; + + Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theSource, + BinObjMgt_Persistent& theTarget, + BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE; + + DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_NoteDriver, BinMDF_ADriver) + +}; + +#endif // _BinMXCAFDoc_NoteDriver_HeaderFile diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_NotesToolDriver.cxx b/src/BinMXCAFDoc/BinMXCAFDoc_NotesToolDriver.cxx new file mode 100644 index 0000000000..a3979e2be5 --- /dev/null +++ b/src/BinMXCAFDoc/BinMXCAFDoc_NotesToolDriver.cxx @@ -0,0 +1,62 @@ +// Created on: 2017-02-10 +// Created by: Eugeny NIKONOV +// Copyright (c) 2005-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 +#include +#include +#include +#include +#include + +IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NotesToolDriver, BinMDF_ADriver) + +//======================================================================= +//function : +//purpose : +//======================================================================= +BinMXCAFDoc_NotesToolDriver::BinMXCAFDoc_NotesToolDriver(const Handle(CDM_MessageDriver)& theMsgDriver) + : BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_NotesTool)->Name()) +{ +} + +//======================================================================= +//function : +//purpose : +//======================================================================= +Handle(TDF_Attribute) BinMXCAFDoc_NotesToolDriver::NewEmpty() const +{ + return new XCAFDoc_NotesTool(); +} + +//======================================================================= +//function : +//purpose : +//======================================================================= +Standard_Boolean BinMXCAFDoc_NotesToolDriver::Paste(const BinObjMgt_Persistent& /*theSource*/, + const Handle(TDF_Attribute)& /*theTarget*/, + BinObjMgt_RRelocationTable& /*theRelocTable*/) const +{ + return Standard_True; +} + +//======================================================================= +//function : +//purpose : +//======================================================================= +void BinMXCAFDoc_NotesToolDriver::Paste(const Handle(TDF_Attribute)& /*theSource*/, + BinObjMgt_Persistent& /*theTarget*/, + BinObjMgt_SRelocationTable& /*theRelocTable*/) const +{ +} diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_NotesToolDriver.hxx b/src/BinMXCAFDoc/BinMXCAFDoc_NotesToolDriver.hxx new file mode 100644 index 0000000000..3a8fa0a3b7 --- /dev/null +++ b/src/BinMXCAFDoc/BinMXCAFDoc_NotesToolDriver.hxx @@ -0,0 +1,54 @@ +// Created on: 2017-02-10 +// Created by: Sergey NIKONOV +// Copyright (c) 2005-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 _BinMXCAFDoc_NotesToolDriver_HeaderFile +#define _BinMXCAFDoc_NotesToolDriver_HeaderFile + +#include +#include + +#include +#include +#include +#include + +class CDM_MessageDriver; +class TDF_Attribute; +class BinObjMgt_Persistent; + +class BinMXCAFDoc_NotesToolDriver; +DEFINE_STANDARD_HANDLE(BinMXCAFDoc_NotesToolDriver, BinMDF_ADriver) + +class BinMXCAFDoc_NotesToolDriver : public BinMDF_ADriver +{ +public: + + Standard_EXPORT BinMXCAFDoc_NotesToolDriver(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; + + Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theSource, + BinObjMgt_Persistent& theTarget, + BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE; + + DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_NotesToolDriver, BinMDF_ADriver) + +}; + +#endif // _BinMXCAFDoc_NotesToolDriver_HeaderFile diff --git a/src/BinMXCAFDoc/FILES b/src/BinMXCAFDoc/FILES index fe29702e24..aa1a13087e 100644 --- a/src/BinMXCAFDoc/FILES +++ b/src/BinMXCAFDoc/FILES @@ -33,6 +33,10 @@ BinMXCAFDoc_MaterialDriver.cxx BinMXCAFDoc_MaterialDriver.hxx BinMXCAFDoc_MaterialToolDriver.cxx BinMXCAFDoc_MaterialToolDriver.hxx +BinMXCAFDoc_NoteDriver.cxx +BinMXCAFDoc_NoteDriver.hxx +BinMXCAFDoc_NotesToolDriver.cxx +BinMXCAFDoc_NotesToolDriver.hxx BinMXCAFDoc_ShapeToolDriver.cxx BinMXCAFDoc_ShapeToolDriver.hxx BinMXCAFDoc_ViewDriver.cxx diff --git a/src/XCAFDoc/FILES b/src/XCAFDoc/FILES index a30837c6fe..820b8ef31f 100755 --- a/src/XCAFDoc/FILES +++ b/src/XCAFDoc/FILES @@ -40,6 +40,10 @@ XCAFDoc_Material.cxx XCAFDoc_Material.hxx XCAFDoc_MaterialTool.cxx XCAFDoc_MaterialTool.hxx +XCAFDoc_Note.cxx +XCAFDoc_Note.hxx +XCAFDoc_NotesTool.cxx +XCAFDoc_NotesTool.hxx XCAFDoc_ShapeMapTool.cxx XCAFDoc_ShapeMapTool.hxx XCAFDoc_ShapeTool.cxx diff --git a/src/XCAFDoc/XCAFDoc_DocumentTool.cxx b/src/XCAFDoc/XCAFDoc_DocumentTool.cxx index fdaa9c5448..5614c690f0 100644 --- a/src/XCAFDoc/XCAFDoc_DocumentTool.cxx +++ b/src/XCAFDoc/XCAFDoc_DocumentTool.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -83,6 +84,7 @@ Handle(XCAFDoc_DocumentTool) XCAFDoc_DocumentTool::Set(const TDF_Label& L, XCAFDoc_LayerTool::Set(LayersLabel(L)); XCAFDoc_DimTolTool::Set(DGTsLabel(L)); XCAFDoc_MaterialTool::Set(MaterialsLabel(L)); + XCAFDoc_NotesTool::Set(NotesLabel(L)); XCAFDoc_ViewTool::Set(ViewsLabel(L)); XCAFDoc_ClippingPlaneTool::Set(ClippingPlanesLabel(L)); } @@ -211,6 +213,18 @@ TDF_Label XCAFDoc_DocumentTool::ClippingPlanesLabel(const TDF_Label& acces) return L; } +//======================================================================= +//function : NotesLabel +//purpose : +//======================================================================= + +TDF_Label XCAFDoc_DocumentTool::NotesLabel(const TDF_Label& acces) +{ + TDF_Label L = DocLabel(acces).FindChild(9, Standard_True); + TDataStd_Name::Set(L, "Notes"); + return L; +} + //======================================================================= //function : ShapeTool //purpose : @@ -285,6 +299,16 @@ Handle(XCAFDoc_ClippingPlaneTool) XCAFDoc_DocumentTool::ClippingPlaneTool(const return XCAFDoc_ClippingPlaneTool::Set(ClippingPlanesLabel(acces)); } +//======================================================================= +//function : ClippingPlaneTool +//purpose : +//======================================================================= + +Handle(XCAFDoc_NotesTool) XCAFDoc_DocumentTool::NotesTool(const TDF_Label& acces) +{ + return XCAFDoc_NotesTool::Set(NotesLabel(acces)); +} + //======================================================================= //function : ID //purpose : diff --git a/src/XCAFDoc/XCAFDoc_DocumentTool.hxx b/src/XCAFDoc/XCAFDoc_DocumentTool.hxx index 5f467a4f4f..51a793fcca 100644 --- a/src/XCAFDoc/XCAFDoc_DocumentTool.hxx +++ b/src/XCAFDoc/XCAFDoc_DocumentTool.hxx @@ -30,6 +30,7 @@ class XCAFDoc_ClippingPlaneTool; class XCAFDoc_LayerTool; class XCAFDoc_DimTolTool; class XCAFDoc_MaterialTool; +class XCAFDoc_NotesTool; class XCAFDoc_ViewTool; class TDF_Attribute; class TDF_RelocationTable; @@ -84,7 +85,10 @@ public: //! Returns sub-label of DocLabel() with tag 8. Standard_EXPORT static TDF_Label ClippingPlanesLabel(const TDF_Label& acces); - + + //! Returns sub-label of DocLabel() with tag 9. + Standard_EXPORT static TDF_Label NotesLabel(const TDF_Label& acces); + //! Creates (if it does not exist) ShapeTool attribute on ShapesLabel(). Standard_EXPORT static Handle(XCAFDoc_ShapeTool) ShapeTool (const TDF_Label& acces); @@ -105,7 +109,10 @@ public: //! Creates (if it does not exist) ClippingPlaneTool attribute on ClippingPlanesLabel(). Standard_EXPORT static Handle(XCAFDoc_ClippingPlaneTool) ClippingPlaneTool(const TDF_Label& acces); - + + //! Creates (if it does not exist) NotesTool attribute on NotesLabel(). + Standard_EXPORT static Handle(XCAFDoc_NotesTool) NotesTool(const TDF_Label& acces); + Standard_EXPORT XCAFDoc_DocumentTool(); //! to be called when reading this attribute from file diff --git a/src/XCAFDoc/XCAFDoc_Note.cxx b/src/XCAFDoc/XCAFDoc_Note.cxx new file mode 100644 index 0000000000..f912eea9f9 --- /dev/null +++ b/src/XCAFDoc/XCAFDoc_Note.cxx @@ -0,0 +1,60 @@ +// Created on: 2017-02-10 +// Created by: Sergey NIKONOV +// Copyright (c) 2000-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 +#include +#include + +IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_Note, TDF_Attribute) + +const Standard_GUID& XCAFDoc_Note::GetID() +{ + static Standard_GUID s_ID("FDC0AF06-C4AC-468a-ACFB-4C9388C76D9E"); + return s_ID; +} + +Handle(XCAFDoc_Note) XCAFDoc_Note::Set(const TDF_Label& theLabel) +{ + Handle(XCAFDoc_Note) aTool; + if (!theLabel.FindAttribute(XCAFDoc_Note::GetID(), aTool)) + { + aTool = new XCAFDoc_Note(); + theLabel.AddAttribute(aTool); + } + return aTool; +} + +XCAFDoc_Note::XCAFDoc_Note() +{ +} + +const Standard_GUID& XCAFDoc_Note::ID() const +{ + return GetID(); +} + +Handle(TDF_Attribute) XCAFDoc_Note::NewEmpty() const +{ + return new XCAFDoc_Note(); +} + +void XCAFDoc_Note::Restore(const Handle(TDF_Attribute)& /*theAttr*/) +{ +} + +void XCAFDoc_Note::Paste(const Handle(TDF_Attribute)& /*theAttrInto*/, + const Handle(TDF_RelocationTable)& /*theRT*/) const +{ +} diff --git a/src/XCAFDoc/XCAFDoc_Note.hxx b/src/XCAFDoc/XCAFDoc_Note.hxx new file mode 100644 index 0000000000..c23e29ce60 --- /dev/null +++ b/src/XCAFDoc/XCAFDoc_Note.hxx @@ -0,0 +1,56 @@ +// Created on: 2017-02-10 +// Created by: Sergey NIKONOV +// Copyright (c) 2000-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 _XCAFDoc_Note_HeaderFile +#define _XCAFDoc_Note_HeaderFile + +#include +#include +#include + +class Standard_GUID; +class TDF_RelocationTable; + +class XCAFDoc_Note; +DEFINE_STANDARD_HANDLE(XCAFDoc_Note, TDF_Attribute) + +class XCAFDoc_Note : public TDF_Attribute +{ +public: + + DEFINE_STANDARD_RTTIEXT(XCAFDoc_Note, TDF_Attribute) + + Standard_EXPORT static const Standard_GUID& GetID(); + + //! Create (if not exist) NotesTool from XCAFDoc on . + Standard_EXPORT static Handle(XCAFDoc_Note) Set(const TDF_Label& theLabel); + + //! Creates an empty tool + Standard_EXPORT XCAFDoc_Note(); + +public: + + Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE; + + Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; + + Standard_EXPORT void Restore(const Handle(TDF_Attribute)& theAttrFrom) Standard_OVERRIDE; + + Standard_EXPORT void Paste(const Handle(TDF_Attribute)& theAttrInto, + const Handle(TDF_RelocationTable)& theRT) const Standard_OVERRIDE; + +}; + +#endif // _XCAFDoc_Note_HeaderFile diff --git a/src/XCAFDoc/XCAFDoc_NotesTool.cxx b/src/XCAFDoc/XCAFDoc_NotesTool.cxx new file mode 100644 index 0000000000..df087fc303 --- /dev/null +++ b/src/XCAFDoc/XCAFDoc_NotesTool.cxx @@ -0,0 +1,60 @@ +// Created on: 2017-02-10 +// Created by: Sergey NIKONOV +// Copyright (c) 2000-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 +#include +#include + +IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_NotesTool, TDF_Attribute) + +const Standard_GUID& XCAFDoc_NotesTool::GetID() +{ + static Standard_GUID s_ID("8F8174B1-6125-47a0-B357-61BD2D89380C"); + return s_ID; +} + +Handle(XCAFDoc_NotesTool) XCAFDoc_NotesTool::Set(const TDF_Label& theLabel) +{ + Handle(XCAFDoc_NotesTool) aTool; + if (!theLabel.FindAttribute(XCAFDoc_NotesTool::GetID(), aTool)) + { + aTool = new XCAFDoc_NotesTool(); + theLabel.AddAttribute(aTool); + } + return aTool; +} + +XCAFDoc_NotesTool::XCAFDoc_NotesTool() +{ +} + +const Standard_GUID& XCAFDoc_NotesTool::ID() const +{ + return GetID(); +} + +Handle(TDF_Attribute) XCAFDoc_NotesTool::NewEmpty() const +{ + return new XCAFDoc_NotesTool(); +} + +void XCAFDoc_NotesTool::Restore(const Handle(TDF_Attribute)& /*theAttr*/) +{ +} + +void XCAFDoc_NotesTool::Paste(const Handle(TDF_Attribute)& /*theAttrInto*/, + const Handle(TDF_RelocationTable)& /*theRT*/) const +{ +} diff --git a/src/XCAFDoc/XCAFDoc_NotesTool.hxx b/src/XCAFDoc/XCAFDoc_NotesTool.hxx new file mode 100644 index 0000000000..78521cb746 --- /dev/null +++ b/src/XCAFDoc/XCAFDoc_NotesTool.hxx @@ -0,0 +1,56 @@ +// Created on: 2017-02-10 +// Created by: Sergey NIKONOV +// Copyright (c) 2000-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 _XCAFDoc_NotesTool_HeaderFile +#define _XCAFDoc_NotesTool_HeaderFile + +#include +#include +#include + +class Standard_GUID; +class TDF_RelocationTable; + +class XCAFDoc_NotesTool; +DEFINE_STANDARD_HANDLE(XCAFDoc_NotesTool, TDF_Attribute) + +class XCAFDoc_NotesTool : public TDF_Attribute +{ +public: + + DEFINE_STANDARD_RTTIEXT(XCAFDoc_NotesTool, TDF_Attribute) + + Standard_EXPORT static const Standard_GUID& GetID(); + + //! Create (if not exist) NotesTool from XCAFDoc on . + Standard_EXPORT static Handle(XCAFDoc_NotesTool) Set(const TDF_Label& theLabel); + + //! Creates an empty tool + Standard_EXPORT XCAFDoc_NotesTool(); + +public: + + Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE; + + Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; + + Standard_EXPORT void Restore(const Handle(TDF_Attribute)& theAttrFrom) Standard_OVERRIDE; + + Standard_EXPORT void Paste(const Handle(TDF_Attribute)& theAttrInto, + const Handle(TDF_RelocationTable)& theRT) const Standard_OVERRIDE; + +}; + +#endif // _XCAFDoc_NotesTool_HeaderFile