1 // Created on: 2001-07-09
2 // Created by: Julia DOROVSKIKH
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _XmlMDF_HeaderFile
17 #define _XmlMDF_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <XmlObjMgt_Element.hxx>
24 #include <XmlObjMgt_SRelocationTable.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <XmlObjMgt_RRelocationTable.hxx>
28 #include <XmlMDF_MapOfDriver.hxx>
30 class XmlMDF_ADriverTable;
32 class Message_Messenger;
34 class XmlMDF_TagSourceDriver;
35 class XmlMDF_ReferenceDriver;
36 class XmlMDF_ADriverTable;
39 //! This package provides classes and methods to
40 //! translate a transient DF into a persistent one and
45 //! A driver is a tool used to translate a transient
46 //! attribute into a persistent one and vice versa.
50 //! A driver table is an object building links between
51 //! object types and object drivers. In the
52 //! translation process, a driver table is asked to
53 //! give a translation driver for each current object
62 //! Translates a transient <aSource> into a persistent
64 Standard_EXPORT static void FromTo (const Handle(TDF_Data)& aSource, XmlObjMgt_Element& aTarget, XmlObjMgt_SRelocationTable& aReloc, const Handle(XmlMDF_ADriverTable)& aDrivers);
66 //! Translates a persistent <aSource> into a transient
68 //! Returns True if completed successfully (False on error)
69 Standard_EXPORT static Standard_Boolean FromTo (const XmlObjMgt_Element& aSource, Handle(TDF_Data)& aTarget, XmlObjMgt_RRelocationTable& aReloc, const Handle(XmlMDF_ADriverTable)& aDrivers);
71 //! Adds the attribute storage drivers to <aDriverSeq>.
72 Standard_EXPORT static void AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable, const Handle(Message_Messenger)& theMessageDriver);
86 Standard_EXPORT static Standard_Integer WriteSubTree (const TDF_Label& theLabel, XmlObjMgt_Element& theElement, XmlObjMgt_SRelocationTable& aReloc, const Handle(XmlMDF_ADriverTable)& aDrivers);
88 Standard_EXPORT static Standard_Integer ReadSubTree (const XmlObjMgt_Element& theElement, const TDF_Label& theLabel, XmlObjMgt_RRelocationTable& aReloc, const XmlMDF_MapOfDriver& aDrivers);
90 Standard_EXPORT static void CreateDrvMap (const Handle(XmlMDF_ADriverTable)& aDriverTable, XmlMDF_MapOfDriver& anAsciiDriverMap);
94 friend class XmlMDF_ADriver;
95 friend class XmlMDF_TagSourceDriver;
96 friend class XmlMDF_ReferenceDriver;
97 friend class XmlMDF_ADriverTable;
107 #endif // _XmlMDF_HeaderFile