Next: Drawing Functions, Previous: Functions, Up: Functions
The following are the “control functions” in libplot
. They are
the basic functions that open, initialize, or close an already-created
Plotter. They are listed in the approximate order in which they would
be called.
In the current C binding, each of these functions takes a pointer to
a plPlotter
as its first argument. Also in the current C binding, the name of each function begins with "pl_" and ends with "_r". ("_r" stands for `revised' or `reentrant'.) For information
on older C bindings, see Older C APIs. In the C++
binding, these are member functions of the Plotter
class and its
subclasses, and the prefix and suffix are not used.
Currently, an X Plotter pops up a new window on an X Window
System display for each page of graphics, i.e., with each invocation of
openpl
. Future releases may support window re-use.
bgcolor affects only Plotters that have a notion of background
color, i.e., X Plotters, X Drawable Plotters, PNG Plotters, PNM
Plotters, and GIF Plotters (all of which produce bitmaps), CGM Plotters,
ReGIS Plotters and Metafile Plotters. Its effect is simple: the next
time the erase operation is invoked on such a Plotter, its display
will be filled with the specified color.
bgcolorname affects only Plotters that have a notion of background color, i.e., X Plotters, X Drawable Plotters, PNG Plotters, PNM Plotters, and GIF Plotters (all of which produce bitmaps), CGM Plotters, ReGIS Plotters, and Metafile Plotters. Its effect is simple: the next time the erase operation is invoked on such a Plotter, its display will be filled with the specified color.
SVG Plotters and CGM Plotters support "none" as a value for the
background color. It will turn off the background: the drawn
objects will not be backed by anything. This is useful when the
generated SVG or WebCGM file is to be placed on a Web page.
It is frequently useful to invoke erase at the beginning of each
page, i.e., immediately after invoking openpl. That is because some
Plotters are persistent, in the sense that objects drawn within an
openpl
...closepl
pair remain on the graphics display
even after a new page is begun by a subsequent invocation of
openpl
. Currently, only X Drawable Plotters and Tektronix
Plotters are persistent. Future releases may support optional
persistence for X Plotters also.
On X Plotters and X Drawable Plotters the effects of invoking erase
will be altogether different if the Plotter parameter
USE_DOUBLE_BUFFERING
is set to "yes". In this case, objects
will be written to an off-screen buffer rather than to the graphics
display, and invoking erase will (1) copy the contents of this
buffer to the display, and (2) erase the buffer by filling it with
the background color. This `double buffering' feature facilitates
smooth animation. See Plotter Parameters.
In mathematical terms, calling space or fspace sets the affine transformation from user coordinates to device coordinates. That is, it sets the transformation matrix attribute for each object subsequently drawn on the display. Either space or fspace would usually be invoked at the beginning of each page of graphics, i.e., immediately after the call to openpl. Additional calls to space or fspace are allowed, and there are several “mapping functions” that also affect the transformation matrix attribute. See Mapping Functions.
Note that the size and location of the viewport depend on the type of
Plotter, and on the Plotter parameters that are specified at Plotter
creation time. For example, the default viewport used by any
Illustrator, Postscript, Fig, PCL, and HP-GL Plotter is a square whose
size depends on the Plotter's page type. See Page and Viewport Sizes.
All Plotters except Tektronix Plotters have the "SOLID_FILL" capability, meaning they can fill paths with solid color. Each such Plotter has at least one of the "EVEN_ODD_FILL" and "NONZERO_WINDING_NUMBER_FILL" capabilities. These indicate the supported rules for determining the `inside' of a path.
The `maybe' value is returned for most capabilities by Metafile
Plotters, which do no drawing themselves. The output of a Metafile
Plotter must be translated to another format, or displayed, by invoking
plot
.
In the present release of libplot
, some Plotters output each page
of graphics immediately after it is plotted, i.e., when closepl is
invoked to end the page. That is the case with PCL and HP-GL Plotters,
in particular. Plotters that can output only a single page of graphics
(PNG, PNM, GIF, SVG, Illustrator, and Fig Plotters) do so immediately
after the first page is plotted, i.e., when closepl is invoked for
the first time. Postscript and CGM Plotters store all pages of graphics
internally, and do not produce output until they are deleted.