Implementing "Undo" Functionality in HOOPS Visualize + Parasolid Integration

Hello,

I am currently working on implementing an Undo operation using helper functions such as LastState() and RestoreState(), based on the following resources:

From my understanding, both Parasolid and HOOPS Visualize/Exchange components need to be saved and restored if not mistake. I am using PK_MARK_create and PK_MARK_goto_2 to manage the Parasolid state.

However, I am still struggling to determine how to correctly save and restore the Visualize/Exchange state, and so the elements such as tessellation, segment updates, or component mapping might need to be handled aswell for subsequent operations to function as expected.

Would you happen to have any suggestions or best practices for implementing this kind of undo functionality? It is like the commonly used Ctrl+Z operation. If there are any relevant sample code examples or documentation you could point me to, I would greatly appreciate it.

Thank you for your time and support.

Kind regards,
Kazi

Hi Kazi,

There may not be any specific sample code or documentation available for this, but one possible approach is to perform the Undo/Redo operation on the Parasolid model, and then reconstruct the corresponding Exchange and Visualize entities from that state, updating the mapping table accordingly.

Best regards,
Toshi

Hi Toshi,

Reconstructing the corresponding Exchange and Visualize entities from the restored Parasolid state worked! Thank you very much for all your help as always.

Kind regards,
Kazi