Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Drawing arcs in Obj-C

Drawing arcs in Obj-C
Thread Tools
Mac Enthusiast
Join Date: Mar 2000
Location: atx, usa
Status: Offline
Reply With Quote
Jul 2, 2002, 10:48 AM
 
hello,

i am working on a program that has a custom View that plots geological data on a circular plot. i currently have it configured to draw full circles but that means that a portion of the circle is still visible outside of the plotting area.

there was a method in Java that could draw a circle within a box and also allow you to specify two angles between which the arc would be drawn.

here how it is now (Obj-C)...
<img src="http://cactus.geo.utexas.edu/~adam/stereonet.JPG" alt=" - " />

in java there would be no part of the blue circles would be outside of the black circle.

thanks.

adam

[edited the URL for the image]

<small>[ 07-02-2002, 04:13 PM: Message edited by: adamk ]</small>
"do unto others as you would have them do unto you" begins with yrself.

"He that fights for Allah's cause fights for himself. Allah does not need His creatures' help." -koran, the spider, 29:7
     
Forum Regular
Join Date: Oct 2000
Location: Portland, OR USA
Status: Offline
Reply With Quote
Jul 3, 2002, 07:01 PM
 
What you probably want is to use NSBezierPath and a moveTo/arcTo (not sure of the exact method names) combination for your arcs. Alternatively, You should be able to set the black circle as your clipping path such that nothing ever got drawn outside of it.
     
adamk  (op)
Mac Enthusiast
Join Date: Mar 2000
Location: atx, usa
Status: Offline
Reply With Quote
Jul 4, 2002, 03:57 PM
 
thanks, the NSBezierPath is what i was looking for. it works now.

adam
"do unto others as you would have them do unto you" begins with yrself.

"He that fights for Allah's cause fights for himself. Allah does not need His creatures' help." -koran, the spider, 29:7
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:56 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2