Saturday, April 25, 2009

Undo/Redo works on the refactored tree format

NaroCAD has a working Undo/Redo document interface. To keep all things’ memory efficient, the undo/redo algorithm keeps only the diff (the difference between two states).

A bit problematic in the implementation was the twist that the tree storage was keeping raw pointers which made computing a diff between two points impossible to be done. So the AttributeInterpreters code has right now serialize/deserialize methods. The serialization code is greatly simplified for both read/write.

This fix initially was done using TDD (presented two days before) so not only the Undo/Redo works, but also the OCAF is tested like tree implementation, diff computation and updates.

There is for now not implemented serialization of only one AttributeInterpreter (to be more precise: the reference node) which I will finish very soon (tomorrow!?). Also, there is a complete XML serialization of document representation. I would like to complete a XML deserialization code (means loading/open the file to create a scene).

Note: From Thursday I will be away for vacation for 12 days. If I finish loading/saving file till Monday I will return to complete the Extrude which stands in buggy selection mechanism (if bxtrx will not do it for me ;) )

No comments: