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

0024927: Getting rid of "Persistent" functionality -- Samples and data

Support of old persistence (CSFDB format) is removed from OCCT samples (C#, MFC and Qt)

Motor model from data/csfdb is converted from CSFDB to BRep format and put to data/occ (Motor-c.brep)
This commit is contained in:
dln
2014-08-26 16:15:24 +04:00
committed by bugmaster
parent e837410dac
commit 41f0360528
94 changed files with 18136 additions and 1395 deletions

View File

@@ -16,14 +16,6 @@
//brep tools
#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
#include <MgtBRep.hxx>
#include <PTColStd_PersistentTransientMap.hxx>
//csfdb I/E
#include <FSD_File.hxx>
#include <ShapeSchema.hxx>
#include <Storage_Data.hxx>
#include <Storage_HSeqOfRoot.hxx>
#include <Storage_Root.hxx>
// iges I/E
#include <IGESControl_Reader.hxx>
#include <IGESControl_Controller.hxx>
@@ -44,9 +36,6 @@
#pragma comment(lib, "TKernel.lib")
#pragma comment(lib, "TKMath.lib")
#pragma comment(lib, "TKBRep.lib")
#pragma comment(lib, "PTKernel.lib")
#pragma comment(lib, "TKPShape.lib")
#pragma comment(lib, "TKShapeSchema.lib")
#pragma comment(lib, "TKXSBase.lib")
#pragma comment(lib, "TKService.lib")
#pragma comment(lib, "TKV3d.lib")
@@ -779,51 +768,6 @@ public:
return true;
}
/// <summary>
///Import Csfdb file
/// </summary>
/// <param name="theFileName">Name of import file</param>
bool ImportCsfdb(char* theFileName)
{
Standard_CString aFileName = (Standard_CString) theFileName;
if ( FSD_File::IsGoodFileType(aFileName) != Storage_VSOk )
{
return false;
}
FSD_File aFileDriver;
TCollection_AsciiString aName( aFileName );
if ( aFileDriver.Open( aName, Storage_VSRead ) != Storage_VSOk )
{
return false;
}
Handle(ShapeSchema) aSchema = new ShapeSchema();
Handle(Storage_Data) data = aSchema->Read( aFileDriver );
if ( data->ErrorStatus() != Storage_VSOk )
{
return false;
}
aFileDriver.Close();
Handle(Storage_HSeqOfRoot) aRoots = data->Roots();
for ( int i = 1; i <= aRoots->Length() ; i++ )
{
Handle(Storage_Root) aStorRoot = aRoots->Value( i );
Handle(Standard_Persistent) aStandPersistent = aStorRoot->Object();
Handle(PTopoDS_HShape) aPShape = Handle(PTopoDS_HShape)::DownCast(aStandPersistent);
if ( !aPShape.IsNull() )
{
PTColStd_PersistentTransientMap aMap;
TopoDS_Shape aTShape;
MgtBRep::Translate( aPShape, aMap, aTShape, MgtBRep_WithTriangle );
myAISContext()->Display(new AIS_Shape(aTShape));
}
}
return true;
}
/// <summary>
///Import Step file
/// </summary>
@@ -1037,12 +981,9 @@ public:
isResult = ImportBrep(aFilename);
break;
case 1:
isResult = ImportCsfdb(aFilename);
break;
case 2:
isResult = ImportStep(aFilename);
break;
case 3:
case 2:
isResult = ImportIges(aFilename);
break;
default:
@@ -1056,19 +997,19 @@ public:
case 0:
isResult = ExportBRep(aFilename);
break;
case 2:
case 1:
isResult = ExportStep(aFilename);
break;
case 3:
case 2:
isResult = ExportIges(aFilename);
break;
case 4:
case 3:
isResult = ExportVrml(aFilename);
break;
case 5:
case 4:
isResult = ExportStl(aFilename);
break;
case 6:
case 5:
isResult = Dump(aFilename);
break;
default: