0028599: Replacement of old Boolean operations with new ones in BRepProj_Projection...
[occt.git] / src / BinXCAFDrivers / BinXCAFDrivers.cxx
CommitLineData
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
7fd59977 16
7fd59977 17#include <BinDrivers.hxx>
42cf5bc1 18#include <BinMDF_ADriverTable.hxx>
19#include <BinMXCAFDoc.hxx>
20#include <BinXCAFDrivers.hxx>
21#include <BinXCAFDrivers_DocumentRetrievalDriver.hxx>
22#include <BinXCAFDrivers_DocumentStorageDriver.hxx>
83ae3591 23#include <Message_Messenger.hxx>
7fd59977 24#include <Plugin_Macro.hxx>
42cf5bc1 25#include <Standard_Failure.hxx>
26#include <Standard_GUID.hxx>
6fe96f84 27#include <TDocStd_Application.hxx>
7fd59977 28
7fd59977 29static Standard_GUID BinXCAFStorageDriver ("a78ff496-a779-11d5-aab4-0050044b1af1");
30static Standard_GUID BinXCAFRetrievalDriver("a78ff497-a779-11d5-aab4-0050044b1af1");
31
7fd59977 32//=======================================================================
33//function :
34//purpose :
35//=======================================================================
ce8b059a 36const Handle(Standard_Transient)& BinXCAFDrivers::Factory(const Standard_GUID& theGUID) {
7fd59977 37
38 if (theGUID == BinXCAFStorageDriver)
39 {
0797d9d3 40#ifdef OCCT_DEBUG
7fd59977 41 cout << "BinXCAFDrivers : Storage Plugin" << endl;
63c629aa 42#endif
4796758e 43 static Handle(Standard_Transient) model_sd =
7fd59977 44 new BinXCAFDrivers_DocumentStorageDriver;
45 return model_sd;
46 }
47
48 if (theGUID == BinXCAFRetrievalDriver)
49 {
0797d9d3 50#ifdef OCCT_DEBUG
7fd59977 51 cout << "BinXCAFDrivers : Retrieval Plugin" << endl;
63c629aa 52#endif
4796758e 53 static Handle(Standard_Transient) model_rd =
7fd59977 54 new BinXCAFDrivers_DocumentRetrievalDriver;
55 return model_rd;
56 }
57
58
9775fa61 59 throw Standard_Failure("XCAFBinDrivers : unknown GUID");
7fd59977 60}
61
62//=======================================================================
6fe96f84 63//function : DefineFormat
64//purpose :
65//=======================================================================
66void BinXCAFDrivers::DefineFormat (const Handle(TDocStd_Application)& theApp)
67{
68 theApp->DefineFormat ("BinXCAF", "Binary XCAF Document", "xbf",
69 new BinXCAFDrivers_DocumentRetrievalDriver,
70 new BinXCAFDrivers_DocumentStorageDriver);
71}
72
73//=======================================================================
7fd59977 74//function :
75//purpose :
76//=======================================================================
83ae3591 77Handle(BinMDF_ADriverTable) BinXCAFDrivers::AttributeDrivers(const Handle(Message_Messenger)& aMsgDrv) {
7fd59977 78 // Standard Drivers
79 Handle(BinMDF_ADriverTable) aTable = BinDrivers::AttributeDrivers(aMsgDrv);
80
81 // XCAF Drivers
82 BinMXCAFDoc::AddDrivers(aTable, aMsgDrv);
83
84 return aTable;
85}
86
87PLUGIN(BinXCAFDrivers)