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.
17 #include <BinDrivers.hxx>
18 #include <BinMDF_ADriverTable.hxx>
19 #include <BinMXCAFDoc.hxx>
20 #include <BinXCAFDrivers.hxx>
21 #include <BinXCAFDrivers_DocumentRetrievalDriver.hxx>
22 #include <BinXCAFDrivers_DocumentStorageDriver.hxx>
23 #include <Plugin_Macro.hxx>
24 #include <Standard_Failure.hxx>
25 #include <Standard_GUID.hxx>
26 #include <TDocStd_Application.hxx>
28 static Standard_GUID BinXCAFStorageDriver ("a78ff496-a779-11d5-aab4-0050044b1af1");
29 static Standard_GUID BinXCAFRetrievalDriver("a78ff497-a779-11d5-aab4-0050044b1af1");
31 //=======================================================================
34 //=======================================================================
35 const Handle(Standard_Transient)& BinXCAFDrivers::Factory(const Standard_GUID& theGUID) {
37 if (theGUID == BinXCAFStorageDriver)
40 std::cout << "BinXCAFDrivers : Storage Plugin" << std::endl;
42 static Handle(Standard_Transient) model_sd =
43 new BinXCAFDrivers_DocumentStorageDriver;
47 if (theGUID == BinXCAFRetrievalDriver)
50 std::cout << "BinXCAFDrivers : Retrieval Plugin" << std::endl;
52 static Handle(Standard_Transient) model_rd =
53 new BinXCAFDrivers_DocumentRetrievalDriver;
58 throw Standard_Failure("XCAFBinDrivers : unknown GUID");
61 //=======================================================================
62 //function : DefineFormat
64 //=======================================================================
65 void BinXCAFDrivers::DefineFormat (const Handle(TDocStd_Application)& theApp)
67 theApp->DefineFormat ("BinXCAF", "Binary XCAF Document", "xbf",
68 new BinXCAFDrivers_DocumentRetrievalDriver,
69 new BinXCAFDrivers_DocumentStorageDriver);
72 //=======================================================================
75 //=======================================================================
76 Handle(BinMDF_ADriverTable) BinXCAFDrivers::AttributeDrivers(const Handle(Message_Messenger)& aMsgDrv) {
78 Handle(BinMDF_ADriverTable) aTable = BinDrivers::AttributeDrivers(aMsgDrv);
81 BinMXCAFDoc::AddDrivers(aTable, aMsgDrv);
86 PLUGIN(BinXCAFDrivers)