b311480e |
1 | // Created on: 2000-05-24 |
2 | // Created by: data exchange team |
973c2be1 |
3 | // Copyright (c) 2000-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 | |
42cf5bc1 |
16 | |
6fe96f84 |
17 | #include <Resource_Manager.hxx> |
42cf5bc1 |
18 | #include <TDF_Label.hxx> |
19 | #include <TDocStd_Document.hxx> |
7fd59977 |
20 | #include <TPrsStd_DriverTable.hxx> |
42cf5bc1 |
21 | #include <XCAFApp_Application.hxx> |
7fd59977 |
22 | #include <XCAFDoc_DocumentTool.hxx> |
42cf5bc1 |
23 | #include <XCAFPrs_Driver.hxx> |
7fd59977 |
24 | |
92efcf78 |
25 | IMPLEMENT_STANDARD_RTTIEXT(XCAFApp_Application,TDocStd_Application) |
26 | |
7fd59977 |
27 | //======================================================================= |
28 | //function : GetApplication |
29 | //purpose : |
30 | //======================================================================= |
7fd59977 |
31 | Handle(XCAFApp_Application) XCAFApp_Application::GetApplication() |
32 | { |
33 | static Handle(XCAFApp_Application) locApp; |
34 | if ( locApp.IsNull() ) locApp = new XCAFApp_Application; |
35 | return locApp; |
36 | } |
37 | |
38 | //======================================================================= |
39 | //function : XCAFApp_Application |
40 | //purpose : |
41 | //======================================================================= |
42 | |
43 | XCAFApp_Application::XCAFApp_Application() |
44 | { |
45 | // register driver for presentation |
46 | Handle(TPrsStd_DriverTable) table = TPrsStd_DriverTable::Get(); |
47 | table->AddDriver (XCAFPrs_Driver::GetID(), new XCAFPrs_Driver); |
48 | } |
49 | |
7fd59977 |
50 | //======================================================================= |
51 | //function : ResourcesName |
52 | //purpose : |
53 | //======================================================================= |
54 | |
55 | Standard_CString XCAFApp_Application::ResourcesName() |
56 | { |
57 | return Standard_CString("XCAF"); |
58 | // return Standard_CString("Standard"); |
59 | } |
60 | |
61 | //======================================================================= |
62 | //function : InitDocument |
63 | //purpose : |
64 | //======================================================================= |
65 | |
66 | void XCAFApp_Application::InitDocument(const Handle(TDocStd_Document)& aDoc) const |
67 | { |
68 | XCAFDoc_DocumentTool::Set(aDoc->Main()); |
69 | } |