0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / XmlMDF / XmlMDF.hxx
CommitLineData
42cf5bc1 1// Created on: 2001-07-09
2// Created by: Julia DOROVSKIKH
3// Copyright (c) 2001-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _XmlMDF_HeaderFile
17#define _XmlMDF_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_DefineAlloc.hxx>
21#include <Standard_Handle.hxx>
22
23#include <XmlObjMgt_Element.hxx>
42cf5bc1 24#include <Standard_Integer.hxx>
42cf5bc1 25#include <XmlMDF_MapOfDriver.hxx>
6d8f9f4a 26
7e785937 27#include <Message_ProgressRange.hxx>
6d8f9f4a 28
42cf5bc1 29class TDF_Data;
30class XmlMDF_ADriverTable;
31class TDF_Label;
83ae3591 32class Message_Messenger;
42cf5bc1 33
34
35//! This package provides classes and methods to
36//! translate a transient DF into a persistent one and
37//! vice versa.
38//!
39//! Driver
40//!
41//! A driver is a tool used to translate a transient
42//! attribute into a persistent one and vice versa.
43//!
44//! Driver Table
45//!
46//! A driver table is an object building links between
47//! object types and object drivers. In the
48//! translation process, a driver table is asked to
49//! give a translation driver for each current object
50//! to be translated.
51class XmlMDF
52{
53public:
54
55 DEFINE_STANDARD_ALLOC
56
42cf5bc1 57 //! Translates a transient <aSource> into a persistent
58 //! <aTarget>.
6d8f9f4a 59 Standard_EXPORT static void FromTo (const Handle(TDF_Data)& aSource,
60 XmlObjMgt_Element& aTarget,
61 XmlObjMgt_SRelocationTable& aReloc,
62 const Handle(XmlMDF_ADriverTable)& aDrivers,
7e785937 63 const Message_ProgressRange& theRange = Message_ProgressRange());
42cf5bc1 64
65 //! Translates a persistent <aSource> into a transient
66 //! <aTarget>.
67 //! Returns True if completed successfully (False on error)
6d8f9f4a 68 Standard_EXPORT static Standard_Boolean FromTo
69 (const XmlObjMgt_Element& aSource,
70 Handle(TDF_Data)& aTarget, XmlObjMgt_RRelocationTable& aReloc,
71 const Handle(XmlMDF_ADriverTable)& aDrivers,
7e785937 72 const Message_ProgressRange& theRange = Message_ProgressRange());
42cf5bc1 73
74 //! Adds the attribute storage drivers to <aDriverSeq>.
6d8f9f4a 75 Standard_EXPORT static void AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable,
76 const Handle(Message_Messenger)& theMessageDriver);
42cf5bc1 77
78private:
79
6d8f9f4a 80 Standard_EXPORT static Standard_Integer WriteSubTree
81 (const TDF_Label& theLabel,
82 XmlObjMgt_Element& theElement,
83 XmlObjMgt_SRelocationTable& aReloc,
84 const Handle(XmlMDF_ADriverTable)& aDrivers,
7e785937 85 const Message_ProgressRange& theRange = Message_ProgressRange());
42cf5bc1 86
6d8f9f4a 87 Standard_EXPORT static Standard_Integer ReadSubTree
88 (const XmlObjMgt_Element& theElement,
89 const TDF_Label& theLabel,
90 XmlObjMgt_RRelocationTable& aReloc,
91 const XmlMDF_MapOfDriver& aDrivers,
7e785937 92 const Message_ProgressRange& theRange = Message_ProgressRange());
42cf5bc1 93
6d8f9f4a 94 Standard_EXPORT static void CreateDrvMap (const Handle(XmlMDF_ADriverTable)& aDriverTable,
95 XmlMDF_MapOfDriver& anAsciiDriverMap);
42cf5bc1 96
97friend class XmlMDF_ADriver;
98friend class XmlMDF_TagSourceDriver;
99friend class XmlMDF_ReferenceDriver;
100friend class XmlMDF_ADriverTable;
101
102};
103
42cf5bc1 104#endif // _XmlMDF_HeaderFile