0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / XCAFApp / XCAFApp_Application.cxx
1 // Created on: 2000-05-24
2 // Created by: data exchange team
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
17 #include <Resource_Manager.hxx>
18 #include <Standard_Dump.hxx>
19 #include <TDF_Label.hxx>
20 #include <TPrsStd_DriverTable.hxx>
21 #include <XCAFApp_Application.hxx>
22 #include <XCAFDoc_DocumentTool.hxx>
23 #include <XCAFPrs_Driver.hxx>
24
25 IMPLEMENT_STANDARD_RTTIEXT(XCAFApp_Application,TDocStd_Application)
26
27 //=======================================================================
28 //function : GetApplication
29 //purpose  : 
30 //=======================================================================
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
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(CDM_Document)& aDoc) const
67 {
68   XCAFDoc_DocumentTool::Set(Handle(TDocStd_Document)::DownCast(aDoc)->Main());
69 }
70
71 //=======================================================================
72 //function : DumpJson
73 //purpose  : 
74 //=======================================================================
75 void XCAFApp_Application::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
76 {
77   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
78
79   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDocStd_Application)
80 }