1 // Created on: 2000-05-24
2 // Created by: data exchange team
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
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>
22 //=======================================================================
23 //function : GetApplication
25 //=======================================================================
27 Handle(XCAFApp_Application) XCAFApp_Application::GetApplication()
29 static Handle(XCAFApp_Application) locApp;
30 if ( locApp.IsNull() ) locApp = new XCAFApp_Application;
34 //=======================================================================
35 //function : XCAFApp_Application
37 //=======================================================================
39 XCAFApp_Application::XCAFApp_Application()
41 // register driver for presentation
42 Handle(TPrsStd_DriverTable) table = TPrsStd_DriverTable::Get();
43 table->AddDriver (XCAFPrs_Driver::GetID(), new XCAFPrs_Driver);
46 //=======================================================================
49 //=======================================================================
51 void XCAFApp_Application::Formats(TColStd_SequenceOfExtendedString& Formats)
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"));
59 //=======================================================================
60 //function : ResourcesName
62 //=======================================================================
64 Standard_CString XCAFApp_Application::ResourcesName()
66 return Standard_CString("XCAF");
67 // return Standard_CString("Standard");
70 //=======================================================================
71 //function : InitDocument
73 //=======================================================================
75 void XCAFApp_Application::InitDocument(const Handle(TDocStd_Document)& aDoc) const
77 XCAFDoc_DocumentTool::Set(aDoc->Main());