On Wed, Oct 7, 2009 at 2:58 AM, Mark de Wever <[email protected]> wrote: > Mark de Wever wrote: >> >> Hi, >> >> I've been working on creating a plplot widget in gtkmm [1], this widget >> uses the extcairo driver. In order to get this widget working I've been >> making several modifications to the plplot sources. > > I created a new patch in response to the discussion regarding the offset > usage. I hope the other questions in my initial mail will be answered as > well and some feedback about the patch in general. > > I haven't been able to get PLESC_RESIZE to work as wanted so disabled it for > now. > > PLESC_INITFIT calls plbop() which causes the initial drawing to work as > wanted. > Since the offsets in the geometry aren't meant to be used as offset in the > widget, the x1 and y1 of the clipping rectangle should both be 0.0 when used > in PLESC_INITFIT. I added a warning if that pre-condition is not true.
Mark, Based on my experience using extcairo, I think that most of the items addressed by your patch would be better to handle on the client/GUI side rather than in PLplot itself. Using the current extcairo device, providing an offscreen Cairo surface to render to is much faster than providing the GUI window widget directly to PLplot. This avoids needing to deal with PLplot at all when an expose event occurs as the offscreen surface can be painted on to the widget surface. For the resize case, forcing PLplot to do a replot with plreplot or plRemakePlot will unfortunately just replay the same plot graphics, with the same physical (pixel) dimensions. If this is acceptable for your application then you can: (1) keep the widget at a fixed size, even if the window is resized; (2) stretch the offscreen canvas to fit the new widget dimenions; or (3) show the plot with the same physical size centered or otherwise positioned within the widget. If that is not acceptable, then either a plot buffer needs to be maintained by the user application or a change could be made to the PLplot stream buffer to accommodate this. A function could be added to PLplot which replays a plot stream's buffer in a manner which is independent of the output canvas size. Doing this correctly would require (as has been mentioned) that either the PLplot Cairo driver keep its own record of plotted elements or such a record is kept as part of the PLplot stream. I think that making this a non-driver-specific part of PLplot would be the ideal solution as all drivers could benefit from the implementation. I haven't looked in to this in much detail yet so there may be cross-device difficulties implementing a generic (re)plot stream. All that said, I still think that the actual replay of the plot buffer should be handled by the client application rather than PLplot. A "plreplay" function could ease this and allow the programmer to decide how they want to handle a resized canvas. I hope this helps. Hez -- Hezekiah M. Carty Graduate Research Assistant University of Maryland Department of Atmospheric and Oceanic Science ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Plplot-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plplot-devel
