Tue, 12/01/2020 - 09:40
Hi
I am upgrading from 6.9.1 to 7.5.0 and having problems implementing even basic backward compatibility.
The specific issue is: The attached .std file (a box) opens OK in the installed OCAF sample in v6.9.1. But in installed v7.0.5 Draw command
Draw[4]> Open D:\Temp\OCC.std D
fails. See the screenshots.
It must be an old problem because the same command also fails in v6.9.1.
I am using Windows 10 and Visual Studio 2019.
---------------------------------------------------------------------
Additional info: The sample code in "Restore OCCT 6.9.1 persistence" section at Open CASCADE Technology: Upgrade from older OCCT versions - OpenCascade Documentation
does not seem to be working in the case because Handle(ShapePersistent_TopoDS::HShape) aHShape = Handle(ShapePersistent_TopoDS::HShape)::DownCast(aPObject); is null. The actual type of the object is StdLPersistent_Document. I tried look deeper into the object. It seems to contain integers only. During the StdStorage::Read() no shapes seem to be created (not totally sure as contractors are opaque in OCCT :( )
Thank you
Wed, 12/02/2020 - 15:24
Tip: the official Upgrade Guide (till the latest + in-development releases and without corrupted formatting as in your link) can be found on Development Portal:
https://dev.opencascade.org/doc/overview/html/occt__upgrade.html#upgrade_720_persistence
Thu, 12/03/2020 - 02:13
Thank you, Kirill
Sorry, I made a mistake about Draw. What I wanted to write, as your link suggests, was
Does not work in the official 7.5.0 release. OCC.std is just a box. I have added "0031968: EXCEPTION IN STDSTORAGE::READ()" to the bug tracker. Thanks for the suggestion.
----------------
Thank you for the link. It is formatted nicely, but I would be concern about "7.6.0.dev" on the top. It also did not work for me, as I wrote.
I have submitted "0031969: Application Framework - cannot read .std files created by OCCT 6.9.1" bug for that
BUT
I have found solution for myself: I have added StdDrivers::DefineFormat(myApp); to application constructor and the old code started to work! No need for what "Restore OCCT 6.9.1 persistence" section suggests.
So to me it looks like documentation is wrong. Instead of the current context it should have one line: Add StdDrivers::DefineFormat(myApp); This is what I expected from the start. Using StdStorage would break logic in my app significantly.
7.6.0.dev