]> OCCT Git - occt-copy.git/commitdiff
0027558: Restore support for legacy XCAF persistence format CR27558
authormyn <myn@opencascade.com>
Wed, 8 Jun 2016 11:10:23 +0000 (14:10 +0300)
committermyn <myn@opencascade.com>
Wed, 8 Jun 2016 11:10:23 +0000 (14:10 +0300)
13 files changed:
adm/UDLIST
src/StdResource/Plugin
src/StdResource/XCAF
src/TKXCAF/EXTERNLIB
src/TKXCAF/PACKAGES
src/XCAFDrivers/FILES [new file with mode: 0644]
src/XCAFDrivers/XCAFDrivers.cxx [new file with mode: 0644]
src/XCAFDrivers/XCAFDrivers.hxx [new file with mode: 0644]
src/XCAFDrivers/XCAFDrivers_DocumentRetrievalDriver.cxx [new file with mode: 0644]
src/XCAFDrivers/XCAFDrivers_DocumentRetrievalDriver.hxx [new file with mode: 0644]
src/XCAFPersistent/FILES [new file with mode: 0644]
src/XCAFPersistent/XCAFPersistent.cxx [new file with mode: 0644]
src/XCAFPersistent/XCAFPersistent.hxx [new file with mode: 0644]

index b6d6b2fb69a63cca1064fecbc98e7472a4425981..bb2778d7ab9307996be49bfe3995241346fdfc30 100644 (file)
@@ -363,6 +363,8 @@ n XCAFApp
 n XCAFDimTolObjects
 n XCAFDoc
 n XCAFPrs
+n XCAFDrivers
+n XCAFPersistent
 n XSAlgo
 n XSControl
 n XmlMXCAFDoc
index b346df48f407a3e78be5cadba797145eafc92969..283157d67f0f8242a945e7c646c72f09a69582eb 100755 (executable)
@@ -33,6 +33,10 @@ bd696001-5b34-11d1-b5ba-00a0c9064368.Location: TKStdL
 13a56835-8269-11d5-aab2-0050044b1af1.Location: TKBinL
 13a56836-8269-11d5-aab2-0050044b1af1.Location: TKBinL
 !
+! XCAF  Document Plugin
+!
+ed8793f9-3142-11d4-b9b5-0060b0ee281b.Location: TKXCAF
+!
 ! XmlXCAF Document Plugin
 !
 f78ff496-a779-11d5-aab4-0050044b1af1.Location: TKXmlXCAF
index 4a67f6ec4db177b0c1e26c7b8c623e2213d3331d..12ca59a98d1ddc24c48a26c53b09f5e5dd784f66 100755 (executable)
@@ -7,9 +7,7 @@ xml.FileFormat: XmlXCAF
 !
 MDTV-XCAF.Description: XCAF Document Version 1.0
 MDTV-XCAF.FileExtension: dxc
-MDTV-XCAF.StoragePlugin: ed8793f8-3142-11d4-b9b5-0060b0ee281b
 MDTV-XCAF.RetrievalPlugin: ed8793f9-3142-11d4-b9b5-0060b0ee281b
-MDTV-XCAFSchema: ed8793fa-3142-11d4-b9b5-0060b0ee281b
 !
 ! XmlXCAF format
 !
@@ -29,11 +27,7 @@ BinXCAF.RetrievalPlugin: a78ff497-a779-11d5-aab4-0050044b1af1
 !
 MDTV-Standard.Description: Standard Document Version 1.0
 MDTV-Standard.FileExtension: std
-MDTV-Standard.StoragePlugin: ad696000-5b34-11d1-b5ba-00a0c9064368
 MDTV-Standard.RetrievalPlugin: ad696001-5b34-11d1-b5ba-00a0c9064368
-MDTV-StandardSchema: ad696002-5b34-11d1-b5ba-00a0c9064368
-MDTV-Standard.AttributeStoragePlugin: 47b0b826-d931-11d1-b5da-00a0c9064368
-MDTV-Standard.AttributeRetrievalPlugin: 47b0b827-d931-11d1-b5da-00a0c9064368
 !
 ! XmlOcaf format
 !
index b23eb5c108adf12306ce7f65646a0233559a092d..115699d4b9da914d904a10f83ae5ada846aee1e1 100755 (executable)
@@ -10,3 +10,5 @@ TKLCAF
 TKG3d
 TKCAF
 TKVCAF
+TKStd
+TKStdL
index ad9e0b5c8239f74ac5ac6fa6edd61c32e397ad94..30208588e71387f71a0d360486f425d609305641 100755 (executable)
@@ -2,3 +2,5 @@ XCAFApp
 XCAFDimTolObjects
 XCAFDoc
 XCAFPrs
