mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024927: Getting rid of "Persistent" functionality -- Code
Brute force removal of standard persistence (ShapeSchema, StdLSchema, StdSchema, XCAFSchema) and all persistence-specific toolkits. OCAF formats "MDTV-Standard", "MDTV-XCAF" are removed from resource files. Uses of "MDTV-Standard" are changed to "BinOcaf", and "MDTV-XCAF" changed to "BinXCAF".
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
-- Created on: 2000-09-07
|
||||
-- Created by: TURIN Anatoliy <ati@nnov.matra-dtv.fr>
|
||||
-- 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 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.
|
||||
|
||||
package StdDrivers
|
||||
|
||||
uses
|
||||
|
||||
PDF, Standard, TCollection, CDM, PCDM, TDF, PDF, MDF, TDocStd, MDocStd, PDocStd
|
||||
|
||||
is
|
||||
|
||||
class DocumentRetrievalDriver;
|
||||
|
||||
class DocumentStorageDriver;
|
||||
|
||||
|
||||
---Category: Factory methods
|
||||
-- ==============================================================
|
||||
|
||||
Factory (aGUID: GUID from Standard)
|
||||
returns Transient from Standard;
|
||||
---Purpose: Depending from the ID, returns a list of storage
|
||||
-- or retrieval attribute drivers. Used for plugin
|
||||
|
||||
end StdDrivers;
|
||||
|
@@ -1,80 +0,0 @@
|
||||
// Created on: 2000-09-07
|
||||
// Created by: TURIN Anatoliy
|
||||
// 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 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 <StdDrivers.ixx>
|
||||
#include <StdDrivers_DocumentStorageDriver.hxx>
|
||||
#include <StdDrivers_DocumentRetrievalDriver.hxx>
|
||||
#include <StdSchema.hxx>
|
||||
#include <StdLSchema.hxx>
|
||||
#include <ShapeSchema.hxx>
|
||||
#include <Storage_HArrayOfSchema.hxx>
|
||||
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Plugin_Macro.hxx>
|
||||
|
||||
static Standard_GUID StdStorageDriver ("ad696000-5b34-11d1-b5ba-00a0c9064368");
|
||||
static Standard_GUID StdRetrievalDriver ("ad696001-5b34-11d1-b5ba-00a0c9064368");
|
||||
static Standard_GUID StdSchemaID ("ad696002-5b34-11d1-b5ba-00a0c9064368");
|
||||
|
||||
Handle(Standard_Transient) StdDrivers::Factory(const Standard_GUID& aGUID) {
|
||||
|
||||
if(aGUID == StdSchemaID) {
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "StdSchema : Plugin" << endl;
|
||||
#endif
|
||||
static Handle(StdLSchema) model_ss = new StdLSchema;
|
||||
static Standard_Boolean aNeedNested = Standard_True;
|
||||
if(aNeedNested) {
|
||||
aNeedNested = Standard_False;
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "StdSchema: Adding nested schema" << endl;
|
||||
#endif
|
||||
Handle(StdSchema) aSchema = new StdSchema;
|
||||
Handle(ShapeSchema) aSSchema = new ShapeSchema;
|
||||
Handle(Storage_HArrayOfSchema) aSchemas = new Storage_HArrayOfSchema(0,1);
|
||||
aSchemas->SetValue(0, aSSchema);
|
||||
aSchemas->SetValue(1, aSchema);
|
||||
model_ss->SetNestedSchemas(aSchemas);
|
||||
}
|
||||
return model_ss;
|
||||
}
|
||||
|
||||
if(aGUID == StdStorageDriver) {
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "StdDrivers : Storage Plugin" << endl;
|
||||
#endif
|
||||
static Handle(StdDrivers_DocumentStorageDriver) model_sd = new StdDrivers_DocumentStorageDriver;
|
||||
return model_sd;
|
||||
}
|
||||
if(aGUID == StdRetrievalDriver) {
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "StdDrivers : Retrieval Plugin" << endl;
|
||||
#endif
|
||||
static Handle(StdDrivers_DocumentRetrievalDriver) model_rd = new StdDrivers_DocumentRetrievalDriver;
|
||||
return model_rd;
|
||||
}
|
||||
|
||||
Standard_Failure::Raise ("StdDrivers : unknown GUID");
|
||||
Handle(Standard_Transient) t;
|
||||
return t;
|
||||
}
|
||||
|
||||
#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(StdDrivers)
|
@@ -1,35 +0,0 @@
|
||||
-- Created on: 2000-09-07
|
||||
-- Created by: TURIN Anatoliy <ati@nnov.matra-dtv.fr>
|
||||
-- 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 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.
|
||||
|
||||
class DocumentRetrievalDriver from StdDrivers inherits DocumentRetrievalDriver from MDocStd
|
||||
|
||||
---Purpose: retrieval driver of a Part document
|
||||
|
||||
uses
|
||||
|
||||
ARDriverTable from MDF,
|
||||
MessageDriver from CDM
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns DocumentRetrievalDriver from StdDrivers;
|
||||
|
||||
AttributeDrivers(me : mutable; theMessageDriver : MessageDriver from CDM)
|
||||
returns ARDriverTable from MDF
|
||||
is redefined;
|
||||
|
||||
end DocumentRetrievalDriver;
|
||||
|
@@ -1,56 +0,0 @@
|
||||
// Created on: 2000-09-07
|
||||
// Created by: TURIN Anatoliy
|
||||
// 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 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 <StdDrivers_DocumentRetrievalDriver.ixx>
|
||||
#include <MDF_ARDriverHSequence.hxx>
|
||||
|
||||
#include <MDF.hxx>
|
||||
#include <MDataStd.hxx>
|
||||
#include <MDataXtd.hxx>
|
||||
#include <MNaming.hxx>
|
||||
#include <MDocStd.hxx>
|
||||
#include <MFunction.hxx>
|
||||
#include <MPrsStd.hxx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
//=======================================================================
|
||||
//function : PAppStd_DocumentRetrievalDriver
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
StdDrivers_DocumentRetrievalDriver::StdDrivers_DocumentRetrievalDriver() {}
|
||||
|
||||
//=======================================================================
|
||||
//function : AttributeDrivers
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(MDF_ARDriverTable) StdDrivers_DocumentRetrievalDriver::AttributeDrivers(const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
{
|
||||
Handle(MDF_ARDriverTable) aRetrievalTable = new MDF_ARDriverTable();
|
||||
//
|
||||
Handle(MDF_ARDriverHSequence) HARSeq = new MDF_ARDriverHSequence();
|
||||
MDF::AddRetrievalDrivers(HARSeq, theMsgDriver);
|
||||
MDataStd::AddRetrievalDrivers(HARSeq, theMsgDriver);
|
||||
MDataXtd::AddRetrievalDrivers(HARSeq, theMsgDriver);
|
||||
MDocStd::AddRetrievalDrivers(HARSeq, theMsgDriver);
|
||||
MFunction::AddRetrievalDrivers(HARSeq, theMsgDriver);
|
||||
MNaming::AddRetrievalDrivers(HARSeq, theMsgDriver);
|
||||
MPrsStd::AddRetrievalDrivers(HARSeq, theMsgDriver);
|
||||
|
||||
//
|
||||
aRetrievalTable->SetDrivers(HARSeq);
|
||||
return aRetrievalTable;
|
||||
}
|
||||
|
@@ -1,42 +0,0 @@
|
||||
-- Created on: 2000-09-07
|
||||
-- Created by: TURIN Anatoliy <ati@nnov.matra-dtv.fr>
|
||||
-- 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 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.
|
||||
|
||||
class DocumentStorageDriver from StdDrivers inherits DocumentStorageDriver from MDocStd
|
||||
|
||||
---Purpose: storage driver of a Part document
|
||||
|
||||
|
||||
uses Document from CDM,
|
||||
MessageDriver from CDM,
|
||||
Document from PCDM,
|
||||
SequenceOfDocument from PCDM,
|
||||
ExtendedString from TCollection,
|
||||
ASDriverTable from MDF
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns DocumentStorageDriver from StdDrivers;
|
||||
|
||||
Make(me : mutable; aDocument : Document from CDM;
|
||||
Documents : out SequenceOfDocument from PCDM)
|
||||
is redefined;
|
||||
|
||||
AttributeDrivers(me : mutable; theMessageDriver : MessageDriver from CDM)
|
||||
returns ASDriverTable from MDF
|
||||
is redefined;
|
||||
|
||||
end DocumentStorageDriver;
|
@@ -1,83 +0,0 @@
|
||||
// Created on: 2000-09-07
|
||||
// Created by: TURIN Anatoliy
|
||||
// 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 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 <StdDrivers_DocumentStorageDriver.ixx>
|
||||
#include <MDF.hxx>
|
||||
#include <MDataStd.hxx>
|
||||
#include <MDataXtd.hxx>
|
||||
#include <MNaming.hxx>
|
||||
#include <MDocStd.hxx>
|
||||
#include <MPrsStd.hxx>
|
||||
#include <MFunction.hxx>
|
||||
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <PDocStd_Document.hxx>
|
||||
#include <TDocStd_Document.hxx>
|
||||
|
||||
#include <TDF_Label.hxx>
|
||||
#include <MDF_ASDriverHSequence.hxx>
|
||||
#include <MDF_SRelocationTable.hxx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PAppStd_DocumentStorageDriver
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
StdDrivers_DocumentStorageDriver::StdDrivers_DocumentStorageDriver () {}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : AttributeDrivers
|
||||
//purpose : faire le Plugin
|
||||
//=======================================================================
|
||||
|
||||
Handle(MDF_ASDriverTable) StdDrivers_DocumentStorageDriver::AttributeDrivers(const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
{
|
||||
Handle(MDF_ASDriverTable) aStorageTable = new MDF_ASDriverTable();
|
||||
//
|
||||
Handle(MDF_ASDriverHSequence) HASSeq = new MDF_ASDriverHSequence();
|
||||
MDF::AddStorageDrivers(HASSeq, theMsgDriver);
|
||||
MDataStd::AddStorageDrivers(HASSeq, theMsgDriver);
|
||||
MDataXtd::AddStorageDrivers(HASSeq, theMsgDriver);
|
||||
MDocStd::AddStorageDrivers(HASSeq, theMsgDriver);
|
||||
MFunction::AddStorageDrivers(HASSeq, theMsgDriver);
|
||||
MNaming::AddStorageDrivers(HASSeq, theMsgDriver);
|
||||
MPrsStd::AddStorageDrivers(HASSeq, theMsgDriver);
|
||||
//
|
||||
aStorageTable->SetDrivers(HASSeq);
|
||||
return aStorageTable;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Make
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void StdDrivers_DocumentStorageDriver::Make (const Handle(CDM_Document)& aDocument,
|
||||
PCDM_SequenceOfDocument& Documents)
|
||||
{
|
||||
Handle(PDocStd_Document) PDOC;
|
||||
Handle(MDF_SRelocationTable) Reloc = new MDF_SRelocationTable();
|
||||
Handle(TDocStd_Document) TDOC = Handle(TDocStd_Document)::DownCast(aDocument);
|
||||
if (!TDOC.IsNull()) {
|
||||
PDOC = new PDocStd_Document ();
|
||||
Paste (TDOC,PDOC,Reloc);
|
||||
}
|
||||
Documents.Append(PDOC);
|
||||
}
|
Reference in New Issue
Block a user