1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

...

1 Commits

Author SHA1 Message Date
myn
2c57ab72bc 0027558: Restore support for legacy XCAF persistence format 2016-06-08 14:10:23 +03:00
13 changed files with 273 additions and 6 deletions

View File

@@ -363,6 +363,8 @@ n XCAFApp
n XCAFDimTolObjects
n XCAFDoc
n XCAFPrs
n XCAFDrivers
n XCAFPersistent
n XSAlgo
n XSControl
n XmlMXCAFDoc

View File

@@ -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

View File

@@ -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
!

View File

@@ -10,3 +10,5 @@ TKLCAF
TKG3d
TKCAF
TKVCAF
TKStd
TKStdL

View File

@@ -2,3 +2,5 @@ XCAFApp
XCAFDimTolObjects
XCAFDoc
XCAFPrs
XCAFDrivers
XCAFPersistent

4
src/XCAFDrivers/FILES Normal file
View File

@@ -0,0 +1,4 @@
XCAFDrivers.cxx
XCAFDrivers.hxx
XCAFDrivers_DocumentRetrievalDriver.cxx
XCAFDrivers_DocumentRetrievalDriver.hxx

View File

@@ -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)

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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

2
src/XCAFPersistent/FILES Normal file
View File

@@ -0,0 +1,2 @@
XCAFPersistent.cxx
XCAFPersistent.hxx

View File

@@ -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");
}

View File

@@ -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