Re: Need guidance on data structure
Re: Need guidance on data structure
- Subject: Re: Need guidance on data structure
- From: Peter Zegelin <email@hidden>
- Date: Tue, 28 Apr 2009 13:02:28 +1000
On 28/04/2009, at 11:47 AM, Graham Cox wrote:
Not directly a Cocoa question - apologies if that's inappropriate,
but I could do with some brain power to bear on this design problem
and there are lots of smart people here...
I have an object that represents a road, say. It has a path that
gets drawn to show the road. Typically there are several parts to
the rendering of this path, for example a black stroke of say 8
points, overlaid with a grey stroke of say 7 points. This gives a
0.5 point "casement" to the drawn road.
<snip>
The key requirement is that the connections between the parents and
children are drawn properly, which requires that children are always
drawn before their parents. Because of the cyclic nature of the
network though, there isn't a way I can see to simply sort the
objects into the right order.
If you treat your roads/ junctions as a graph with nodes and edges you
can get the junctions to draw themselves. Since it will have
references to its edges ( the roads) it can gather all the info to
draw correctly. In other words you no longer have a parent/child
relationship.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden