0027104: DownCast() cannot return null for mismatched handle
[occt.git] / src / IGESAppli / IGESAppli.cxx
CommitLineData
973c2be1 1// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
b311480e 4//
d5f74e42 5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
b311480e 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
b311480e 13
42cf5bc1 14
15#include <IGESAppli.hxx>
7fd59977 16#include <IGESAppli_GeneralModule.hxx>
42cf5bc1 17#include <IGESAppli_Protocol.hxx>
7fd59977 18#include <IGESAppli_ReadWriteModule.hxx>
19#include <IGESAppli_SpecificModule.hxx>
7fd59977 20#include <IGESData_SpecificLib.hxx>
42cf5bc1 21#include <IGESData_WriterLib.hxx>
7fd59977 22#include <IGESDefs.hxx>
23#include <IGESDraw.hxx>
42cf5bc1 24#include <Interface_GeneralLib.hxx>
25#include <Interface_ReaderLib.hxx>
7fd59977 26
27// Ancillary data to work on a Package of IGES Entities with a Protocol
28// (Modules are created and loaded in appropriate libraries, once by Init)
7fd59977 29static Handle(IGESAppli_Protocol) protocol;
30
31
32
33 void IGESAppli::Init ()
34{
35 IGESDefs::Init();
36 IGESDraw::Init();
37 if (protocol.IsNull()) {
38 protocol = new IGESAppli_Protocol;
39 Interface_GeneralLib::SetGlobal (new IGESAppli_GeneralModule, protocol);
40 Interface_ReaderLib::SetGlobal (new IGESAppli_ReadWriteModule,protocol);
41 IGESData_WriterLib::SetGlobal (new IGESAppli_ReadWriteModule,protocol);
42 IGESData_SpecificLib::SetGlobal (new IGESAppli_SpecificModule, protocol);
43 }
44}
45
46 Handle(IGESAppli_Protocol) IGESAppli::Protocol ()
47{
48 return protocol;
49}