0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / XCAFApp / XCAFApp_Application.cxx
CommitLineData
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
17#include <Standard_Type.hxx>
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
25//=======================================================================
26//function : GetApplication
27//purpose :
28//=======================================================================
7fd59977 29Handle(XCAFApp_Application) XCAFApp_Application::GetApplication()
30{
31 static Handle(XCAFApp_Application) locApp;
32 if ( locApp.IsNull() ) locApp = new XCAFApp_Application;
33 return locApp;
34}
35
36//=======================================================================
37//function : XCAFApp_Application
38//purpose :
39//=======================================================================
40
41XCAFApp_Application::XCAFApp_Application()
42{
43 // register driver for presentation
44 Handle(TPrsStd_DriverTable) table = TPrsStd_DriverTable::Get();
45 table->AddDriver (XCAFPrs_Driver::GetID(), new XCAFPrs_Driver);
46}
47
48//=======================================================================
49//function : Formats
50//purpose :
51//=======================================================================
52
53void XCAFApp_Application::Formats(TColStd_SequenceOfExtendedString& Formats)
54{
7fd59977 55 Formats.Append(TCollection_ExtendedString ("XmlXCAF"));
fff263bd 56 Formats.Append(TCollection_ExtendedString ("BinXCAF"));
7fd59977 57}
58
59//=======================================================================
60//function : ResourcesName
61//purpose :
62//=======================================================================
63
64Standard_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
75void XCAFApp_Application::InitDocument(const Handle(TDocStd_Document)& aDoc) const
76{
77 XCAFDoc_DocumentTool::Set(aDoc->Main());
78}