0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / BinTObjDrivers / BinTObjDrivers.cxx
CommitLineData
b311480e 1// Created on: 2004-11-24
2// Created by: Michael SAZONOV
973c2be1 3// Copyright (c) 2004-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.
b311480e 15
7fd59977 16// The original implementation Copyright: (C) RINA S.p.A
17
18#include <BinLDrivers.hxx>
19#include <BinMDF_ADriverTable.hxx>
20#include <BinTObjDrivers.hxx>
21#include <BinTObjDrivers_DocumentStorageDriver.hxx>
22#include <BinTObjDrivers_DocumentRetrievalDriver.hxx>
23#include <BinTObjDrivers_IntSparseArrayDriver.hxx>
24#include <BinTObjDrivers_ModelDriver.hxx>
25#include <BinTObjDrivers_ObjectDriver.hxx>
26#include <BinTObjDrivers_ReferenceDriver.hxx>
27#include <BinTObjDrivers_XYZDriver.hxx>
28#include <Plugin_Macro.hxx>
6fe96f84 29#include <TDocStd_Application.hxx>
7fd59977 30
7fd59977 31static Standard_GUID BinStorageDriver ("f78ff4a2-a779-11d5-aab4-0050044b1af1");
32static Standard_GUID BinRetrievalDriver("f78ff4a3-a779-11d5-aab4-0050044b1af1");
33
ce8b059a 34const Handle(Standard_Transient)& BinTObjDrivers::Factory(const Standard_GUID& aGUID)
7fd59977 35{
36 if(aGUID == BinStorageDriver)
37 {
0797d9d3 38#ifdef OCCT_DEBUG
04232180 39 std::cout << "BinTObjDrivers : Storage Plugin" << std::endl;
63c629aa 40#endif
4796758e 41 static Handle(Standard_Transient) model_sd
7fd59977 42 = new BinTObjDrivers_DocumentStorageDriver;
43 return model_sd;
44 }
45
46 if(aGUID == BinRetrievalDriver)
47 {
0797d9d3 48#ifdef OCCT_DEBUG
04232180 49 std::cout << "BinTObjDrivers : Retrieval Plugin" << std::endl;
63c629aa 50#endif
4796758e 51 static Handle (Standard_Transient) model_rd
7fd59977 52 = new BinTObjDrivers_DocumentRetrievalDriver;
53 return model_rd;
54 }
55
56 return BinLDrivers::Factory (aGUID);
57}
58
6fe96f84 59//=======================================================================
60//function : DefineFormat
61//purpose :
62//=======================================================================
63void BinTObjDrivers::DefineFormat (const Handle(TDocStd_Application)& theApp)
64{
65 theApp->DefineFormat ("TObjBin", "Binary TObj OCAF Document", "cbf",
66 new BinTObjDrivers_DocumentRetrievalDriver,
67 new BinTObjDrivers_DocumentStorageDriver);
68}
69
7fd59977 70//=======================================================================
71//function : AddDrivers
72//purpose :
73//=======================================================================
74void BinTObjDrivers::AddDrivers (const Handle(BinMDF_ADriverTable)& aDriverTable,
83ae3591 75 const Handle(Message_Messenger)& aMsgDrv)
7fd59977 76{
77 aDriverTable -> AddDriver (new BinTObjDrivers_ModelDriver (aMsgDrv));
78 aDriverTable -> AddDriver (new BinTObjDrivers_ObjectDriver (aMsgDrv));
79 aDriverTable -> AddDriver (new BinTObjDrivers_ReferenceDriver (aMsgDrv));
80 aDriverTable -> AddDriver (new BinTObjDrivers_XYZDriver (aMsgDrv));
81 aDriverTable -> AddDriver (new BinTObjDrivers_IntSparseArrayDriver (aMsgDrv));
82}
83
84PLUGIN(BinTObjDrivers)