Re: How to trim a bezier path?
Re: How to trim a bezier path?
- Subject: Re: How to trim a bezier path?
- From: Nicko van Someren <email@hidden>
- Date: Wed, 7 Dec 2005 15:08:42 +0000
On 7 Dec 2005, at 13:26, Jim Marschke wrote:
I have a small app which collects temperature data and graphs it
over time. As I collect new data, I append it to an existing
path. If I run this app for many days the bezier path gets large
and eats up a lot of memory. What I want to do is set a limit of
how much data I display (maybe a day or two) and once I reach that
begin removing points from the beginning of the path as I add
points to the end of it.
Is there a simple way to do this?
The short answer is no. There is no API for removing points from a
Bezier path. Either you'll need to keep a copy of the raw data and
periodically recreate the path from the last N data points or you
will need to walk through the points in the path using -
elementAtIndex:associatedPoints: and build a new path using that
information. The former method is almost always going to be a better
solution. Note that you don't need to do this every time; you can
continue building the path incrementally but just throw it away and
rebuild it as needed (e.g. when the path gets too big to draw quickly).
Cheers,
Nicko
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden