Re: [Pythoncad-developer] Undo functionality
CAD Application entire developed in Python
Status: Beta
Brought to you by:
matteoboscolo
From: Yagnesh D. <yn...@gm...> - 2010-02-07 02:34:15
|
Gertwin; I like the Idea. I think providing the facility of how drawing looked on a particular date is helpful, if we are able to tag that particular state of drawing as Major "Revision" then it would be very helpful. All engineers use drawings as Rev 0, Rev 1, Rev 2 etc. All the intermediate states are not that important. That is I can roll back to older "sensible" version and not the draft version of it. - - - - - - Best regards Yagnesh Desai Save a tree...please don't print this e-mail. On Sat, Feb 6, 2010 at 11:51 PM, <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 > > |