0027961: Visualization - remove unused and no more working OpenGl_AVIWriter
[occt.git] / src / XmlDrivers / XmlDrivers.cxx
1 // Created on: 2001-07-09
2 // Created by: Julia DOROVSKIKH
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16
17 #include <CDM_MessageDriver.hxx>
18 #include <Plugin_Macro.hxx>
19 #include <Standard_GUID.hxx>
20 #include <TDocStd_Application.hxx>
21 #include <XmlDrivers.hxx>
22 #include <XmlDrivers_DocumentRetrievalDriver.hxx>
23 #include <XmlDrivers_DocumentStorageDriver.hxx>
24 #include <XmlMDataStd.hxx>
25 #include <XmlMDataXtd.hxx>
26 #include <XmlMDF.hxx>
27 #include <XmlMDF_ADriverTable.hxx>
28 #include <XmlMDocStd.hxx>
29 #include <XmlMFunction.hxx>
30 #include <XmlMNaming.hxx>
31
32 #include <locale.h>
33 #include <time.h>
34 static Standard_GUID XmlStorageDriver  ("03a56820-8269-11d5-aab2-0050044b1af1");
35 static Standard_GUID XmlRetrievalDriver("03a56822-8269-11d5-aab2-0050044b1af1");
36
37 //=======================================================================
38 //function : Factory
39 //purpose  : PLUGIN FACTORY
40 //=======================================================================
41 const Handle(Standard_Transient)& XmlDrivers::Factory(const Standard_GUID& theGUID)
42 {
43   if (theGUID == XmlStorageDriver)
44   {
45 #ifdef OCCT_DEBUG
46     cout << "XmlDrivers : Storage Plugin" << endl;
47 #endif
48     static Handle(Standard_Transient) model_sd =
49       new XmlDrivers_DocumentStorageDriver
50         ("Copyright: Open Cascade, 2001-2002"); // default copyright
51     return model_sd;
52   }
53
54   if (theGUID == XmlRetrievalDriver)
55   {
56 #ifdef OCCT_DEBUG
57     cout << "XmlDrivers : Retrieval Plugin" << endl;
58 #endif
59     static Handle (Standard_Transient) model_rd =
60       new XmlDrivers_DocumentRetrievalDriver ();
61     return model_rd;
62   }
63  
64   Standard_Failure::Raise ("XmlDrivers : unknown GUID");
65   static Handle(Standard_Transient) aNullHandle;
66   return aNullHandle;
67 }
68
69 //=======================================================================
70 //function : DefineFormat
71 //purpose  : 
72 //=======================================================================
73 void XmlDrivers::DefineFormat (const Handle(TDocStd_Application)& theApp)
74 {
75   theApp->DefineFormat ("XmlOcaf", "Xml OCAF Document", "xml",
76                         new XmlDrivers_DocumentRetrievalDriver, 
77                         new XmlDrivers_DocumentStorageDriver ("Copyright: Open Cascade, 2001-2002"));
78 }
79
80 //=======================================================================
81 //function : AttributeDrivers
82 //purpose  : 
83 //=======================================================================
84 Handle(XmlMDF_ADriverTable) XmlDrivers::AttributeDrivers
85                 (const Handle(CDM_MessageDriver)& theMessageDriver)
86 {
87   Handle(XmlMDF_ADriverTable) aTable = new XmlMDF_ADriverTable();
88   //
89   XmlMDF        ::AddDrivers (aTable, theMessageDriver);
90   XmlMDataStd   ::AddDrivers (aTable, theMessageDriver);
91   XmlMDataXtd   ::AddDrivers (aTable, theMessageDriver);  
92   XmlMNaming    ::AddDrivers (aTable, theMessageDriver);
93   XmlMFunction  ::AddDrivers (aTable, theMessageDriver); 
94   XmlMDocStd    ::AddDrivers (aTable, theMessageDriver); 
95   //
96   return aTable;
97 }
98
99 // Declare entry point PLUGINFACTORY
100 PLUGIN(XmlDrivers)