Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:35

0001 // Created on: 2001-07-09
0002 // Created by: Julia DOROVSKIKH
0003 // Copyright (c) 2001-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _XmlMDF_HeaderFile
0017 #define _XmlMDF_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <XmlObjMgt_Element.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <XmlMDF_MapOfDriver.hxx>
0026 
0027 #include <Message_ProgressRange.hxx>
0028 
0029 class TDF_Data;
0030 class XmlMDF_ADriverTable;
0031 class TDF_Label;
0032 class Message_Messenger;
0033 
0034 
0035 //! This package provides classes and methods to
0036 //! translate a transient DF into a persistent one and
0037 //! vice versa.
0038 //!
0039 //! Driver
0040 //!
0041 //! A driver is a tool used to translate a transient
0042 //! attribute into a persistent one and vice versa.
0043 //!
0044 //! Driver Table
0045 //!
0046 //! A driver table is an object building links between
0047 //! object types and object drivers. In the
0048 //! translation process, a driver table is asked to
0049 //! give a translation driver for each current object
0050 //! to be translated.
0051 class XmlMDF 
0052 {
0053 public:
0054 
0055   DEFINE_STANDARD_ALLOC
0056 
0057   //! Translates a transient <aSource> into a persistent
0058   //! <aTarget>.
0059   Standard_EXPORT static void FromTo (const Handle(TDF_Data)& aSource,
0060                                       XmlObjMgt_Element& aTarget,
0061                                       XmlObjMgt_SRelocationTable& aReloc,
0062                                       const Handle(XmlMDF_ADriverTable)& aDrivers, 
0063                                       const Message_ProgressRange& theRange = Message_ProgressRange());
0064   
0065   //! Translates a persistent <aSource> into a transient
0066   //! <aTarget>.
0067   //! Returns True if completed successfully (False on error)
0068   Standard_EXPORT static Standard_Boolean FromTo
0069                                 (const XmlObjMgt_Element& aSource, 
0070                                  Handle(TDF_Data)& aTarget, XmlObjMgt_RRelocationTable& aReloc, 
0071                                  const Handle(XmlMDF_ADriverTable)& aDrivers, 
0072                                  const Message_ProgressRange& theRange = Message_ProgressRange());
0073   
0074   //! Adds the attribute storage drivers to <aDriverSeq>.
0075   Standard_EXPORT static void AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable, 
0076                                           const Handle(Message_Messenger)& theMessageDriver);
0077 
0078 private:
0079 
0080   Standard_EXPORT static Standard_Integer WriteSubTree
0081                                  (const TDF_Label& theLabel, 
0082                                   XmlObjMgt_Element& theElement, 
0083                                   XmlObjMgt_SRelocationTable& aReloc, 
0084                                   const Handle(XmlMDF_ADriverTable)& aDrivers, 
0085                                   const Message_ProgressRange& theRange = Message_ProgressRange());
0086   
0087   Standard_EXPORT static Standard_Integer ReadSubTree
0088                                  (const XmlObjMgt_Element& theElement, 
0089                                   const TDF_Label& theLabel, 
0090                                   XmlObjMgt_RRelocationTable& aReloc, 
0091                                   const XmlMDF_MapOfDriver& aDrivers, 
0092                                   const Message_ProgressRange& theRange = Message_ProgressRange());
0093   
0094   Standard_EXPORT static void CreateDrvMap (const Handle(XmlMDF_ADriverTable)& aDriverTable,
0095                                             XmlMDF_MapOfDriver& anAsciiDriverMap);
0096 
0097 friend class XmlMDF_ADriver;
0098 friend class XmlMDF_TagSourceDriver;
0099 friend class XmlMDF_ReferenceDriver;
0100 friend class XmlMDF_ADriverTable;
0101 
0102 };
0103 
0104 #endif // _XmlMDF_HeaderFile