Tue, 08/24/2021 - 17:06
Hi everyone, I am creating a TDocStd_Document doc class with BinOCAF format with SetModificationMode(true) & SetUndoLimit(40); and attached few attributes and modified them and could get undos and redos while on session but when I save this to a .cbf file and reload it, the undo-redo transactions are lost. Is there a way to save and reterive the undo transactions even after the session is closed? Can anyone help
Attachments:
Wed, 08/25/2021 - 09:03
Hi Kavin,
There is no possibility to store the undo/redo information in the OCCT TDocStd_Document. As I know, this is out of scope of the functionality of most standard applications.
Wed, 08/25/2021 - 12:19
Hi Mikhail,
Thank you very much for the reply. Is there any other possible ways to save and restore changes. Do you have any ideas?
Wed, 08/25/2021 - 14:31
Kavin,
You can take all information about all deltas using GetUndos and GetRedos method of TDocStd_Document. You could store and then retrieve all this data by creation of special file format for them.
Or, of course, there is a common simple but silly way to save the document every time a transaction is committed. So, you will have a ready state of the document with every transaction to restore it.