wmayer wrote: ↑
Thu Nov 15, 2018 6:24 pm
However, when restoring from a broken project then a geometry which OCCT fails to create should not abort the whole reading process but only the creation of this element and then continue with the next. It's always better to restore at least something than nothing.
I am working towards this. How does this sound to you?
https://github.com/abdullahtahiriyo/Fre ... l/new/3690
1. New exception RestoreError, to note that it was a problem to recover an element and a best effort was made.
2. Make App::Property be aware of whether it should disregard the element or add it (relevant for sketches).
NOTE: I am still missing to set this to true in SketchObject.cpp
3. Make elements do a best effort to recover, only implemented to LineSegment
4. Enable lists, in this case only implemented for PropertyGeometryList to do a partial recover on certain errors
If this would be acceptable, I have another question:
Look at the end of void PropertyGeometryList::Restore(Base::XMLReader &reader)
I am trying to convey to the user a message that the Restore was not complete, so that after restore, eventually a pop-up would appear warning the user.
Doing a THROW at each function in the stack (see stack in the previous post), while allowing to continue restoring is not efficient the way I am imagining it (a bool that throws an exception on each function only to catch it in the caller and set another boolean and throw another exception at the end of the function).
Would it be possible to make Restore return an int or a boolean, so that we can mark that a partial restore took place?
Thanks in advance.