b311480e |
1 | // Created on: 2005-04-18 |
2 | // Created by: Eugeny NAPALKOV |
973c2be1 |
3 | // Copyright (c) 2005-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 | |
16 | #include <BinXCAFDrivers.ixx> |
17 | #include <BinXCAFDrivers_DocumentStorageDriver.hxx> |
18 | #include <BinXCAFDrivers_DocumentRetrievalDriver.hxx> |
19 | #include <BinMXCAFDoc.hxx> |
20 | |
21 | #include <Standard_Failure.hxx> |
22 | #include <BinDrivers.hxx> |
23 | #include <Plugin_Macro.hxx> |
24 | |
7fd59977 |
25 | static Standard_GUID BinXCAFStorageDriver ("a78ff496-a779-11d5-aab4-0050044b1af1"); |
26 | static Standard_GUID BinXCAFRetrievalDriver("a78ff497-a779-11d5-aab4-0050044b1af1"); |
27 | |
7fd59977 |
28 | //======================================================================= |
29 | //function : |
30 | //purpose : |
31 | //======================================================================= |
32 | Handle(Standard_Transient) BinXCAFDrivers::Factory(const Standard_GUID& theGUID) { |
33 | |
34 | if (theGUID == BinXCAFStorageDriver) |
35 | { |
63c629aa |
36 | #ifdef BINXCAFDRIVERS_DEB |
7fd59977 |
37 | cout << "BinXCAFDrivers : Storage Plugin" << endl; |
63c629aa |
38 | #endif |
7fd59977 |
39 | static Handle(BinXCAFDrivers_DocumentStorageDriver) model_sd = |
40 | new BinXCAFDrivers_DocumentStorageDriver; |
41 | return model_sd; |
42 | } |
43 | |
44 | if (theGUID == BinXCAFRetrievalDriver) |
45 | { |
63c629aa |
46 | #ifdef BINXCAFDRIVERS_DEB |
7fd59977 |
47 | cout << "BinXCAFDrivers : Retrieval Plugin" << endl; |
63c629aa |
48 | #endif |
7fd59977 |
49 | static Handle(BinXCAFDrivers_DocumentRetrievalDriver) model_rd = |
50 | new BinXCAFDrivers_DocumentRetrievalDriver; |
51 | return model_rd; |
52 | } |
53 | |
54 | |
55 | Standard_Failure::Raise ("XCAFBinDrivers : unknown GUID"); |
56 | return NULL; |
57 | } |
58 | |
59 | //======================================================================= |
60 | //function : |
61 | //purpose : |
62 | //======================================================================= |
63 | Handle(BinMDF_ADriverTable) BinXCAFDrivers::AttributeDrivers(const Handle(CDM_MessageDriver)& aMsgDrv) { |
64 | // Standard Drivers |
65 | Handle(BinMDF_ADriverTable) aTable = BinDrivers::AttributeDrivers(aMsgDrv); |
66 | |
67 | // XCAF Drivers |
68 | BinMXCAFDoc::AddDrivers(aTable, aMsgDrv); |
69 | |
70 | return aTable; |
71 | } |
72 | |
498ce76b |
73 | #ifdef _MSC_VER |
74 | #pragma warning(disable:4190) /* disable warning on C++ type returned by C function; should be OK for C++ usage */ |
75 | #endif |
7fd59977 |
76 | PLUGIN(BinXCAFDrivers) |