Thu, 03/14/2002 - 17:48
Hi,
I'm trying to write some data to a FSD_File, using the following code:
...
FSD_File myFile;
Handle(ShapeSchema) schema=new ShapeSchema;
Handle(Storage_Data) data=new Storage_Data;
data->ClearErrorStatus();
if (myFile.Open("D:/temp/test.csf", Storage_VSWrite)!=Storage_VSOk)
return 0;
Standard_Real radius=5;
Handle(PGeom_Curve) circle=new PGeom_Circle(gp::XOY(),radius);
gp_Dir aDir(10,20,30);
Handle(Standard_Persistent) extrude=new PGeom_SurfaceOfLinearExtrusion(circle,aDir);
data->AddRoot(Extrude);
schema->Write(myFile,data);
myFile.Close();
...
If I try to read the file, (I use the SampelImportExport program) I get the error message "Unable to read". The reason for this error is, that the file does not contain any shapes.
How must I change my data, to be able to read the file?
Is there any other way to write OpenCascade files?
Thanks for any help,
Stefan
Thu, 03/14/2002 - 20:40
Hi,
you are savong a geometrical entity, not a shape.
You need to change the ImportExport::ReadCSFDB function ( where aPShape = Handle(PTopoDS_HShape)::DownCast(p); : try to downcast p in PGeom_Curve )
Stephane
http://www.exotk.org