0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / BinMDF / BinMDF_ADriverTable.hxx
1 // Created on: 2002-10-29
2 // Created by: Michael SAZONOV
3 // Copyright (c) 2002-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 _BinMDF_ADriverTable_HeaderFile
17 #define _BinMDF_ADriverTable_HeaderFile
18
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
21
22 #include <BinMDF_TypeADriverMap.hxx>
23 #include <BinMDF_TypeIdMap.hxx>
24 #include <Standard_Transient.hxx>
25 #include <Standard_Type.hxx>
26 #include <Standard_Integer.hxx>
27 #include <TColStd_IndexedMapOfTransient.hxx>
28 #include <TColStd_SequenceOfAsciiString.hxx>
29 class BinMDF_ADriver;
30
31
32 class BinMDF_ADriverTable;
33 DEFINE_STANDARD_HANDLE(BinMDF_ADriverTable, Standard_Transient)
34
35 //! A driver table is an object building links between
36 //! object types and object drivers. In the
37 //! translation process, a driver table is asked to
38 //! give a translation driver for each current object
39 //! to be translated.
40 class BinMDF_ADriverTable : public Standard_Transient
41 {
42
43 public:
44
45   
46   //! Constructor
47   Standard_EXPORT BinMDF_ADriverTable();
48   
49   //! Adds a translation driver <theDriver>.
50   Standard_EXPORT void AddDriver (const Handle(BinMDF_ADriver)& theDriver);
51
52   //! Adds a translation driver for the derived attribute. The base driver must be already added.
53   //! @param theInstance is newly created attribute, detached from any label
54   Standard_EXPORT void AddDerivedDriver (const Handle(TDF_Attribute)& theInstance);
55
56   //! Adds a translation driver for the derived attribute. The base driver must be already added.
57   //! @param theDerivedType is registered attribute type using IMPLEMENT_DERIVED_ATTRIBUTE macro
58   Standard_EXPORT const Handle(Standard_Type)& AddDerivedDriver (Standard_CString theDerivedType);
59
60   //! Assigns the IDs to the drivers of the given Types.
61   //! It uses indices in the map as IDs.
62   //! Useful in storage procedure.
63   Standard_EXPORT void AssignIds (const TColStd_IndexedMapOfTransient& theTypes);
64   
65   //! Assigns the IDs to the drivers of the given Type Names;
66   //! It uses indices in the sequence as IDs.
67   //! Useful in retrieval procedure.
68   Standard_EXPORT void AssignIds (const TColStd_SequenceOfAsciiString& theTypeNames);
69   
70   //! Gets a driver <theDriver> according to <theType>.
71   //! Returns Type ID if the driver was assigned an ID; 0 otherwise.
72   Standard_Integer GetDriver (const Handle(Standard_Type)& theType, Handle(BinMDF_ADriver)& theDriver);
73   
74   //! Returns a driver according to <theTypeId>.
75   //! Returns null handle if a driver is not found
76   Handle(BinMDF_ADriver) GetDriver (const Standard_Integer theTypeId);
77
78
79
80
81   DEFINE_STANDARD_RTTIEXT(BinMDF_ADriverTable,Standard_Transient)
82
83 protected:
84
85
86
87
88 private:
89
90   
91   //! Assigns the ID to the driver of the Type
92     void AssignId (const Handle(Standard_Type)& theType, const Standard_Integer theId);
93
94   BinMDF_TypeADriverMap myMap;
95   BinMDF_TypeIdMap myMapId;
96
97
98 };
99
100
101 #include <BinMDF_ADriverTable.lxx>
102
103
104
105
106
107 #endif // _BinMDF_ADriverTable_HeaderFile