From geoffrey.russell at gmail.com  Tue Feb 13 07:17:36 2007
From: geoffrey.russell at gmail.com (Geoff Russell)
Date: Tue, 13 Feb 2007 16:47:36 +1030
Subject: [Rd] Graphics driver test script?
In-Reply-To: <45D0D435.6030509@stat.auckland.ac.nz>
References: <93c3eada0702111337i349d3fb5v8cad9777bcbb2714@mail.gmail.com>
	<7098abec0702120008k71d67fe0r717fdf2557060aaf@mail.gmail.com>
	<45D0D435.6030509@stat.auckland.ac.nz>
Message-ID: <93c3eada0702122217i19fb6fc1s1eccbd468eaefb02@mail.gmail.com>

On 2/13/07, Paul Murrell <p.murrell at auckland.ac.nz> wrote:
> Hi
>
>
> Byron Ellis wrote:
> > On 2/11/07, Geoff Russell <geoffrey.russell at gmail.com> wrote:
> >> Hi,
> >>
> >> 1. I started work on a metapost graphics driver a week or so ago and it is
> >> gradually taking shape. I'm building up my own test cases into a
> >> script as I go, but
> >> figured you may have a "canonical testing script" of cases a driver must handle?
> >>
> >
> > I typically use demo(graphics) for initial development and then things
> > like example(plotmath) to make sure I'm getting font encoding working
> > properly.
> >
> >> 2. The clipping function looks like being a tricky problem. It seems
> >> to me that the
> >> callers of the driver assume that clipping affects all following calls
> >> until the next
> >> clipping call resets the clipping box.   With metapost, the clipping
> >> function clips the
> >> current graphics region and has no effect on following drawing functions.  I'm
> >> not sure how to handle this --- the 2 models are very different.
> >>
> >
> > Sounds like you get to make a lot of clipping calls in metapost.
>
>
> Yes, it may not be the most efficient approach, but one method would be
> to keep track of the R's latest clipping region within your device
> structure (just update it whenever R asks your device to set the clip
> region, i.e., in MetaPost_Clip()) and enforce the current clip region
> for each drawing call.

Yes, I can draw to a temp picture, then clip to the current clip region and
then add the temp picture to the current picture. Easy to do, but ugly.

I'll also checkout R clipping - thanks.

Cheers,
Geoff



>
> Paul
>
>
> >> Cheers,
> >> Geoff Russell
> >>
> >> ______________________________________________
> >> R-devel at r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-devel
> >>
> >
> >
>
> --
> Dr Paul Murrell
> Department of Statistics
> The University of Auckland
> Private Bag 92019
> Auckland
> New Zealand
> 64 9 3737599 x85392
> paul at stat.auckland.ac.nz
> http://www.stat.auckland.ac.nz/~paul/
>
>



[Rd] Graphics driver test script?
Geoff Russell