b311480e |
1 | // Created on: 2005-04-18 |
2 | // Created by: Eugeny NAPALKOV |
3 | // Copyright (c) 2005-2012 OPEN CASCADE SAS |
4 | // |
5 | // The content of this file is subject to the Open CASCADE Technology Public |
6 | // License Version 6.5 (the "License"). You may not use the content of this file |
7 | // except in compliance with the License. Please obtain a copy of the License |
8 | // at http://www.opencascade.org and read it completely before using this file. |
9 | // |
10 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | // |
13 | // The Original Code and all software distributed under the License is |
14 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | // Initial Developer hereby disclaims all such warranties, including without |
16 | // limitation, any warranties of merchantability, fitness for a particular |
17 | // purpose or non-infringement. Please see the License for the specific terms |
18 | // and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | |
21 | #include <BinXCAFDrivers.ixx> |
22 | #include <BinXCAFDrivers_DocumentStorageDriver.hxx> |
23 | #include <BinXCAFDrivers_DocumentRetrievalDriver.hxx> |
24 | #include <BinMXCAFDoc.hxx> |
25 | |
26 | #include <Standard_Failure.hxx> |
27 | #include <BinDrivers.hxx> |
28 | #include <Plugin_Macro.hxx> |
29 | |
7fd59977 |
30 | static Standard_GUID BinXCAFStorageDriver ("a78ff496-a779-11d5-aab4-0050044b1af1"); |
31 | static Standard_GUID BinXCAFRetrievalDriver("a78ff497-a779-11d5-aab4-0050044b1af1"); |
32 | |
7fd59977 |
33 | //======================================================================= |
34 | //function : |
35 | //purpose : |
36 | //======================================================================= |
37 | Handle(Standard_Transient) BinXCAFDrivers::Factory(const Standard_GUID& theGUID) { |
38 | |
39 | if (theGUID == BinXCAFStorageDriver) |
40 | { |
41 | cout << "BinXCAFDrivers : Storage Plugin" << endl; |
42 | static Handle(BinXCAFDrivers_DocumentStorageDriver) model_sd = |
43 | new BinXCAFDrivers_DocumentStorageDriver; |
44 | return model_sd; |
45 | } |
46 | |
47 | if (theGUID == BinXCAFRetrievalDriver) |
48 | { |
49 | cout << "BinXCAFDrivers : Retrieval Plugin" << endl; |
50 | static Handle(BinXCAFDrivers_DocumentRetrievalDriver) model_rd = |
51 | new BinXCAFDrivers_DocumentRetrievalDriver; |
52 | return model_rd; |
53 | } |
54 | |
55 | |
56 | Standard_Failure::Raise ("XCAFBinDrivers : unknown GUID"); |
57 | return NULL; |
58 | } |
59 | |
60 | //======================================================================= |
61 | //function : |
62 | //purpose : |
63 | //======================================================================= |
64 | Handle(BinMDF_ADriverTable) BinXCAFDrivers::AttributeDrivers(const Handle(CDM_MessageDriver)& aMsgDrv) { |
65 | // Standard Drivers |
66 | Handle(BinMDF_ADriverTable) aTable = BinDrivers::AttributeDrivers(aMsgDrv); |
67 | |
68 | // XCAF Drivers |
69 | BinMXCAFDoc::AddDrivers(aTable, aMsgDrv); |
70 | |
71 | return aTable; |
72 | } |
73 | |
498ce76b |
74 | #ifdef _MSC_VER |
75 | #pragma warning(disable:4190) /* disable warning on C++ type returned by C function; should be OK for C++ usage */ |
76 | #endif |
7fd59977 |
77 | PLUGIN(BinXCAFDrivers) |