• 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: How to trim a bezier path?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: How to trim a bezier path?
      • From: "John C. Randolph" <email@hidden>
References: 
 >How to trim a bezier path? (From: Jim Marschke <email@hidden>)

  • Prev by Date: Re: How to trim a bezier path?
  • Next by Date: Re: Bundle Reloading
  • Previous by thread: Re: How to trim a bezier path?
  • Next by thread: Re: How to trim a bezier path?
  • Index(es):
    • Date
    • Thread