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 | // |
973c2be1 |
7 | // This library is free software; you can redistribute it and / or modify it |
8 | // under the terms of the GNU Lesser General Public 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. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | #include <XCAFApp_Application.ixx> |
17 | #include <TPrsStd_DriverTable.hxx> |
18 | #include <XCAFPrs_Driver.hxx> |
19 | #include <XCAFDoc_DocumentTool.hxx> |
20 | #include <TDF_Label.hxx> |
21 | |
22 | //======================================================================= |
23 | //function : GetApplication |
24 | //purpose : |
25 | //======================================================================= |
26 | |
27 | Handle(XCAFApp_Application) XCAFApp_Application::GetApplication() |
28 | { |
29 | static Handle(XCAFApp_Application) locApp; |
30 | if ( locApp.IsNull() ) locApp = new XCAFApp_Application; |
31 | return locApp; |
32 | } |
33 | |
34 | //======================================================================= |
35 | //function : XCAFApp_Application |
36 | //purpose : |
37 | //======================================================================= |
38 | |
39 | XCAFApp_Application::XCAFApp_Application() |
40 | { |
41 | // register driver for presentation |
42 | Handle(TPrsStd_DriverTable) table = TPrsStd_DriverTable::Get(); |
43 | table->AddDriver (XCAFPrs_Driver::GetID(), new XCAFPrs_Driver); |
44 | } |
45 | |
46 | //======================================================================= |
47 | //function : Formats |
48 | //purpose : |
49 | //======================================================================= |
50 | |
51 | void XCAFApp_Application::Formats(TColStd_SequenceOfExtendedString& Formats) |
52 | { |
53 | Formats.Append(TCollection_ExtendedString ("MDTV-XCAF")); |
54 | Formats.Append(TCollection_ExtendedString ("XmlXCAF")); |
55 | Formats.Append(TCollection_ExtendedString ("XmlOcaf")); |
56 | Formats.Append(TCollection_ExtendedString ("MDTV-Standard")); |
57 | } |
58 | |
59 | //======================================================================= |
60 | //function : ResourcesName |
61 | //purpose : |
62 | //======================================================================= |
63 | |
64 | Standard_CString XCAFApp_Application::ResourcesName() |
65 | { |
66 | return Standard_CString("XCAF"); |
67 | // return Standard_CString("Standard"); |
68 | } |
69 | |
70 | //======================================================================= |
71 | //function : InitDocument |
72 | //purpose : |
73 | //======================================================================= |
74 | |
75 | void XCAFApp_Application::InitDocument(const Handle(TDocStd_Document)& aDoc) const |
76 | { |
77 | XCAFDoc_DocumentTool::Set(aDoc->Main()); |
78 | } |