1 // Created on: 2005-04-18
2 // Created by: Eugeny NAPALKOV
3 // Copyright (c) 2005-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <BinXCAFDrivers.ixx>
17 #include <BinXCAFDrivers_DocumentStorageDriver.hxx>
18 #include <BinXCAFDrivers_DocumentRetrievalDriver.hxx>
19 #include <BinMXCAFDoc.hxx>
21 #include <Standard_Failure.hxx>
22 #include <BinDrivers.hxx>
23 #include <Plugin_Macro.hxx>
25 static Standard_GUID BinXCAFStorageDriver ("a78ff496-a779-11d5-aab4-0050044b1af1");
26 static Standard_GUID BinXCAFRetrievalDriver("a78ff497-a779-11d5-aab4-0050044b1af1");
28 //=======================================================================
31 //=======================================================================
32 Handle(Standard_Transient) BinXCAFDrivers::Factory(const Standard_GUID& theGUID) {
34 if (theGUID == BinXCAFStorageDriver)
37 cout << "BinXCAFDrivers : Storage Plugin" << endl;
39 static Handle(BinXCAFDrivers_DocumentStorageDriver) model_sd =
40 new BinXCAFDrivers_DocumentStorageDriver;
44 if (theGUID == BinXCAFRetrievalDriver)
47 cout << "BinXCAFDrivers : Retrieval Plugin" << endl;
49 static Handle(BinXCAFDrivers_DocumentRetrievalDriver) model_rd =
50 new BinXCAFDrivers_DocumentRetrievalDriver;
55 Standard_Failure::Raise ("XCAFBinDrivers : unknown GUID");
59 //=======================================================================
62 //=======================================================================
63 Handle(BinMDF_ADriverTable) BinXCAFDrivers::AttributeDrivers(const Handle(CDM_MessageDriver)& aMsgDrv) {
65 Handle(BinMDF_ADriverTable) aTable = BinDrivers::AttributeDrivers(aMsgDrv);
68 BinMXCAFDoc::AddDrivers(aTable, aMsgDrv);
74 #pragma warning(disable:4190) /* disable warning on C++ type returned by C function; should be OK for C++ usage */
76 PLUGIN(BinXCAFDrivers)