Re: A pie analyzer
Re: A pie analyzer
- Subject: Re: A pie analyzer
- From: Scott Anguish <email@hidden>
- Date: Sat, 19 Apr 2003 16:23:36 -0400
http://homepage.mac.com/tonyswu/temp/c1.gif
My problem is, NSView only allows me to add tooltip for a rect.
I thought about using NSBezierPath's containsPoint method.
But I am not sure if it's a good idea since i'll be calling this
method for average 5 to 8 times each time a user moves his mouse.
I'd suggest trying it and see if it bogs down. NSBezierPath may very
well be optimized to check the bounds of the shape before actually
checking the shape itself.
The other alternative is to figure it out mathematically (determine
the rotational angle of the point to see which 'slice' it would be in,
and then it's distance from the center to see if it is actually within
the slice). Good old geometry.. :-) That's pretty much an atan, two
squares and a square root (plus of course some add/sub action)
Since you know the shape of the target area, this is probably the best
method to use.
I'd recommend against the testing the pixel color method.
Can someone give me some ideas?
Thanks!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.