b311480e |
1 | // Created on: 2004-11-24 |
2 | // Created by: Michael SAZONOV |
973c2be1 |
3 | // Copyright (c) 2004-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. |
b311480e |
15 | |
7fd59977 |
16 | // The original implementation Copyright: (C) RINA S.p.A |
17 | |
18 | #include <XmlLDrivers.hxx> |
19 | #include <XmlTObjDrivers.hxx> |
20 | #include <XmlMDF_ADriverTable.hxx> |
21 | #include <XmlTObjDrivers_DocumentStorageDriver.hxx> |
22 | #include <XmlTObjDrivers_DocumentRetrievalDriver.hxx> |
23 | #include <XmlTObjDrivers_ModelDriver.hxx> |
24 | #include <XmlTObjDrivers_ObjectDriver.hxx> |
25 | #include <XmlTObjDrivers_ReferenceDriver.hxx> |
26 | #include <XmlTObjDrivers_XYZDriver.hxx> |
27 | #include <XmlTObjDrivers_IntSparseArrayDriver.hxx> |
28 | |
29 | #include <Plugin_Macro.hxx> |
6fe96f84 |
30 | #include <TDocStd_Application.hxx> |
7fd59977 |
31 | |
7fd59977 |
32 | static Standard_GUID XmlStorageDriver ("f78ff4a0-a779-11d5-aab4-0050044b1af1"); |
33 | static Standard_GUID XmlRetrievalDriver("f78ff4a1-a779-11d5-aab4-0050044b1af1"); |
34 | |
ce8b059a |
35 | const Handle(Standard_Transient)& XmlTObjDrivers::Factory(const Standard_GUID& aGUID) |
7fd59977 |
36 | { |
37 | if(aGUID == XmlStorageDriver) |
38 | { |
0797d9d3 |
39 | #ifdef OCCT_DEBUG |
04232180 |
40 | std::cout << "XmlTObjDrivers : Storage Plugin" << std::endl; |
63c629aa |
41 | #endif |
4796758e |
42 | static Handle(Standard_Transient) model_sd |
7fd59977 |
43 | = new XmlTObjDrivers_DocumentStorageDriver |
44 | ("Copyright: Open CASCADE 2004"); // default copyright |
45 | return model_sd; |
46 | } |
47 | |
48 | if(aGUID == XmlRetrievalDriver) |
49 | { |
0797d9d3 |
50 | #ifdef OCCT_DEBUG |
04232180 |
51 | std::cout << "XmlTObjDrivers : Retrieval Plugin" << std::endl; |
63c629aa |
52 | #endif |
4796758e |
53 | static Handle (Standard_Transient) model_rd |
7fd59977 |
54 | = new XmlTObjDrivers_DocumentRetrievalDriver; |
55 | return model_rd; |
56 | } |
57 | |
58 | return XmlLDrivers::Factory (aGUID); |
59 | } |
60 | |
6fe96f84 |
61 | //======================================================================= |
62 | //function : DefineFormat |
63 | //purpose : |
64 | //======================================================================= |
65 | void XmlTObjDrivers::DefineFormat (const Handle(TDocStd_Application)& theApp) |
66 | { |
67 | theApp->DefineFormat ("TObjXml", "Xml TObj OCAF Document", "xml", |
68 | new XmlTObjDrivers_DocumentRetrievalDriver, |
69 | new XmlTObjDrivers_DocumentStorageDriver ("Copyright: Open Cascade, 2004")); |
70 | } |
71 | |
7fd59977 |
72 | //======================================================================= |
73 | //function : AddDrivers |
74 | //purpose : |
75 | //======================================================================= |
76 | void XmlTObjDrivers::AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable, |
83ae3591 |
77 | const Handle(Message_Messenger)& anMsgDrv) |
7fd59977 |
78 | { |
79 | aDriverTable -> AddDriver (new XmlTObjDrivers_ModelDriver (anMsgDrv)); |
80 | aDriverTable -> AddDriver (new XmlTObjDrivers_ObjectDriver (anMsgDrv)); |
81 | aDriverTable -> AddDriver (new XmlTObjDrivers_ReferenceDriver (anMsgDrv)); |
82 | aDriverTable -> AddDriver (new XmlTObjDrivers_XYZDriver (anMsgDrv)); |
83 | aDriverTable -> AddDriver (new XmlTObjDrivers_IntSparseArrayDriver(anMsgDrv)); |
84 | } |
85 | |
86 | PLUGIN(XmlTObjDrivers) |