0025923: Remove small wires on face read from STEP
[occt.git] / src / StdLDrivers / StdLDrivers.cxx
1 // Created on: 2000-09-07
2 // Created by: TURIN Anatoliy
3 // Copyright (c) 2000-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 #include <StdLDrivers.ixx>
17 #include <StdLDrivers_DocumentStorageDriver.hxx>
18 #include <StdLDrivers_DocumentRetrievalDriver.hxx>
19 #include <ShapeSchema.hxx>
20 #include <Storage_HArrayOfSchema.hxx>
21 #include <StdLSchema.hxx>
22
23 #include <Standard_Failure.hxx>
24 #include <Standard_GUID.hxx>
25 #include <Plugin_Macro.hxx>
26
27 static Standard_GUID StdLStorageDriver     ("bd696000-5b34-11d1-b5ba-00a0c9064368");
28 static Standard_GUID StdLRetrievalDriver   ("bd696001-5b34-11d1-b5ba-00a0c9064368");
29 static Standard_GUID StdLSchemaID          ("bd696002-5b34-11d1-b5ba-00a0c9064368");
30
31 Handle(Standard_Transient) StdLDrivers::Factory(const Standard_GUID& aGUID) {
32
33   if(aGUID == StdLSchemaID) {    
34 #ifdef OCCT_DEBUG
35     cout << "StdLSchema : Plugin" << endl;
36 #endif
37     static Handle(StdLSchema) model_ss = new StdLSchema;
38     Handle(ShapeSchema) aSSchema = new ShapeSchema;
39     Handle(Storage_HArrayOfSchema) aSchemas = new Storage_HArrayOfSchema(0,0);
40     aSchemas->SetValue(0, aSSchema);
41     model_ss->SetNestedSchemas(aSchemas);
42
43     return model_ss;
44   }
45
46   if(aGUID == StdLStorageDriver)  {
47 #ifdef OCCT_DEBUG
48     cout << "StdLDrivers : Storage Plugin" << endl;
49 #endif
50     static Handle(StdLDrivers_DocumentStorageDriver) model_sd = new StdLDrivers_DocumentStorageDriver;
51     return model_sd;
52   }
53   if(aGUID == StdLRetrievalDriver) {  
54 #ifdef OCCT_DEBUG
55     cout << "StdLDrivers : Retrieval Plugin" << endl;
56 #endif
57     static Handle(StdLDrivers_DocumentRetrievalDriver) model_rd = new StdLDrivers_DocumentRetrievalDriver;
58     return model_rd;
59   }
60  
61   Standard_Failure::Raise ("StdLDrivers : unknown GUID");
62   Handle(Standard_Transient) t;
63   return t;
64 }
65
66 #ifdef _MSC_VER
67 #pragma warning(disable:4190) /* disable warning on C++ type returned by C function; should be OK for C++ usage */
68 #endif
69
70 // Declare entry point PLUGINFACTORY
71 PLUGIN(StdLDrivers)