1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

Integration of OCCT 6.5.0 from SVN

This commit is contained in:
bugmaster
2011-03-16 07:30:28 +00:00
committed by bugmaster
parent 4903637061
commit 7fd59977df
16375 changed files with 3882564 additions and 0 deletions

36
src/BinDrivers/BinDrivers.cdl Executable file
View File

@@ -0,0 +1,36 @@
-- File: BinDrivers.cdl
-- Created: Tue Oct 29 11:30:48 2002
-- Author: Michael SAZONOV
-- <msv@novgorox.nnov.matra-dtv.fr>
---Copyright: Matra Datavision 2002
package BinDrivers
uses
Standard,
TDF,
TCollection,
TColStd,
CDM,
PCDM,
Storage,
BinObjMgt,
BinMDF,
BinLDrivers
is
class DocumentStorageDriver;
class DocumentRetrievalDriver;
Factory (theGUID : GUID from Standard) returns Transient from Standard;
AttributeDrivers (MsgDrv : MessageDriver from CDM)
returns ADriverTable from BinMDF;
---Purpose: Creates the table of drivers of types supported
StorageVersion returns AsciiString from TCollection;
---Purpose: returns "1"
end BinDrivers;

83
src/BinDrivers/BinDrivers.cxx Executable file
View File

@@ -0,0 +1,83 @@
// File: BinDrivers.cxx
// Created: 29.10.02 18:44:39
// Author: Michael SAZONOV
// Copyright: Open CASCADE 2002
#include <BinDrivers.ixx>
#include <BinLDrivers.hxx>
#include <BinMDF.hxx>
#include <BinMDataStd.hxx>
#include <BinMDataXtd.hxx>
#include <BinMNaming.hxx>
#include <BinMDocStd.hxx>
#include <BinMFunction.hxx>
#include <BinMPrsStd.hxx>
#include <Standard_Failure.hxx>
#include <BinDrivers_DocumentStorageDriver.hxx>
#include <BinDrivers_DocumentRetrievalDriver.hxx>
#include <Plugin_Macro.hxx>
// avoid warnings on 'extern "C"' functions returning C++ classes
#ifdef WNT
#pragma warning(4:4190)
#endif
static Standard_GUID BinStorageDriver ("03a56835-8269-11d5-aab2-0050044b1af1");
static Standard_GUID BinRetrievalDriver("03a56836-8269-11d5-aab2-0050044b1af1");
//=======================================================================
//function : Factory
//purpose : PLUGIN FACTORY
//=======================================================================
Handle(Standard_Transient) BinDrivers::Factory(const Standard_GUID& theGUID)
{
if (theGUID == BinStorageDriver)
{
cout << "BinDrivers : Storage Plugin" << endl;
static Handle(BinDrivers_DocumentStorageDriver) model_sd =
new BinDrivers_DocumentStorageDriver;
return model_sd;
}
if (theGUID == BinRetrievalDriver)
{
cout << "BinDrivers : Retrieval Plugin" << endl;
static Handle(BinDrivers_DocumentRetrievalDriver) model_rd =
new BinDrivers_DocumentRetrievalDriver;
return model_rd;
}
Standard_Failure::Raise ("BinDrivers : unknown GUID");
return NULL;
}
//=======================================================================
//function : AttributeDrivers
//purpose :
//=======================================================================
Handle(BinMDF_ADriverTable) BinDrivers::AttributeDrivers
(const Handle(CDM_MessageDriver)& aMsgDrv)
{
Handle(BinMDF_ADriverTable) aTable = new BinMDF_ADriverTable;
BinMDF ::AddDrivers (aTable, aMsgDrv);
BinMDataStd ::AddDrivers (aTable, aMsgDrv);
BinMDataXtd ::AddDrivers (aTable, aMsgDrv);
BinMNaming ::AddDrivers (aTable, aMsgDrv);
BinMDocStd ::AddDrivers (aTable, aMsgDrv);
BinMFunction ::AddDrivers (aTable, aMsgDrv);
BinMPrsStd ::AddDrivers (aTable, aMsgDrv);
return aTable;
}
//=======================================================================
//function : StorageVersion
//purpose :
//=======================================================================
TCollection_AsciiString BinDrivers::StorageVersion()
{
return BinLDrivers::StorageVersion();
}
PLUGIN(BinDrivers)

