Re: [Plib-devel] Proposed change to PuDial
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2002-02-03 16:19:57
|
Steve Baker wrote: > > Norman Vine wrote: > > > > Hi All > > > > I have been experimenting with a version of PuDial that stashes > > the sin and cosine for the circle drawing. It seems to work well > > and I can't think of a case where it would break any existing code > > but I do precompute the transcendentals in the constructor so this > > could cause a problem if the dial was to ever change size ( radius ) > > <snip> > > > Should I commit this ? > > Yes - sounds good to me. If the computation of the points were > in a private member function, it shouldn't be too hard to call that > if ever the size changes. <steve finishes first coffee of day and wakes up a little> ...or... Why not just precompute the trancendentals *only* and do the 'multiply-by-the-radius' step in realtime? That should get us back *most* of the computation time that your original idea saved - but because the table is now independent of the radius, it doesn't change when the widget is resized. More than that, you now only need one table for *all* puDials instead of a separate table for *each* puDial - so it can be pre-computed and stored as a pre-initialised static array inside puDial.cxx ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |