[Drawkit] Now with added testing. (was Re: For the brave ; -)
Graham Cox
graham.cox at bigpond.com
Wed Jul 30 06:45:12 PDT 2008
I've now tested the route-finder and it works very nicely - hope it's
useful to someone out there.
Revised code attached. Note that most of the names have been changed
to something more descriptive from the first pass, and I've added
sanity checking of inputs and so on. Also, a way to get progress
feedback. However, I've tested it with hundreds of objects and until
you get to about 1000 or so, the time it takes seems almost instant,
so progress feedback is not really needed.
I also discovered that it crashes on less than 4 objects, so the code
now tests for that and does nothing with < 4. (If you can't route 3
objects you'd be in trouble anyway I guess).
For testing I added a simple category to the Draw Demo which
implements an action that just routes the active layer's objects,
creates a path from the resulting points and adds that on top, thus
showing the computed route. This code is not intended as anything
other than a quick test.
cheers, Graham
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DKRouteFinder.m
Type: application/octet-stream
Size: 16468 bytes
Desc: not available
URL: <http://lists.apptree.net/pipermail/drawkit-apptree.net/attachments/20080730/afd6ad7c/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DKRouteFinder.h
Type: application/octet-stream
Size: 2138 bytes
Desc: not available
URL: <http://lists.apptree.net/pipermail/drawkit-apptree.net/attachments/20080730/afd6ad7c/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GCDrawDemoDocument+ShortestRoute.m
Type: application/octet-stream
Size: 1813 bytes
Desc: not available
URL: <http://lists.apptree.net/pipermail/drawkit-apptree.net/attachments/20080730/afd6ad7c/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GCDrawDemoDocument+ShortestRoute.h
Type: application/octet-stream
Size: 373 bytes
Desc: not available
URL: <http://lists.apptree.net/pipermail/drawkit-apptree.net/attachments/20080730/afd6ad7c/attachment-0007.obj>
More information about the Drawkit
mailing list