Commit graph

5 commits

Author SHA1 Message Date
kriss
a4d3e62796 FEATURE: Compress Data
CLEANUP: Separating out much of the concern of the large pyPenNotes.py file into SaveRestore.py and UserDrawingArea.py

patch from haakeyar Thanks a lot!

--- Full Ticket Message ---

UserDrawingArea.py is a widget that the user can draw on and you can receive tha strokes that the user has drawn.

SaveRestore contains classes for saving and loading the data. It is split into two closes. A base class takes care of things in common for all file formats, while a subclass implements the actual file format. This way, we could easily implement other file formats, for example a text format where only parts of the file are loaded, to improve loading speed, or ability to save to an sqlite file.

In the base class, I have implemented a simple compression of the notes. Points closer than QUALITY_LOSS (currently set at 5) pixels are merged. This compressed a test note file with 77% and you can barely see the difference. I have attached the original file, the compressed file and a a file with two notes file, the compressed first and the original last (open this file in the original pyPenNotes and switch between the notes to see the difference).
There are also other ways to compress the notes even more (no need for more than two points in a straight line), but I have not implemented that (yet).

Maybe it would be better to move the compression to UserDrawingArea - it would have both good and bad sides.

pyPenNotes.py still has too much responsibility in my opinion - it both displays the window and coordinates SaveRestore and UserDrawingArea, but I haven't done anything about that (yet).

If you want to discuss any of the changes, feel free to contact me on IRC or mail me at my nick at gmail dot com if you want to discuss the changes. 

git-svn-id: http://www.neo1973-germany.de/svn@73 46df4e5c-bc4e-4628-a0fc-830ba316316d
2008-04-24 18:21:45 +00:00
kriss
f4b55d18c7 CLEANUP: quite some code cleanups by haakeyar - thanks!
FEATURE: remove rulers when the second tollbar is not visible

git-svn-id: http://www.neo1973-germany.de/svn@70 46df4e5c-bc4e-4628-a0fc-830ba316316d
2008-04-02 17:37:18 +00:00
kriss
3c172d34e0 MANAGE: Adding directory to archiv patches.
git-svn-id: http://www.neo1973-germany.de/svn@67 46df4e5c-bc4e-4628-a0fc-830ba316316d
2008-03-25 20:06:27 +00:00
kriss
dbf974b473 Author: haakeyar
If you run pyPenNotes without a .penNotes.strokes_data-file, the pyPenNotes.pen_notes[] list is emptied in pyPenNotes.load(). This gives various unexpected behaviour, including not being able to save the notes you created.


git-svn-id: http://www.neo1973-germany.de/svn@66 46df4e5c-bc4e-4628-a0fc-830ba316316d
2008-03-25 19:49:03 +00:00
kriss
098ca7e731 pyPenNotes - Initial import
git-svn-id: http://www.neo1973-germany.de/svn@32 46df4e5c-bc4e-4628-a0fc-830ba316316d
2008-03-13 15:55:28 +00:00