mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
28
src/StdDrivers/StdDrivers.cdl
Executable file
28
src/StdDrivers/StdDrivers.cdl
Executable file
@@ -0,0 +1,28 @@
|
||||
-- File: PAppStd.cdl
|
||||
-- Created: Sep 7 16:29:46 2000
|
||||
-- Author: TURIN Anatoliy <ati@nnov.matra-dtv.fr>
|
||||
-- Copyright: Matra Datavision 2000
|
||||
|
||||
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;
|
||||
|
71
src/StdDrivers/StdDrivers.cxx
Executable file
71
src/StdDrivers/StdDrivers.cxx
Executable file
@@ -0,0 +1,71 @@
|
||||
// File: PAppStd.cxx
|
||||
// Created: Sep 7 16:30:02 2000
|
||||
// Author: TURIN Anatoliy <ati@nnov.matra-dtv.fr>
|
||||
// Copyright: Matra Datavision 2000
|
||||
|
||||
#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>
|
||||
|
||||
// avoid warnings on 'extern "C"' functions returning C++ classes
|
||||
#ifdef WNT
|
||||
#pragma warning(4:4190)
|
||||
#endif
|
||||
|
||||
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 DEB
|
||||
cout << "StdSchema : Plugin" << endl;
|
||||
#endif
|
||||
static Handle(StdLSchema) model_ss = new StdLSchema;
|
||||
static Standard_Boolean aNeedNested = Standard_True;
|
||||
if(aNeedNested) {
|
||||
aNeedNested = Standard_False;
|
||||
#ifdef DEB
|
||||
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 DEB
|
||||
cout << "StdDrivers : Storage Plugin" << endl;
|
||||
#endif
|
||||
static Handle(StdDrivers_DocumentStorageDriver) model_sd = new StdDrivers_DocumentStorageDriver;
|
||||
return model_sd;
|
||||
}
|
||||
if(aGUID == StdRetrievalDriver) {
|
||||
#ifdef DEB
|
||||
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;
|
||||
}
|
||||
|
||||
// Declare entry point PLUGINFACTORY
|
||||
PLUGIN(StdDrivers)
|
25
src/StdDrivers/StdDrivers_DocumentRetrievalDriver.cdl
Executable file
25
src/StdDrivers/StdDrivers_DocumentRetrievalDriver.cdl
Executable file
@@ -0,0 +1,25 @@
|
||||
-- File: PAppStd_DocumentRetrievalDriver.cdl
|
||||
-- Created: Sep 7 16:30:56 2000
|
||||
-- Author: TURIN Anatoliy <ati@nnov.matra-dtv.fr>
|
||||
-- Copyright: Matra Datavision 2000
|
||||
|
||||
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 mutable DocumentRetrievalDriver from StdDrivers;
|
||||
|
||||
AttributeDrivers(me : mutable; theMessageDriver : MessageDriver from CDM)
|
||||
returns ARDriverTable from MDF
|
||||
is redefined;
|
||||
|
||||
end DocumentRetrievalDriver;
|
||||
|
46
src/StdDrivers/StdDrivers_DocumentRetrievalDriver.cxx
Executable file
46
src/StdDrivers/StdDrivers_DocumentRetrievalDriver.cxx
Executable file
@@ -0,0 +1,46 @@
|
||||
// File: PAppStd_DocumentRetrievalDriver.cxx
|
||||
// Created: Sep 7 16:30:56 2000
|
||||
// Author: TURIN Anatoliy <ati@nnov.matra-dtv.fr>
|
||||
// Copyright: Matra Datavision 2000
|
||||
|
||||
#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;
|
||||
}
|
||||
|
32
src/StdDrivers/StdDrivers_DocumentStorageDriver.cdl
Executable file
32
src/StdDrivers/StdDrivers_DocumentStorageDriver.cdl
Executable file
@@ -0,0 +1,32 @@
|
||||
-- File: PAppStd_DocumentStorageDriver.cdl
|
||||
-- Created: Sep 7 16:30:56 2000
|
||||
-- Author: TURIN Anatoliy <ati@nnov.matra-dtv.fr>
|
||||
-- Copyright: Matra Datavision 2000
|
||||
|
||||
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 mutable 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;
|
73
src/StdDrivers/StdDrivers_DocumentStorageDriver.cxx
Executable file
73
src/StdDrivers/StdDrivers_DocumentStorageDriver.cxx
Executable file
@@ -0,0 +1,73 @@
|
||||
// File: PAppStd_DocumentStorageDriver.cxx
|
||||
// Created: Sep 7 16:30:56 2000
|
||||
// Author: TURIN Anatoliy <ati@nnov.matra-dtv.fr>
|
||||
// Copyright: Matra Datavision 2000
|
||||
|
||||
#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