b311480e |
1 | // Created on: 2002-10-29 |
2 | // Created by: Michael SAZONOV |
973c2be1 |
3 | // Copyright (c) 2002-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
7fd59977 |
15 | |
42cf5bc1 |
16 | |
17 | #include <BinDrivers.hxx> |
18 | #include <BinDrivers_DocumentRetrievalDriver.hxx> |
19 | #include <BinDrivers_DocumentStorageDriver.hxx> |
7fd59977 |
20 | #include <BinLDrivers.hxx> |
7fd59977 |
21 | #include <BinMDataStd.hxx> |
22 | #include <BinMDataXtd.hxx> |
42cf5bc1 |
23 | #include <BinMDF.hxx> |
24 | #include <BinMDF_ADriverTable.hxx> |
7fd59977 |
25 | #include <BinMDocStd.hxx> |
26 | #include <BinMFunction.hxx> |
42cf5bc1 |
27 | #include <BinMNaming.hxx> |
42cf5bc1 |
28 | #include <CDM_MessageDriver.hxx> |
7fd59977 |
29 | #include <Plugin_Macro.hxx> |
42cf5bc1 |
30 | #include <Standard_Failure.hxx> |
31 | #include <Standard_GUID.hxx> |
32 | #include <Standard_Transient.hxx> |
33 | #include <TCollection_AsciiString.hxx> |
6fe96f84 |
34 | #include <TDocStd_Application.hxx> |
7fd59977 |
35 | |
7fd59977 |
36 | static Standard_GUID BinStorageDriver ("03a56835-8269-11d5-aab2-0050044b1af1"); |
37 | static Standard_GUID BinRetrievalDriver("03a56836-8269-11d5-aab2-0050044b1af1"); |
38 | |
39 | //======================================================================= |
40 | //function : Factory |
41 | //purpose : PLUGIN FACTORY |
42 | //======================================================================= |
ce8b059a |
43 | const Handle(Standard_Transient)& BinDrivers::Factory(const Standard_GUID& theGUID) |
7fd59977 |
44 | { |
45 | if (theGUID == BinStorageDriver) |
46 | { |
0797d9d3 |
47 | #ifdef OCCT_DEBUG |
7fd59977 |
48 | cout << "BinDrivers : Storage Plugin" << endl; |
63c629aa |
49 | #endif |
4796758e |
50 | static Handle(Standard_Transient) model_sd = |
7fd59977 |
51 | new BinDrivers_DocumentStorageDriver; |
52 | return model_sd; |
53 | } |
54 | |
55 | if (theGUID == BinRetrievalDriver) |
56 | { |
0797d9d3 |
57 | #ifdef OCCT_DEBUG |
7fd59977 |
58 | cout << "BinDrivers : Retrieval Plugin" << endl; |
63c629aa |
59 | #endif |
4796758e |
60 | static Handle(Standard_Transient) model_rd = |
7fd59977 |
61 | new BinDrivers_DocumentRetrievalDriver; |
62 | return model_rd; |
63 | } |
64 | |
65 | Standard_Failure::Raise ("BinDrivers : unknown GUID"); |
ce8b059a |
66 | static Handle(Standard_Transient) aNullHandle; |
67 | return aNullHandle; |
7fd59977 |
68 | } |
69 | |
6fe96f84 |
70 | //======================================================================= |
71 | //function : DefineFormat |
72 | //purpose : |
73 | //======================================================================= |
74 | void BinDrivers::DefineFormat (const Handle(TDocStd_Application)& theApp) |
75 | { |
76 | theApp->DefineFormat ("BinOcaf", "Binary OCAF Document", "cbf", |
77 | new BinDrivers_DocumentRetrievalDriver, |
78 | new BinDrivers_DocumentStorageDriver); |
79 | } |
80 | |
7fd59977 |
81 | //======================================================================= |
82 | //function : AttributeDrivers |
83 | //purpose : |
84 | //======================================================================= |
85 | |
86 | Handle(BinMDF_ADriverTable) BinDrivers::AttributeDrivers |
87 | (const Handle(CDM_MessageDriver)& aMsgDrv) |
88 | { |
89 | Handle(BinMDF_ADriverTable) aTable = new BinMDF_ADriverTable; |
90 | |
91 | BinMDF ::AddDrivers (aTable, aMsgDrv); |
92 | BinMDataStd ::AddDrivers (aTable, aMsgDrv); |
93 | BinMDataXtd ::AddDrivers (aTable, aMsgDrv); |
94 | BinMNaming ::AddDrivers (aTable, aMsgDrv); |
95 | BinMDocStd ::AddDrivers (aTable, aMsgDrv); |
96 | BinMFunction ::AddDrivers (aTable, aMsgDrv); |
7fd59977 |
97 | return aTable; |
98 | } |
99 | |
100 | //======================================================================= |
101 | //function : StorageVersion |
102 | //purpose : |
103 | //======================================================================= |
104 | |
105 | TCollection_AsciiString BinDrivers::StorageVersion() |
106 | { |
107 | return BinLDrivers::StorageVersion(); |
108 | } |
498ce76b |
109 | |
7fd59977 |
110 | PLUGIN(BinDrivers) |