+XCAFDrivers
+XCAFPersistent
diff --git a/src/XCAFDrivers/FILES b/src/XCAFDrivers/FILES
new file mode 100644 (file)
index 0000000..fa960bf
--- /dev/null
@@ -0,0 +1,4 @@
+XCAFDrivers.cxx
+XCAFDrivers.hxx
+XCAFDrivers_DocumentRetrievalDriver.cxx
+XCAFDrivers_DocumentRetrievalDriver.hxx
diff --git a/src/XCAFDrivers/XCAFDrivers.cxx b/src/XCAFDrivers/XCAFDrivers.cxx
new file mode 100644 (file)
index 0000000..7455bbf
--- /dev/null
@@ -0,0 +1,70 @@
+// Created on: 2000-05-24
+// Created by: Edward AGAPOV
+// Copyright (c) 2000-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 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.
+
+#include <XCAFDrivers.hxx>
+#include <XCAFDrivers_DocumentRetrievalDriver.hxx>
+
+#include <StdDrivers.hxx>
+
+#include <StdLPersistent.hxx>
+#include <StdPersistent.hxx>
+#include <ShapePersistent.hxx>
+#include <XCAFPersistent.hxx>
+
+#include <Standard_Failure.hxx>
+#include <Standard_GUID.hxx>
+#include <Plugin_Macro.hxx>
+
+static Standard_GUID XSRetrievalDriver ("ed8793f9-3142-11d4-b9b5-0060b0ee281b");
+
+//=======================================================================
+//function : Factory
+//purpose  : Depending from the ID, returns a list of storage
+//           or retrieval attribute drivers. Used for plugin
+//=======================================================================
+Handle(Standard_Transient) XCAFDrivers::Factory (const Standard_GUID& aGUID)
+{
+  if (aGUID == XSRetrievalDriver) 
+  {  
+#ifdef OCCT_DEBUG
+    cout << "XCAFDrivers : Retrieval Plugin" << endl;
+#endif
+
+    static Handle (XCAFDrivers_DocumentRetrievalDriver) model_rd = new XCAFDrivers_DocumentRetrievalDriver;
+    return model_rd;
+  }
+  
+  return StdDrivers::Factory (aGUID);
+}
+
+//=======================================================================
+//function : BindTypes
+//purpose  : Register types
+//=======================================================================
+void XCAFDrivers::BindTypes (StdObjMgt_MapOfInstantiators& theMap)
+{
+  StdLPersistent ::BindTypes (theMap);
+  StdPersistent  ::BindTypes (theMap);
+  ShapePersistent::BindTypes (theMap);
+  XCAFPersistent ::BindTypes (theMap);
+}
+
+
+#ifdef _MSC_VER
+#pragma warning(disable:4190) /* disable warning on C++ type returned by C function; should be OK for C++ usage */
+#endif
+
+// Declare entry point PLUGINFACTORY
+PLUGIN(XCAFDrivers)
diff --git a/src/XCAFDrivers/XCAFDrivers.hxx b/src/XCAFDrivers/XCAFDrivers.hxx
new file mode 100644 (file)
index 0000000..36b9773
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) 2016 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.
+
+#ifndef _XCAFDrivers_HeaderFile
+#define _XCAFDrivers_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Handle.hxx>
+
+class Standard_Transient;
+class Standard_GUID;
+class StdObjMgt_MapOfInstantiators;
+
+
+class XCAFDrivers
+{
+  friend class XCAFDrivers_DocumentRetrievalDriver;
+
+public:
+  //! Depending from the ID, returns a list of storage
+  //! or retrieval attribute drivers. Used for plugin.
+  Standard_EXPORT static Handle(Standard_Transient) Factory (const Standard_GUID& aGUID);
+
+  //! Register types.
+  Standard_EXPORT static void BindTypes (StdObjMgt_MapOfInstantiators& theMap);
+
+  DEFINE_STANDARD_ALLOC
+};
+
+#endif // _XCAFDrivers_HeaderFile
diff --git a/src/XCAFDrivers/XCAFDrivers_DocumentRetrievalDriver.cxx b/src/XCAFDrivers/XCAFDrivers_DocumentRetrievalDriver.cxx
new file mode 100644 (file)
index 0000000..f67bab4
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (c) 2016 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.
+
+#include <XCAFDrivers_DocumentRetrievalDriver.hxx>
+#include <XCAFDrivers.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT (XCAFDrivers_DocumentRetrievalDriver, StdDrivers_DocumentRetrievalDriver)
+
+//=======================================================================
+//function : bindTypes
+//purpose  : Register types
+//=======================================================================
+void XCAFDrivers_DocumentRetrievalDriver::bindTypes (StdObjMgt_MapOfInstantiators& theMap)
+{
+  XCAFDrivers::BindTypes (theMap);
+}
diff --git a/src/XCAFDrivers/XCAFDrivers_DocumentRetrievalDriver.hxx b/src/XCAFDrivers/XCAFDrivers_DocumentRetrievalDriver.hxx
new file mode 100644 (file)
index 0000000..f30efc6
--- /dev/null
@@ -0,0 +1,30 @@
+// Copyright (c) 2016 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.
+
+#ifndef _XCAFDrivers_DocumentRetrievalDriver_HeaderFile
+#define _XCAFDrivers_DocumentRetrievalDriver_HeaderFile
+
+#include <StdDrivers_DocumentRetrievalDriver.hxx>
+
+//! retrieval driver of a Part document
+class XCAFDrivers_DocumentRetrievalDriver : public StdDrivers_DocumentRetrievalDriver
+{
+public:
+  DEFINE_STANDARD_RTTIEXT (XCAFDrivers_DocumentRetrievalDriver, StdDrivers_DocumentRetrievalDriver)
+
+protected:
+  //! Register types.
+  Standard_EXPORT virtual void bindTypes (StdObjMgt_MapOfInstantiators& theMap) Standard_OVERRIDE;
+};
+
+#endif // _XCAFDrivers_DocumentRetrievalDriver_HeaderFile
diff --git a/src/XCAFPersistent/FILES b/src/XCAFPersistent/FILES
new file mode 100644 (file)
index 0000000..51f4cf5
--- /dev/null
@@ -0,0 +1,2 @@
+XCAFPersistent.cxx
+XCAFPersistent.hxx
diff --git a/src/XCAFPersistent/XCAFPersistent.cxx b/src/XCAFPersistent/XCAFPersistent.cxx
new file mode 100644 (file)
index 0000000..621a73a
--- /dev/null
@@ -0,0 +1,61 @@
+// Copyright (c) 2016 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.
+
+#include <XCAFPersistent.hxx>
+#include <StdObjMgt_MapOfInstantiators.hxx>
+
+//#include <XCAFPersistent_Area.hxx>
+//#include <XCAFPersistent_Centroid.hxx>
+//#include <XCAFPersistent_Color.hxx>
+//#include <XCAFPersistent_ColorTool.hxx>
+//#include <XCAFPersistent_Datum.hxx>
+//#include <XCAFPersistent_DimTol.hxx>
+//#include <XCAFPersistent_DimTolTool.hxx>
+//#include <XCAFPersistent_DocumentTool.hxx>
+//#include <XCAFPersistent_GraphNode.hxx>
+//#include <XCAFPersistent_LayerTool.hxx>
+//#include <XCAFPersistent_Location.hxx>
+//#include <XCAFPersistent_Material.hxx>
+//#include <XCAFPersistent_MaterialTool.hxx>
+//#include <XCAFPersistent_ShapeTool.hxx>
+//#include <XCAFPersistent_Volume.hxx>
+//#include <XCAFPersistent_GraphNodeSequence.hxx>
+
+
+//=======================================================================
+//function : BindTypes
+//purpose  : Register types
+//=======================================================================
+void XCAFPersistent::BindTypes (StdObjMgt_MapOfInstantiators& theMap)
+{
+  // Attributes
+//  theMap.Bind <XCAFPersistent_Area>         ("PXCAFDoc_Area");
+//  theMap.Bind <XCAFPersistent_Centroid>     ("PXCAFDoc_Centroid");
+//  theMap.Bind <XCAFPersistent_Color>        ("PXCAFDoc_Color");
+//  theMap.Bind <XCAFPersistent_ColorTool>    ("PXCAFDoc_ColorTool");
+//  theMap.Bind <XCAFPersistent_Datum>        ("PXCAFDoc_Datum");
+//  theMap.Bind <XCAFPersistent_DimTol>       ("PXCAFDoc_DimTol");
+//  theMap.Bind <XCAFPersistent_DimTolTool>   ("PXCAFDoc_DimTolTool");
+//  theMap.Bind <XCAFPersistent_DocumentTool> ("PXCAFDoc_DocumentTool");
+//  theMap.Bind <XCAFPersistent_GraphNode>    ("PXCAFDoc_GraphNode");
+//  theMap.Bind <XCAFPersistent_LayerTool>    ("PXCAFDoc_LayerTool");
+//  theMap.Bind <XCAFPersistent_Location>     ("PXCAFDoc_Location");
+//  theMap.Bind <XCAFPersistent_Material>     ("PXCAFDoc_Material");
+//  theMap.Bind <XCAFPersistent_MaterialTool> ("PXCAFDoc_MaterialTool");
+//  theMap.Bind <XCAFPersistent_ShapeTool>    ("PXCAFDoc_ShapeTool");
+//  theMap.Bind <XCAFPersistent_Volume>       ("PXCAFDoc_Volume");
+
+  // Non-attribute data
+//  theMap.Bind <XCAFPersistent_GraphNodeSequence>       ("PXCAFDoc_GraphNodeSequence");
+//  theMap.Bind <XCAFPersistent_GraphNodeSequence::Node> ("PXCAFDoc_SeqNodeOfGraphNodeSequence");
+}
diff --git a/src/XCAFPersistent/XCAFPersistent.hxx b/src/XCAFPersistent/XCAFPersistent.hxx
new file mode 100644 (file)
index 0000000..6734f16
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (c) 2016 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.
+
+
+#ifndef _XCAFPersistent_HeaderFile
+#define _XCAFPersistent_HeaderFile
+
+#include <Standard_Macro.hxx>
+
+class StdObjMgt_MapOfInstantiators;
+
+class XCAFPersistent
+{
+public:
+  //! Register types.
+  Standard_EXPORT static void BindTypes (StdObjMgt_MapOfInstantiators& theMap);
+};
+
+#endif