From octave-graphics-request at bevo dot che dot wisc dot edu Sun Mar 14 03:27:05 1999 Subject: Re: Canvas vs Plot Widget From: Rafael Laboissiere To: "John W. Eaton" Cc: octave-graphics at bevo dot che dot wisc dot edu Date: 14 Mar 1999 10:27:06 +0100 >>>>> "JWE" == John W Eaton writes: JWE> If we have to do that, it seems that we could probably start with JWE> the code from some other plot widget or plotting library first. JWE> So I don't think we would have to reinvent the wheel completely. JWE> Maybe we would just have to reinvent steel-belted radials. I am including below a message from the maintainer of the GNU libplot library, sent yesterday to the PLplot mailing list. Sounds like what JWE means by the "core of the wheel" (not to be reinvented). Otherwise, reinventing the "steel-belted radials" means redoing what PLplot does already very well. -- Rafael Laboissière ------- Start of forwarded message ------- Date: Sat, 13 Mar 1999 02:03:17 GMT Message-Id: <199903130203 dot CAA02079 at platinum dot math dot arizona dot edu> From: "Robert S. Maier" To: plplot at dino dot ph dot utexas dot edu Subject: plotutils update Organization: Mathematics Department, University of Arizona Hi, plplot folks (Geoff and Maurice, especially). I'm the principal author and current maintainer of the GNU plotutils, and I thought I'd let you know what I'm doing. I learned a lot by looking at plplot, and especially by reading Geoff's and Maurice's documentation. Plotutils-2.2, including version 2.0 of the GNU libplot graphics library, will be released in a few days (possibly this weekend). libplot is the heart of the distribution, since it includes about 80% of the code. As of now, it's a low-level graphics library, a good deal lower than plplot. Its C API supports the export of 2-D vector graphics files in many output formats: X11, Postscript, PCL5, HP-GL/2, Adobe Illustrator, GIF, PNM, Fig, and Tektronix. As of libplot-2.0, the supported graphics primitives include quadratic and cubic Beziers, as well as lines, polygonal lines, and circular and elliptic arcs. There's support for dashing and the setting of line styles. In fact libplot's imaging model is now quite close to Postscript's (no compound paths yet, though). libplot doesn't yet support an internal display list, but it's rapidly moving in that direction. Right now, it does graphics under X11 by popping up an Xaw label widget as a canvas, drawing in it, and then turning things over to XtAppMainLoop(). Probably in the next release after this one, it will do its own redraws, i.e., the behavior of the X11 driver will be much more "widget-like". Plotutils-2.2 will include a new feature that was suggested by your plstream class. libplot will be accompanied by a C++ class library, called libplotter. libplotter will provide an abstract `Plotter' class for drawing vector graphics, subclassed as XPlotter, PSPlotter, PCLPlotter, GIFPlotter, etc. This won't be just a wrapper around the C API. The libplot code has been restructured in such an object-oriented way that you can now compile it with a C compiler to get libplot, or a C++ compiler to get libplotter. In the Plotter class, there's a virtual method corresponding to each of the drawing functions in the C API. (You may not believe that it's possible to do OOP in C, but you can! As long as the inheritance hierarchy isn't too deep, it's merely painful.) I gave some thought to the possibility, suggested by Geoff, of adding support for generic programming. However, none of libplot's current drawing operations takes an array or a matrix as an argument. That reduces the need for templating on numeric types. Most drawing functions come in two versions: one with double arguments, and one with integer arguments. But the latter are only for compatibility with Unix libplot. I hope to add support for higher-level drawing operations, such as XY plotting and contouring. Probably that should be in a separate, higher-level library, though. If anyone has any suggestions for additions to libplot/libplotter, please let me know. My goal is for it to become a universal `graphics layer' for all kinds of programs that export 2-D vector graphics. One thing I may add is a `RasterPlotter' class, so that a user can produce an in-core bitmap using any specified pixel type. That looks like a possible application of templating, and generic programming concepts. The rasterization code I'm using (taken from the graphics code in the X11 distribution, and rewritten in ANSI C) could be templated with minimal effort. Regards, Robert -- Robert S. Maier | Internet: rsm at math dot arizona dot edu Dept. of Math. | Univ. of Arizona | FAX: +1 520 621 8322 Tucson, AZ 85721 | Voice: +1 520 621 6892 (department) U.S.A. | +1 520 621 2617 (office) Maintainer of the GNU plotting utilities package (see http://www.gnu.org/software/plotutils/plotutils.html ). ------- End of forwarded message -------