Re: [Pythoncad-developer] Undo functionality
CAD Application entire developed in Python
Status: Beta
Brought to you by:
matteoboscolo
From: Matteo B. <mat...@bo...> - 2010-02-06 18:36:33
|
Hi Gertwing, I like this solution very clever solution .,.... regars, Matteo On Sat, 2010-02-06 at 18:21 +0000, ger...@gm... wrote: > Hi All, > > I was thinking about implementing undo functionality in combination > with the database. > I am not aware how this is solved in the current version but with a > database we can make the undo recording persistent (you can undo > changes from a previous drawing session). > > The idea is not to modify entities in the database but mark the old > entity state as deleted and insert a new record for the modified > entity state. > Then there are two records in the database, one is the previous state > and one is the the current state of the entity. > Of course the entities that are marked as deleted (previous state) are > not drawn. > > When the user does undo the current state is marked as deleted and the > previous state is marked as not deleted. > A redo does this marking in the opposite direction. > > If we add a column "state" and a column "undo_mark" to our entity > table we can achieve this. > The column "state" holds the delete (or not) state. > The column "undo_mark" holds the value of the undo id. > Because the user can modify many entities at once all those entities > get the same "undo_mark". > > This way the history of the drawing is kept in the database and the > user can undo and redo actions from previous sessions. > If we also add a time stamp we even can provide functionality that > will show how the drawing looked at a certain date. > > I think this functionality can have some use and is something other > CAD programs does not always provide. > Undo and redo are simple database queries that are easy to implement. > We must keep the display list in sync with the state of the database > but I think this also it not difficult. > > We also need a function that compresses the drawing by removing the > history. > > If it needs clarification, let me know I will try to explain. > > Do you think it is useful? > > Regards, > Gertwin > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ Pythoncad-developer mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/pythoncad-developer |