View File

@@ -0,0 +1,38 @@
-- File: BinDrivers_DocumentRetrievalDriver.cdl
-- Created: Thu Oct 31 10:52:35 2002
-- Author: Michael SAZONOV
-- <msv@novgorox.nnov.matra-dtv.fr>
---Copyright: Matra Datavision 2002
class DocumentRetrievalDriver from BinDrivers inherits DocumentRetrievalDriver from BinLDrivers
uses
MessageDriver from CDM,
ADriverTable from BinMDF,
Position from Storage,
IStream from Standard,
DocumentSection from BinLDrivers
is
-- ===== Public methods =====
Create returns mutable DocumentRetrievalDriver from BinDrivers;
---Purpose: Constructor
AttributeDrivers (me : mutable; theMsgDriver: MessageDriver from CDM)
returns ADriverTable from BinMDF
is redefined virtual;
ReadShapeSection (me: mutable;
theSection : in out DocumentSection from BinLDrivers;
theIS : in out IStream from Standard;
isMess : Boolean from Standard = Standard_False) is redefined virtual;
CheckShapeSection (me: mutable;
thePos : Position from Storage;
theIS : in out IStream from Standard) is redefined virtual;
PropagateDocumentVersion(me: mutable; theVersion : Integer from Standard)
is redefined virtual;
end DocumentRetrievalDriver;

View File

@@ -0,0 +1,85 @@
// File: BinDrivers_DocumentRetrievalDriver.cxx
// Created: 31.10.02 11:12:22
// Author: Michael SAZONOV
// Copyright: Open CASCADE 2002
#include <BinDrivers_DocumentRetrievalDriver.ixx>
#include <BinDrivers.hxx>
#include <BinLDrivers_DocumentSection.hxx>
#include <BinMNaming.hxx>
#include <BinMNaming_NamedShapeDriver.hxx>
#include <TNaming_NamedShape.hxx>
#include <BinMDataStd.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Standard_Failure.hxx>
#include <Standard_IStream.hxx>
#include <Standard_ErrorHandler.hxx>
//=======================================================================
//function : BinDrivers_DocumentRetrievalDriver
//purpose : Constructor
//=======================================================================
BinDrivers_DocumentRetrievalDriver::BinDrivers_DocumentRetrievalDriver ()
{
}
//=======================================================================
//function : AttributeDrivers
//purpose :
//=======================================================================
Handle(BinMDF_ADriverTable) BinDrivers_DocumentRetrievalDriver::AttributeDrivers
(const Handle(CDM_MessageDriver)& theMessageDriver)
{
return BinDrivers::AttributeDrivers (theMessageDriver);
}
//=======================================================================
//function : ReadShapeSection
//purpose :
//=======================================================================
void BinDrivers_DocumentRetrievalDriver::ReadShapeSection
(BinLDrivers_DocumentSection& /*theSection*/,
Standard_IStream& theIS,
const Standard_Boolean /*isMess*/)
{
// Read Shapes
Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver;
if (myDrivers->GetDriver(STANDARD_TYPE(TNaming_NamedShape),aNamedShapeDriver))
{
try {
OCC_CATCH_SIGNALS
aNamedShapeDriver->ReadShapeSection (theIS);
}
catch(Standard_Failure) {
Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
const TCollection_ExtendedString aMethStr
("BinDrivers_DocumentRetrievalDriver: ");
WriteMessage (aMethStr + "error of Shape Section " +
aFailure->GetMessageString());
}
}
}
//=======================================================================
//function : CheckShapeSection
//purpose :
//=======================================================================
void BinDrivers_DocumentRetrievalDriver::CheckShapeSection(
const Storage_Position& /*ShapeSectionPos*/,
Standard_IStream& /*IS*/)
{}
//=======================================================================
//function : PropagateDocumentVersion
//purpose :
//=======================================================================
void BinDrivers_DocumentRetrievalDriver::PropagateDocumentVersion(
const Standard_Integer theDocVersion )
{
BinMDataStd::SetDocumentVersion(theDocVersion);
BinMNaming::SetDocumentVersion(theDocVersion);
}

