Benjamin Jessup wrote: > I also commented out the commands in the DrawObject class of > floatcanvas.py which set the HitPen and HitBrush to be able to add more > than 10,000 objects. I didn't realize how FC does the mouse click tests, > and if I comment out these then I no longer have the ability to do hit > tests since the mouse hit routine is based around tracking different > colors. Any ideas on how I could modify FC to track mouse hits without > creating a GDI_OBJECT for each FC object? I'm guessing the mouse click > xy position could be used...
yes, it could, and if you are doing circles, then it's pretty easy. You can use the FC_EVT*** events, and then test for hits yourself. Take a look in the code for the PointSet Object -- something si ilar is done there. I would like to know a bit more about your application -- 100,000 circles is a lot! Could you use PointSet objects instead? Also -- this is something that we should be able to do, and I'm still confused about the problem -- if you don't have more than 10,000 _different_ pens and brushes, then it shouldn't be a problem. However, your point about the hit-testing is a good one -- for that to work, you NEED every object to be a different color, thus lots of pens and brushes. I think the thing to do is see if we can non cache them and see if it makes much difference performance-wise. It would also be good to see if we can duplicate this issue outside of FloatCanvas, so we could get some help from the wxPython and/or wx devs. I don't really have time to poke into this now, so anything you can do would be great. If nothing else, you could track how large the Pen and Brush dicts are getting -- that might give us a hint: DrawObject.BrushList DrawObject.PenList Do you have a small sample you can post that shows the problem? Also, another solution is to reset the limit: http://msdn.microsoft.com/en-us/library/ms724291(VS.85).aspx Though there is still some limit! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [email protected] _______________________________________________ FloatCanvas mailing list [email protected] http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
