0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / BinTObjDrivers / BinTObjDrivers.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 6b13779..03fb78a
@@ -1,7 +1,18 @@
-// File:      BinTObjDrivers.cxx
-// Created:   24.11.04 11:22:17
-// Author:    Michael SAZONOV
-// Copyright:   Open CASCADE  2007
+// Created on: 2004-11-24
+// Created by: Michael SAZONOV
+// Copyright (c) 2004-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
 // The original implementation Copyright: (C) RINA S.p.A
 
 #include <BinLDrivers.hxx>
 #include <BinTObjDrivers_ReferenceDriver.hxx>
 #include <BinTObjDrivers_XYZDriver.hxx>
 #include <Plugin_Macro.hxx>
-
-// avoid warnings on 'extern "C"' functions returning C++ classes
-#ifdef WNT
-#pragma warning(4:4190)
-#endif
+#include <TDocStd_Application.hxx>
 
 static Standard_GUID BinStorageDriver  ("f78ff4a2-a779-11d5-aab4-0050044b1af1");
 static Standard_GUID BinRetrievalDriver("f78ff4a3-a779-11d5-aab4-0050044b1af1");
 
-Handle(Standard_Transient) BinTObjDrivers::Factory(const Standard_GUID& aGUID)
+const Handle(Standard_Transient)& BinTObjDrivers::Factory(const Standard_GUID& aGUID)
 {
   if(aGUID == BinStorageDriver)
   {
+#ifdef OCCT_DEBUG
     cout << "BinTObjDrivers : Storage Plugin" << endl;
-    static Handle(BinTObjDrivers_DocumentStorageDriver) model_sd
+#endif
+    static Handle(Standard_Transient) model_sd
       = new BinTObjDrivers_DocumentStorageDriver;
     return model_sd;
   }
 
   if(aGUID == BinRetrievalDriver)
   {  
+#ifdef OCCT_DEBUG
     cout << "BinTObjDrivers : Retrieval Plugin" << endl;
-    static Handle (BinTObjDrivers_DocumentRetrievalDriver) model_rd
+#endif
+    static Handle (Standard_Transient) model_rd
       = new BinTObjDrivers_DocumentRetrievalDriver;
     return model_rd;
   }
@@ -45,6 +56,17 @@ Handle(Standard_Transient) BinTObjDrivers::Factory(const Standard_GUID& aGUID)
   return BinLDrivers::Factory (aGUID);
 }
 
+//=======================================================================
+//function : DefineFormat
+//purpose  : 
+//=======================================================================
+void BinTObjDrivers::DefineFormat (const Handle(TDocStd_Application)& theApp)
+{
+  theApp->DefineFormat ("TObjBin", "Binary TObj OCAF Document", "cbf",
+                        new BinTObjDrivers_DocumentRetrievalDriver, 
+                        new BinTObjDrivers_DocumentStorageDriver);
+}
+
 //=======================================================================
 //function : AddDrivers
 //purpose  :