View File

@@ -0,0 +1,33 @@
-- File: BinDrivers_DocumentStorageDriver.cdl
-- Created: Tue Oct 29 11:34:03 2002
-- Author: Michael SAZONOV
-- <msv@novgorox.nnov.matra-dtv.fr>
---Copyright: Matra Datavision 2002
class DocumentStorageDriver from BinDrivers inherits DocumentStorageDriver from BinLDrivers
---Purpose: persistent implemention of storage a document in a binary file
uses
OStream from Standard,
MessageDriver from CDM,
DocumentSection from BinLDrivers,
ADriverTable from BinMDF
is
-- ===== Public methods =====
Create returns mutable DocumentStorageDriver from BinDrivers;
---Purpose: Constructor
AttributeDrivers (me : mutable; theMsgDriver: MessageDriver from CDM)
returns ADriverTable from BinMDF
is redefined virtual;
WriteShapeSection (me: mutable; theDocSection : in out DocumentSection from BinLDrivers;
theOS : in out OStream from Standard)
is redefined virtual;
---Purpose: implements the procedure of writing a shape section to file
end DocumentStorageDriver;

View File

@@ -0,0 +1,65 @@
// File: BinDrivers_DocumentStorageDriver.cxx
// Created: 29.10.02 11:53:01
// Author: Michael SAZONOV
// Copyright: Open CASCADE 2002
#include <BinDrivers_DocumentStorageDriver.ixx>
#include <Standard_ErrorHandler.hxx>
#include <TCollection_AsciiString.hxx>
#include <BinDrivers.hxx>
#include <BinMDF_ADriver.hxx>
#include <BinMNaming_NamedShapeDriver.hxx>
#include <TNaming_NamedShape.hxx>
//=======================================================================
//function : BinDrivers_DocumentStorageDriver
//purpose : Constructor
//=======================================================================
BinDrivers_DocumentStorageDriver::BinDrivers_DocumentStorageDriver ()
{
}
//=======================================================================
//function : AttributeDrivers
//purpose :
//=======================================================================
Handle(BinMDF_ADriverTable) BinDrivers_DocumentStorageDriver::AttributeDrivers
(const Handle(CDM_MessageDriver)& theMessageDriver)
{
return BinDrivers::AttributeDrivers (theMessageDriver);
}
//=======================================================================
//function : WriteShapeSection
//purpose : Implements WriteShapeSection
//=======================================================================
void BinDrivers_DocumentStorageDriver::WriteShapeSection
(BinLDrivers_DocumentSection& theSection,
Standard_OStream& theOS)
{
#if defined(_DEBUG) || defined(DEB)
TCollection_ExtendedString aMethStr ("BinDrivers_DocumentStorageDriver, ");
#else
TCollection_ExtendedString aMethStr;
#endif
const Standard_Size aShapesSectionOffset = (Standard_Size) theOS.tellp();
Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver;
if (myDrivers->GetDriver(STANDARD_TYPE(TNaming_NamedShape), aNamedShapeDriver)) {
try {
OCC_CATCH_SIGNALS aNamedShapeDriver->WriteShapeSection (theOS);
}
catch(Standard_Failure) {
TCollection_ExtendedString anErrorStr ("Error: ");
Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
TCollection_ExtendedString aStr =
anErrorStr + aMethStr + "Shape Section :";
WriteMessage (aStr + aFailure->GetMessageString());
}
}
// Write the section info in the TOC.
theSection.Write (theOS, aShapesSectionOffset);
}

View File

@@ -0,0 +1,17 @@
// File: BinDrivers_Marker.hxx
// Created: 31.10.02 15:44:38
// Author: Michael SAZONOV
// Copyright: Open CASCADE 2002
#ifndef BinDrivers_Marker_HeaderFile
#define BinDrivers_Marker_HeaderFile
// The markers used in binary file
enum BinDrivers_Marker
{
BinDrivers_ENDATTRLIST = -1, // the end of attributes list
BinDrivers_ENDLABEL = -2 // the end of label
};
#endif

1
src/BinDrivers/FILES Executable file
View File

@@ -0,0 +1 @@
BinDrivers_Marker.hxx