7ed7467d |
1 | // Created on: 2000-09-07 |
2 | // Created by: TURIN Anatoliy |
3 | // Copyright (c) 2000-2015 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.hxx> |
17 | #include <StdLDrivers_DocumentRetrievalDriver.hxx> |
18 | #include <StdLPersistent.hxx> |
19 | |
20 | #include <Standard_Failure.hxx> |
21 | #include <Standard_GUID.hxx> |
22 | #include <Plugin_Macro.hxx> |
23 | |
6fe96f84 |
24 | #include <PCDM_StorageDriver.hxx> |
25 | #include <TDocStd_Application.hxx> |
26 | |
7ed7467d |
27 | static Standard_GUID StdLRetrievalDriver ("bd696001-5b34-11d1-b5ba-00a0c9064368"); |
28 | |
29 | //======================================================================= |
30 | //function : Factory |
31 | //purpose : Depending from the ID, returns a list of storage |
32 | // or retrieval attribute drivers. Used for plugin |
33 | //======================================================================= |
34 | Handle(Standard_Transient) StdLDrivers::Factory (const Standard_GUID& aGUID) |
35 | { |
36 | if (aGUID == StdLRetrievalDriver) |
37 | { |
38 | #ifdef OCCT_DEBUG |
04232180 |
39 | std::cout << "StdLDrivers : Retrieval Plugin" << std::endl; |
7ed7467d |
40 | #endif |
41 | |
42 | static Handle(StdLDrivers_DocumentRetrievalDriver) model_rd = new StdLDrivers_DocumentRetrievalDriver; |
43 | return model_rd; |
44 | } |
45 | |
9775fa61 |
46 | throw Standard_Failure("StdLDrivers : unknown GUID"); |
7ed7467d |
47 | } |
48 | |
6fe96f84 |
49 | //======================================================================= |
50 | //function : DefineFormat |
51 | //purpose : |
52 | //======================================================================= |
53 | void StdLDrivers::DefineFormat (const Handle(TDocStd_Application)& theApp) |
54 | { |
55 | theApp->DefineFormat ("OCC-StdLite", "Lite OCAF Document", "stdl", |
56 | new StdLDrivers_DocumentRetrievalDriver, 0); |
57 | } |
58 | |
7ed7467d |
59 | //======================================================================= |
60 | //function : BindTypes |
61 | //purpose : Register types |
62 | //======================================================================= |
63 | void StdLDrivers::BindTypes (StdObjMgt_MapOfInstantiators& theMap) |
64 | { |
65 | StdLPersistent::BindTypes (theMap); |
66 | } |
67 | |
7ed7467d |
68 | // Declare entry point PLUGINFACTORY |
69 | PLUGIN (StdLDrivers) |