| United States-English |
|
|
|
![]() |
HP-UX Starbase Device Drivers Manual - Vol2: HP 9000 Series 700 Computers > Chapter 2 The CADplt2 Device DriverTo Open and Initialize for Output |
|
C programs[12]:
FORTRAN 77 programs:
Pascal programs:
The gopen procedure has four parameters: path, kind, driver, mode.
The CADplt2 driver can be used with devices that support HP-GL/2 and PCL (Printer Control Language). The driver will context switch the device into HP-GL/2 mode by sending the escape sequence EC%-IB before sending any HP-GL/2 commands. On devices which do not support PCL (pen plotters) the context switch command will be ignored. The CADplt2 driver makes extensive use of the HP-GL/2 command PE. This command provides move, draw, pen-up, pen-down, and select pen functionality in an encoded format. Spoolfile size may be significantly reduced depending on the mix of output primitives, resulting in much improved plotting times. The HP-GL/2 default color table is the same as the Starbase default color table. The exception to this is that entry 0 is white (no pen) and entry 1 is black[13]. To read the current color table values, use the inquire_color_table procedure. Color output results may differ depending on the device used. The color electrostatic plotter will achieve the truest color reproductions. It can reproduce a wide spectrum of colors since it has an arbitrary number of definable pens. Black and white electrostatic plotters can only reproduce color map entries 0 for white and 1 for black. Any other color selection will result in either white or black. Pen plotters may produce different results based on the colors the device has available. Pen plotters have a set number of physical pens. The color map should be resized and redefined to reflect the physical number of pens and pen colors in the following steps.
The default color map has 64 entries with 17 shown in the following table (entries 18-63 are various color shades defined by Starbase). Table 2-2 Default Color Map
You can redefine the default color map size and contexts using the gescape HPGL2_SET_CMAP_SIZE and the Starbase routine define_color_table. Defining, redefining, and sizing the color map will not increase the size of the spooled files. Functions that take red, green, and blue values as arguments are supported. Starbase chooses the pen that most closely corresponds in value to the red, green, and blue values selected using the color map entries and sends the color map index to the driver. A "square root of sum of squares" algorithm is used to identify the pen. Each Starbase routine that selects color has two variants: (a) one takes a color map, and (b) the other takes a red, green, and blue triplet. See Starbase Reference manual for more information on color selection routines. HP-GL/2 is a single quadrant coordinate system, as opposed to HP-GL which is a four quadrant system. The default P1, P2 limits for the CADplt2 driver operating in this coordinate system are P1=0, 0, P2=35376, 24000, equal to the D-sized paper in a 7600/240D electrostatic plotter. Since plotter-unit size is not device dependent, these coordinates are correct for any HP-GL/2 plotter with D-sized paper.
If the device is not in SPOOLED mode, the device driver will send the HP-GL/2 command OI and use the returned string as the device ID. If the device is spooled, the device ID will be CADplt2. All the Starbase line types are supported in the CADplt2 driver. (Index 4, DASH_DOT_DOT, not supported in the CADplt or HP-GL driver, is supported in the CADplt2 driver.) The following table shows the default line types CADplt2 supports. Table 2-3 Line Types
The gescape HPGL2_ADAPTIVE_LINES[14] selects either fixed (default) or adaptive line types. An adaptive line type "fits" the pattern between endpoints to insure an integer number of patterns; thus, endpoints always have a line drawn to them. Fixed line types resemble lines on a raster display, where the pattern is not fitted but wrapped around the object. In this configuration, endpoints could show up in a "move" rather than "draw" region of the pattern. The values for P1 and P2 are device dependent and will vary depending on the gopen mode that was used when accessing the device as below:
An initial timeout of 10 seconds is used when the procedure gopen is called. If the device is accessed correctly by the gopen call within the timeout, the timeout is removed completely for all further action. Should the device be taken off line or fail after a successful gopen call, the device driver can "hang" indefinitely during operation. [12] The actual path names of directories in angle brackets depend on the file system structure. See the Graphics Administration Guide for details. [13] Electrostatic plotters can plot white (no pen) over an area already plotted in another color. [14] Warning: Adaptive line types may produce solid-looking lines when used with primitives such as circles, which are rendered by using many small line segments. The pattern will "adapt" to each small line segment. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||