• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A pie analyzer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: A pie analyzer
      • From: Shaun Wexler <email@hidden>
References: 
 >A pie analyzer (From: "Tony S. Wu" <email@hidden>)

  • Prev by Date: Re: A pie analyzer
  • Next by Date: Dynamic NSString Array Help?
  • Previous by thread: Re: A pie analyzer
  • Next by thread: Re: A pie analyzer
  • Index(es):
    • Date
    • Thread