The graPHIGS API provides the capability for plotting CGM and GDF files produced by the graPHIGS API. You can plot GDF files on an IBM Color Plotter (6180, 6182, 6184, 6186, 7371, 7372, 7374, 7375). You can also plot GDF files on non-IBM plotters, as described in this section. You can plot CGM files on any plotter with HP GL2 support. For a list of supported plotters, as well as initial set-up instructions, see the appropriate graPHIGS API installation or customization manual:
When you select IBM plotter support at installation time, the cpsI1 plot module for IBM plotters is installed in the /usr/lpd subdirectory. Likewise, if you select CalComp and/or Versatec support, the cpsC1 plot module for CalComp plotters and/or the cpsVI plot module for Versatec plotters is installed in the /usr/lpd subdirectory.
Before proceeding, follow the instructions for setting up your environment:
Note: The graPHIGS API cpsC1 backend produces CalComp 906/907 format data.
You can use the graPHIGS API plot modules as printer backends, or execute them directly, bypassing the print queueing facilities.
Note: The graPHIGS API plot modules use the current working directory for certain input and output files. See the discussion of the -ldir option on for more information.
To plot a file, the following syntax can be used:
/usr/lpd/plotmodule -option filename.gdf ^ | |------|
where:
Note:
- The symbol & may be added after the GDF filename to plot in the background:
/usr/lpd/cpsI1 -option filename.gdf & ^ | |------|- If you are using the IBM plot module, cpsI1 , and plotting to a plotter connected to a serial port, the option -ttyx must be specified, and must appear as the first option after the plot module name. -ttyx is the name of the tty port returned when the port was defined (for example, tty0 , tty1 , etc.). The -ttyx option is not needed if -nopl is specified to plot IBM data to a file.
Examples:
- To plot the file tmp0001.gdf to an IBM plotter attached to the tty0 port:
/usr/lpd/cpsI1 -tty0 tmp0001.gdf- To plot the same file in the background, and to rotate the plot 90 degrees:
/usr/lpd/cpsI1 -tty0 -rot tmp0001.gdf &- To convert the file tmp0001.gdf to CalComp data:
/usr/lpd/cpsC1 -ispi tmp0001.gdf- To convert the file tmp0001.gdf to Versatec data:
/usr/lpd/cpsV1 -ispi tmp0001.gdf
A plot can be scheduled through smit or by using the enq command.
enq -P queuename -o option filename.gdf ^ | |--------|
where:
The following is a list of optional parameters which can be passed to the plot modules. You can specify plot options on the command line or you can include, in your plot command, an option that identifies a file containing the plot options you wish to use. This is particularly useful if you use many options or if you use the same options repeatedly.
Note: When they are used in the option file, some options use syntax different from that described below. See the description of using options in an option file.
When you specify the -af option, the graPHIGS API must determine the maximum number of polygon vertices that can be sent to your plotter. This value is called max_poly_points and has a default of 2000. You can override the default by specifying a new value in the option file (not on the command line) using the max_poly_points keyword. If this value is exceeded by your polygon data, the area fill will be processed by software.
Note: -af is supported on the 6180 if a Graphics Enhancement Cartridge (P/N 5452389) is installed on the plotter.Early models of the 7374 and 7375 plotters did not support polygon mode commands. If you are using this option parameter while plotting to one of these plotters, you may experience unexpected area fill output. To plot normally, remove this option from the list of parameters.
Supported on: cpsI1
Supported on: cpsI1, cpsC1, cpsV1
Supported on: cpsI1, cpsC1, cpsV1
Supported on: cpsI1, cpsC1, cpsV1
Supported on: cpsC1
Supported on: cpsI1
Supported on: cpsI1
Supported on: cpsI1, cpsC1, cpsV1
Supported on: cpsI1, cpsC1, cpsV1
Supported on: cpsI1, cpsC1, cpsV1
Note: The -es option is automatically in effect when -ispi is used. refer to The Personal graPHIGS Programming Interface: Customization and Problem Diagnosis manual for more information on this option.
Supported on: cpsC1, cpsV1
enq -Pgdf -o -ldir/u/design/plot fileb.gdftells the graPHIGS API plotting backend to use the /u/design/plot directory for input and output, however, the current directory would still be searched for fileb.gdf because the -ldir option does not affect the search location for GDF files when AIX queueing is used. The qdaemon automatically passes a fully qualified pathname, based on your command line input, to the backend. If direct backend plotting is used, the -ldir option affects all files.
The log.fil, generated whenever a plotting backend is executed, includes a message indicating whether -ldir was successfully used.
The -ldir option cannot be specified in an option file.
Supported on: cpsI1, cpsC1, cpsV1
Supported on: cpsI1, cpsC1, cpsV1
By default, this effect is avoided by chopping the spike back to the desired position when stroking wide lines, but specifying -nochop turns all chopping off. The default chopping occurs for any angle less than 40 degrees. Both inside and outside facing angles are chopped by default.
This parameter is ignored if -nolw is being used.
Supported on: cpsI1, cpsC1, cpsV1
Supported on: cpsI1
Supported on: cpsI1, cpsC1, cpsV1
Supported on: cpsI1
Note: There is no blank between the -optf option and the filename specified.
Although only one option file may be specified from the command line, an option file may call additional option files up to a total of ten. Options specified on the command line, however, always override those specified in an option file.
Supported on: cpsI1, cpsC1, cpsV1
The definition of the pentbl.fil file This file should be placed in the current working directory. This file is only accessed when -pens is specified.
Note: If you do not specify -pens, then the default pen selection is based on a default set of pen values, which is the same as the example pentbl.fil shown pentbl.fil shown
Supported on: cpsI1, cpsC1, cpsV1
Supported on: cpsI1
Supported on: cpsI1
Supported on: cpsI1
Supported on: cpsI1
cpsV1 -ispi -o -VEROUT$HOME/output.plot fname.gdfwould produce a plot output file in the user's home directory with the name, output.plot
Supported on: cpsV1
Supported on: cpsV1
Supported on: cpsV1
Supported on: cpsV1
You can specify options in an option file by using -optf described on page supplying the necessary option file. You can create the option file by using an editor and following these syntax rules:
# option file for cpsI1 # -es:es -pens:pens -nopl:none
Supported on: cpsI1, cpsC1, cpsV1
There are three ways in which you can use the logfile option:
Specify log_name:date when you want to create a a file that will include the current date in the filename. For example, apr05.log would be created for the first plot run on April 5, and would be used for each successive plot that day with each log appended to the end of the previous log.
Use logfile to have the same filename as the gdf file to be plotted. For example, a plot of file gear.gdf would generate a logfile named gear.log.
Use log_name:XXXXXX to specify a logfile name of your choice in an AIX-recognizable format. The logfile is affected by the current directory.
Supported on: cpsI1, cpsC1, cpsV1
The graPHIGS API generates plotter data using approximately 11 bytes per coordinate pair. Depending on size of your plotter's polygon buffer (the plotter Guide to Operations contains this information), you may be able to optimize performance by setting the maximum vertices higher or lower than the default value of 2000. For example, a 1k polygon buffer might operate most efficiently with max_poly_points=90 because 11 bytes[default]90=990. Any vertices exceeding the 1k capacity of the plotter hardware are handled by the backend, reducing performance. The 11 bytes/vertex formula is only an approximation, however, and trial and error may reveal a more efficient setting.
Supported on: cpsI1
Use fully-qualified AIX pathnames with the optfname option.
Supported on: cpsI1, cpsC1, cpsV1
Use fully-qualified AIX pathnames with the pentable option.
Supported on: cpsI1, cpsV1
Supported on: cpsI1
Options are assigned values in the order in which they are processed. For example, if an option file sets the paper size (-ps=a:ps=a ) but then calls a second option file that also sets the paper size (-ps=b:ps=b ), size b remains in effect. However, if the first option file specifies -ps=a:ps=a at a point after it has called the second option file, then paper size a remains in effect because it was the last paper size setting processed. Command line options supersede those specified in any option file. Thus, if you specify a plotting option differently on the command from your option file specifications, the command line options are used.
In the following example, an option file (myopt1.fil) is called, which in turn, calls myopt2.filscreen
cpsI1 -ps=b -optfmyopt1.fil wheelc3.gdf
If myopt1.fil contains:
# option file 1 -logfilename:mylog.fil -chopout:chopout optfname:myopt2.fil -ang35:ang35 -pens:pensAnd myopt2.fil contains:
# option file 2 -ps=c:ps=c -pens:noneThe options that remain in effect for the plot are chopout, ang35, and pens because the ang40 and -pens:none specifications in myopt2.fil are superseded by the specifications later encountered when processing returns to myopt1.filscreen The paper size is determined by -ps=b on the command line.
The following table summarizes the plotting options.
Option | cpsI1 | cpsC1 | cpsV1 |
---|---|---|---|
-af | X | ||
-angXX | X | X | X |
-chopall | X | X | X |
-chopout | X | X | X |
-c16 | X | ||
-es | X | ||
-esx | X | ||
-hinXX=nn.nnn | X | X | X |
-hcmXX=nn.nnn | X | X | X |
-hsfix | X | X | X |
-hsprop | X | X | X |
-ispi | X | X | |
-ldir | X | X | X |
-nobord | X | X | X |
-nochop | X | X | X |
-noin | X | ||
-nolw | X | X | X |
-nopl | X | ||
-optf | X | X | X |
-pens | X | X | X |
-ps=x | X | ||
-rot | X | ||
-slow | X | ||
-ttyX | X | ||
-VEROUT | X | ||
-VMSGS | X | ||
-VPARM | X | ||
-v16 | X | ||
hatchspace | X | X | X |
log_name | X | X | X |
max_poly_points | X | ||
optfname | X | X | X |
pentable | X | X | |
serial_port | X |
Depending on the combination of options you specify, plot log and output files can be written to the current directory, the /usr/lpd/qdir directory, or another directory of your choice. The following sequence of events explains how the various directories are selected.
pentbl.fil File |
---|
2 <------ Row 1: Options 1 1 0.3 -- 2 2 0.3 | 3 3 0.3 | 4 4 0.3 <---| Rows 2 - 9: Pen data 5 5 0.3 | 6 6 0.3 | 7 7 0.3 | 8 8 0.3 -- --- --- ----- | | | | | |-- Diameter (columns 9 - 15): Range = 0.0 - 99.9999 (mm) | |--Color (columns 3 - 8): Range = 0 - 65535 |--Slot (columns 1 - 2): Range = 1 - 8 |
Row | Columns | Type | Range | Description |
---|---|---|---|---|
1 (Options) | 1-2 | Integer | 1,2 | Search Priority
|
2-9 (Pen data) | 1-2 | Integer | 1-8 (or 1-16, see below) | Slot in pen carousel on plotter. This field has been included for clarity and its values are ignored. |
2-9 (Pen data) | 3-8 | Integer | 0,1,2, ... 65535 | Color of pen.
This field specifies the color of the pen in the
corresponding slot in the carousel.
The following GDDM/GDF defined values are
supported by the graPHIGS APIscreen
See below for the R,G,B
components associated with these colors.
|
2-9 (Pen data) | 9-15 | Floating-point | 0.0 ... 99.9999 | Pen tip diameter (in millimeters). This value will be used to map line thickness to an appropriate pen number based on the current line width scale factor and the graPHIGS API nominal line width of 0.269mm. |
The graPHIGS colors described above can be derived from Red, Green, and Blue components in the following way:
Find the values of Rval, Gval, and Bval using the following chart and the appropriate Red, Green, and Blue components, then refer to the table below to find the color based on these values.
Amount of Red | Value of Rval |
---|---|
<0.33 | 0 |
<0.66 | 1 |
>=0.66 | 2 |
Amount of Green | Value of Gval |
---|---|
<0.25 | 0 |
<0.50 | 1 |
<0.75 | 2 |
>=0.75 | 3 |
Amount of Blue | Value of Bval |
---|---|
<0.33 | 0 |
<0.66 | 1 |
>=0.66 | 2 |
Rval | Gval | Bval | Color Number | Color |
---|---|---|---|---|
0 | 0 | 0 | 8 | Background (not drawn) |
0 | 0 | 1 | 9 | Dark Blue |
0 | 0 | 2 | 1 | Blue |
0 | 1 | 0 | 12 | Dark Green |
0 | 1 | 1 | 9 | Dark Blue |
0 | 1 | 2 | 1 | Blue |
0 | 2 | 0 | 12 | Dark Green |
0 | 2 | 1 | 13 | Turquoise |
0 | 2 | 2 | 5 | Cyan |
0 | 3 | 0 | 4 | Green |
0 | 3 | 1 | 13 | Turquoise |
0 | 3 | 2 | 5 | Cyan |
1 | 0 | 0 | 2 | Red |
1 | 0 | 1 | 11 | Purple |
1 | 0 | 2 | 3 | Magenta/Pink |
1 | 1 | 0 | 16 | Brown |
1 | 1 | 1 | 15 | Grey |
1 | 1 | 2 | 3 | Magenta/Pink |
1 | 2 | 0 | 16 | Brown |
1 | 2 | 1 | 15 | Grey |
1 | 2 | 2 | 15 | Grey |
1 | 3 | 0 | 6 | Yellow |
1 | 3 | 1 | 15 | Grey |
1 | 3 | 2 | 7 | Black |
2 | 0 | 0 | 2 | Red |
2 | 0 | 1 | 11 | Purple |
2 | 0 | 2 | 3 | Magenta/Pink |
2 | 1 | 0 | 10 | Orange |
2 | 1 | 1 | 11 | Purple |
2 | 1 | 2 | 3 | Magenta/Pink |
2 | 2 | 0 | 14 | Mustard |
2 | 2 | 1 | 15 | Grey |
2 | 2 | 2 | 7 | Black |
2 | 3 | 0 | 6 | Yellow |
2 | 3 | 1 | 7 | Black |
2 | 3 | 2 | 7 | Black |
By default, all three plotting backends will map the 16 GDF to see how this can be changed for the CalComp and Versatec backends.
If the -pens option was NOT specified, then the mapping from 16 colors to 8 pens is done using a 'MOD 8' function. That is, color 9 is mapped to pen 1, color 10 is mapped to pen 2, etc. The exception to this is color 16, which is mapped to pen 7.
If the -pens option is used, the mapping from 16 colors to 8 pens is done using the pentbl.fil file. See the descriptions of the pentbl.fil and the -pens option.
EXAMPLES:
An application that uses graPHIGS sets up a color table in order to be able to apply color to a given object. The colors are created by specifying an amount of red, green, and blue in the range of 0.0 to 1.0.
Application specifies Blue as RED=0.1, GREEN=0.3, BLUE=0.9 Application specifies Purple as RED=0.3, GREEN=0.27, BLUE=0.7
Note: The application color Blue is just a label that represents the three values of red, green, and blue. The same values of red, green, blue could also have been the application color Cyan.
graPHIGS then converts the amount of red, green, and blue into red, green, blue value numbers according to
EXAMPLE: From the previous example, the application colors Blue and Purple would be converted into:
------------------------------ | |Rval | Gval | Bval | ------------------------------ | Blue | 0 | 1 | 2 | | Purple| 0 | 1 | 2 | ------------------------------
Note: Two distinct application colors can be mapped to the same set of red (Rval), green (Gval), blue (Bval) values.
The red, green, blue values are then transformed into GDF file format
EXAMPLE: From the previous example, the application colors Blue and Purple would both be converted to color 1 (Blue) in the GDF file. Please note that a graPHIGS generated GDF file will only contain color numbers 1 - 16.
Once a GDF file has been created it can then be plotted. The graPHIGS plotting code is also capable of remapping colors with the -pens option. The setup of the colors on the plotter also plays an important part in the color mapping process.
EXAMPLE 1: The graPHIGS plotting code is invoked WITHOUT the -pens option. This is the same as invoking the plotter code with the -pens option and the default pentbl.fil file. Assume the plotter's pen colors are set up to be the same as the GDF color numbers.
---------------------------- ----------------------------- | pentbl.fil (default) | | Plotter | ---------------------------- ----------------------------- | 2 (color priority) | | | | Slot GDF Color Diameter| | Slot GDF Color Diameter | ---------------------------- ----------------------------- | 1 1 Blue .3 | | 1 1 Blue .3 | | 2 2 Red .3 | | 2 2 Red .3 | | 3 3 Magenta .3 | | 3 3 Magenta .3 | | 4 4 Green .3 | | 4 4 Green .3 | | 5 5 Cyan .3 | | 5 5 Cyan .3 | | 6 6 Yellow .3 | | 6 6 Yellow .3 | | 7 7 Black .3 | | 7 7 Black .3 | | 8 8 Background .3 | | 8 8 Background .3 | ---------------------------- ----------------------------
-------------------------------------------------------------------- | GDF file contains | Explanation | -------------------------------------------------------------------- | 1) a color 2 (Red) line .3mm | 1) pen 2 is selected because it | | thick | is the only red pen | | 2) a color 1 (Blue) line .9mm | 2) pen 1 is selected because it | | thick | is the only blue pen. line | | | will be blue and stroked | | | multiple times to achieve | | | line thickness if -nolw | | | option is not used. | | 3) a color 5 (Cyan) line .1mm | 3) pen 5 is selected because it | | thick | is the only cyan pen. Line | | | will be drawn .2mm too wide | | | because only .3mm pen | | | available | | 4) a color 9-16 line any | 4) colors 9-15 will be mapped to| | thickness | GDF colors 1-7 (pens 1-7) | | | respectively and color 16 | | | will be mapped to GDF color | | | 7 (pen 7) | | | NOTE: colors 9-16 will not | | | be remapped if -c16 or | | | -v16 option is used | --------------------------------------------------------------------
EXAMPLE 2: The graPHIGS plotting code is invoked WITHOUT the -pens option. This is the same as invoking the plotter code with the -pens option and the default pentbl.fil file. The plotter IS NOT set up according to GDF color defaults.
----------------------------- ----------------------------- | pentbl.fil (default) | | Plotter | ----------------------------- ----------------------------- | 2 (color priority) | | | | Slot GDF Color Diameter | | Slot GDF Color Diameter | ----------------------------- ----------------------------- | 1 1 Blue .3 | | 1 7 Black .1 | | 2 2 Red .3 | | 2 4 Green .3 | | 3 3 Magenta .3 | | 3 3 Magenta .3 | | 4 4 Green .3 | | 4 2 Red .3 | | 5 5 Cyan .3 | | 5 5 Cyan .3 | | 6 6 Yellow .3 | | 6 6 Yellow .3 | | 7 7 Black .3 | | 7 1 Blue .3 | | 8 8 Background .3 | | 8 8 Background .3 | ----------------------------- -----------------------------
--------------------------------------------------------------------- | GDF file contains | Explanation | --------------------------------------------------------------------- | 1) a color 2 (Red) line .3mm | 1) pen 2 is selected because | | thick | pen 2 is still red according | | | to the default color table. | | | line will be drawn green. | | 2) a color 1 (Blue) line .9mm | 2) pen 1 is selected because | | thick | pen 1 is still blue according | | | to the default color table. | | | line will be drawn black. | | | the line will have .2mm gaps | | | because the plotting code | | | thinks it has a .3mm pen and | | | moves the pens accordingly | | | to stroke the line to .9mm | | 3) a color 12 (Dark Green) line| 3) color 12 is mapped to color | | .3mm thick | 4 (green) pen 4 is selected | | | because pen 4 is still green | | | according to the default | | | color table. line will be | | | drawn red. | ---------------------------------------------------------------------
The -pens option causes the file pentbl.fil to be used for mapping GDF colors and line width values. If the number at the top of the file is a 1 then a pen will be selected whose pen tip diameter is most appropriate for the current line thickness. If more than one exist then the pens will be checked to see if one of them is the desired color. If none of them are the desired color, then the first pen of the correct size is picked. If the number at the top of the file is a 2 then the correct color will be picked. If more than 1 pen of the correct color exists, the pen best suited for the current line thickness will be chosen.
EXAMPLE 3: The graPHIGS plotting code is invoked WITH the -pens option. The plotter IS setup according to the pentbl.fil screen The pentbl.fil option specifies LINE THICKNESS search priority.
------------------------------- ----------------------------- | pentbl.fil | | Plotter | ------------------------------- ----------------------------- | 1 (line thickness priority) | | | | Slot GDF Color Diameter | | Slot GDF Color Diameter | ------------------------------- ----------------------------- | 1 7 Black .2 | | 1 7 Black .2 | | 2 7 Black .25 | | 2 7 Black .25 | | 3 7 Black .3 | | 3 7 Black .3 | | 4 4 Green .3 | | 4 4 Green .3 | | 5 5 Cyan .7 | | 5 5 Cyan .7 | | 6 6 Yellow .7 | | 6 6 Yellow .7 | | 7 7 Black .4 | | 7 7 Black .4 | | 8 8 Background .3 | | 8 8 Background .3 | ------------------------------- -----------------------------
-------------------------------------------------------------------- | GDF file contains | Explanation | -------------------------------------------------------------------- | 1) a color 7 (Black) line .3mm| 1) first all pens = .3mm are | | thick | selected (pens 3,4,8) then | | | these pens are searched for | | | the desired color. pen 3 is | | | selected. | | 2) a color 7 (Black) line .7mm| 2) first all pens = .7mm are | | thick | selected (pens 5,6) then | | | these pens are searched for | | | the desired color. since | | | neither pen is black the | | | first pen of the appropriate | | | size is selected (pen 5) | | | line will be drawn cyan. | | 3) a color 5 (Cyan) line .35mm| 3) since there are no .35mm pens | | thick | in the table the closest pen | | | size(s) without going over | | | are selected (pens 3,4,8) | | | these pens are searched for | | | desired color. Since none of | | | the pens are cyan, pen 3 is | | | selected. line is drawn black.| | 4) a color 4 (Green) line .1mm| 4) since there are no .1mm pens | | thick | in the table and all the pens | | | are > .1mm the closest pen(s) | | | is selected (pen 1). line is | | | drawn black. | --------------------------------------------------------------------
EXAMPLE 4: The graPHIGS plotting code is invoked WITH the -pens option. The graPHIGS plotting code is also invoked WITH the -nolw option. The plotter IS setup according to the pentbl.fil screen The pentbl.fil option specifies LINE THICKNESS search priority.
------------------------------ ----------------------------- | pentbl.fil | | Plotter | ------------------------------ ----------------------------- | 1 (line thickness priority)| | | | Slot GDF Color Diameter | | Slot GDF Color Diameter | ------------------------------ ----------------------------- | 1 7 Black .2 | | 1 7 Black .2 | | 2 7 Black .25 | | 2 7 Black .25 | | 3 7 Black .3 | | 3 7 Black .3 | | 4 4 Green .3 | | 4 4 Green .3 | | 5 5 Cyan .7 | | 5 5 Cyan .7 | | 6 6 Yellow .7 | | 6 6 Yellow .7 | | 7 7 Black .4 | | 7 7 Black .4 | | 8 8 Background .3 | | 8 8 Background .3 | ------------------------------ -----------------------------
--------------------------------------------------------------------- | GDF file contains | Explanation | --------------------------------------------------------------------- | 1) a color 7 (Black) line .23mm| 1) since there are no .23mm pens | | .23mm thick | in the pen table the closest | | | pen is selected (pen 2). | | | NOTE: the pen was selected | | | even though it was | | | larger than the line | | | to be drawn. the -nolw | | | option tells the | | | plotting code to pick | | | the pen closest in size | | | to the desired pen size | | | whether it is larger or | | | smaller. | ---------------------------------------------------------------------
EXAMPLE 5: The graPHIGS plotting code is invoked WITH the -pens option. The plotter IS setup according to the pentbl.fil screen The pentbl.fil option specifies COLOR search priority.
----------------------------- ----------------------------- | pentbl.fil | | Plotter | ----------------------------- ----------------------------- | 2 (Color search priority) | | | | Slot GDF Color Diameter | | Slot GDF Color Diameter | ----------------------------- ----------------------------- | 1 11 Purple .2 | | 1 11 Purple .2 | | 2 2 Red .25 | | 2 2 Red .25 | | 3 10 Orange .3 | | 3 10 Orange .3 | | 4 4 Green .3 | | 4 4 Green .3 | | 5 5 Cyan .7 | | 5 5 Cyan .7 | | 6 7 Black .8 | | 6 7 Black .8 | | 7 7 Black .4 | | 7 7 Black .4 | | 8 8 Background .3 | | 8 8 Background .3 | ----------------------------- -----------------------------
------------------------------------------------------------------- | GDF file contains | Explanation | ------------------------------------------------------------------- | 1) a color 11 (Purple) line | 1) pen 1 is selected because it | | .8mm thick | is the only purple pen even | | | though pen 6 would draw the | | | line faster | | 2) a color 7 (Black) line .9mm| 2) first all color 7 (black) | | thick | pens are selected (pens 6,7) | | | these pens are then check | | | to see which would fill the | | | line faster. pen 6 is | | | selected. | | 3) a color 14 (Mustard) line | 3) first color 14 is searched | | .3mm thick | for in the pen table. since | | | it is not found it is mapped | | | to color 6. Since color 6 is | | | also not in the pen table | | | pen 1 is used by default. | | | line is drawn purple. | -------------------------------------------------------------------
Note:
In SUMMARY:
There are many levels in which colors can be mapped. Mapping can take place in just one level or in multiple levels.
OPTION 1 (-pens used, priority set to 1 (line thickness))
IF the -nolw option was specified THEN search the pen table for the pen(s) that are closest to the line width to be drawn. there may be multiple pens equally close. the pen(s) selected may be either equal, greater than, or less than the line width to be drawn. ELSE search the pen table for the pen(s) that are closest to the line width to be drawn. there may be multiple pens equally close. the pen(s) selected may be either less than or equal to the line width to be drawn if possible. IF all pens in the pen table are greater than desired width THEN select the pen closest to the line width to be drawn. IF multiple pens were selected THEN from the pens selected as having the desired width search for a pen that also has the desired color. there may be multiple pens of the desired color. the first one will be selected. IF the desired color can not be found THEN IF (the -c16 option was not specified) and (the -v16 option was not specified) and (the desired color is a GDF color in the range of 9 to 16) THEN map colors 9-15 to colors 1-7 respectively and map color 16 to color 7. from the pens selected as having the desired width search for a pen that also has the remapped color. there may be multiple pens of the remapped color. the first one will be selected. IF the remapped color can not be found THEN from the pens selected as having the desired width select the first pen. ELSE from the pens selected as having the desired width select the first pen.
OPTION 2 (-pens not used, OR -pens used with priority set to 2 (color))
Note: if -pens not used, the pen table refers to the default table.
search the pen table for the pen(s) that are the desired color. multiple pens can be selected. IF the desired color can not be found THEN IF (the -c16 option was not specified) and (the -v16 option was not specified) and (the desired color is a GDF color in the range of 9 to 16) THEN map colors 9-15 to colors 1-7 respectively and map color 16 to color 7. search the pen table for the pen(s) that are the remapped color. multiple pens can be selected. IF the remapped color can not be found THEN select the first pen in the pen table. ELSE select the first pen in the pen table. IF multiple pens were selected THEN IF the -nolw option was specified THEN search the pens that have the desired color for the pen closest to the line width to be drawn. there may be multiple pens equally close. the first one will be selected. the pen selected may be either equal, greater than, or less than the line width to be drawn. ELSE search the pens that have the desired color for a pen closest to the line width to be drawn. there may be multiple pens equally close. the first one will be selected. the pen selected will be less than or equal to the line width to be drawn if possible. IF all pens in the pen table are greater than desired width THE select the pen closest to the line width to be drawn.
When plotting to a CalComp or Versatec plotter using the cpsC1 or cpsV1 programs, the number of colors supported can be increased to 16 from the default 8 colors by specifying either -c16 as a parameter to the cpsC1 program or -v16 for the cpsV1 program. These parameters will work in conjunction with -pens and the pentbl.fil , but -pens is not required for their use. If the pentbl.fil is used with these parameters, then the number of records in the pentbl.fil must be increased to 17. The first 9 records will remain as described above, and records 10 through 17 must be added for pen numbers 9 through 16, following the same format as records 2 through 9. For example:
1 1 1 0.3 2 2 0.3 3 3 0.3 4 4 0.3 5 5 0.3 6 6 0.3 7 7 0.3 8 8 0.3 9 9 0.3 10 10 0.3 11 11 0.3 12 12 0.3 13 13 0.3 14 14 0.3 15 15 0.3 16 16 0.3Refer to the CalComp and Versatec README files for more information on extended color support.
Note: When using the cpsC1 program for CalComp plotters, the pentbl.fil must be used even if -pens was not passed to the backend. If the pentbl.fil does not exist, plotting will take place using a Calcomp default color table with all pens set to black.
There are some differences between what you see on your display and what is plotted:
The graPHIGS API uses underpainting and overpainting to achieve certain results. It does this by first drawing an object and then drawing over it. On a display, the second color simply overlays the first. In addition, the background color is often used to block out portions of the underpainted segment. This graphics feature of blocking out a section of a previously drawn object with another object or graphic element is called reverse clipping or shieldingscreen When you use a plotter, both objects are drawn.
Some of the patterns plotted may not match those used by the graPHIGS APIscreen In addition, user-defined patterns are mapped to the sixteen supplied patterns using MOD 16 results.
Unless -ispi or -es is specified, plots fill the entire page, keeping the correct aspect ratio. This means that a circle is always a circle, and a square is always a square.
Plotters only support those characters with ASCII values less then 128.
Refer to the IBM AIX Personal graPHIGS API Programming Interface/6000: Installation and Problem Diagnosis , for information on using the ISPI interface.
The following parameters are ignored when -ispi is used: -af, -noin, -rot, -nopl, -es, -esx and -slowscreen when using -ispiscreen
Only the SOLID line type is supported through ISPI.
Character shear and direction are not supported. Character spacing and size also differ. Geometric text should be used for ISPI.
Refer to the CalComp and Versatec README files in the /usr/lpd directory for more information on plotting to CalComp and Versatec plotters.
If problems are encountered using any of the plotting backends, refer to the log file created for the plot for any messages which may help determine the cause of the problem.
If it becomes necessary to contact IBM support for resolution, be prepared to forward the following data:
Forward all items which are available. If it is possible to produce a correct plot as well, forward all applicable items from this list for the correct plot, along with an explanation of what was done differently.
Plotting a file on AIX using AIX PS/2 Personal graPHIGS is essentially the same as plotting on an RS/6000 using the graPHIGS API with the following exceptions:
print -gdffname.gdf -nolw -esRefer to the AIX PS/2 Personal graPHIGS API Programming Interface: Installation and Problem Diagnosis for further information on setting up print queues on AIX PS/2.
GDDM/graPHIGS ships a GDF conversion utility which functions in much the same way as the plotting modules for the RS/6000 and AIX PS/2.
For information on this utility please refer to the IBM Color Plotter Support for GDDM GDF (5668-860), Program Description/Operations Manual screen To enable the supported options parameters, you may edit the CONVERT EXEC or CONVERT CLIST provided.
To plot a file, the following syntax can be used:
/usr/lpd/cgm2hp2 -option filename.cgm ^ | |------|
where:
Note:
- The symbol & may be added after the CGM filename to plot in the background:
/usr/lpd/cgm2hp2 -option filename.cgm & ^ | |------|Examples:
- To plot the file file.cgm to a plotter attached to the tty0 port:
/usr/lpd/cgm2hp2 -f /dev/tty0 file.cgm- To plot the same file in the background, and to rotate the plot 90 degrees:
/usr/lpd/cgm2hp2 -tty0 -rot tmp0001.cgm &- To convert the file file.cgm to GL2 data:
/usr/lpd/cgm2hp2 -f plot.gl2 file.cgm
A plot can be scheduled through smit or by using the enq command.
enq -P queuename -o option filename.cgm ^ | |--------|
where:
The following is a list of optional parameters which can be passed to the cgm2hp2 plot module.
K,V K,V,K,V K,V,K,V,K,V
Possible values for K V are given in the "LA, Line Attributes" section of The HP GL/2 and HP RTL Reference Guide (available from Addison-Wesley, ISBN 0-201-63325-6).
Boolean combination of 1-4 are allowed ( i.e. 3=Pen and endpoint sort)
It is assumed that the plotter buffers are large enough to render polygons and annotation text generated by the graPHIGS application.
The default font of the output device is used to render annotation text.
Unsupported CGM orders are skipped and a warning is written to standard error.
Cell Array, produced by the use of the graPHIGS pixel primitives (GPPXL2, GPPXL3) is not supported.
For raster plotters the following options are recommended:
For pen plotters the following options are recommended:
In order to print to a device attached to the parallel port, you need to first generate a .gl2 file using the methodology above. (The AIX queueing system protocols do not support directly writing to the parallel port.) The .gl2 file can then be printed using lpr or enqscreen printer is not already supported as a virtual printer, you need to define it as type opp (other parallel printer).
HPGL2 color raster devices generally support user defined color tables with up to 255 entries. The graPHIGS CGM includes a 255 entry color table. By default, this entire color table is downloaded to the output device, so that the printed colors will match the colors displayed by the graPHIGS application.
Pen plotters are limited to the colors of pens inserted in their carousels. By default cgm2hp2 will attempt to set the plotter pen to match the entry number of the CGM color table. The default CGM color table follows:
0. 0, 0, 0 Black 1. 255, 255, 255 White 2. 255, 0, 0 Red 3. 0, 255, 0 Green 4. 0, 0, 255 Blue 5. 255, 255, 0 Yellow 6. 255, 0, 255 Magenta 7. 0, 255, 255 Cyan 8. 255, 255, 255 White screen screen screen 255. 255, 255, 255 White
Note that black, (background) is color table entry 0. On pen plotters, pen 0 corresponds to draw with no pen, or draw in background. If color table entry 0 is used and it represents a color other than background, you need to map it to another pen using a pen table file. See the description below.
The format is the same as the pentable.fil for the cpsX1 utilities described in However, the number of entries may range between 1 and 255. If the number of pens exceeds the number of slots available on the plotter, the plotter will perform modular division to pick the pen number. Therefore, if the CGM color table is larger than the number pens available multiple pens can be mapped to a single slot by repeating as follows:
1 1 1.3 2 2 0.3 3 4 0.3 4 3 1.3 5 6 1.3 6 6 0.3 7 7 1.3 8 8 1.3 1 9 1.3 2 2 0.3 3 4 0.3 4 3 1.3 5 6 1.3 6 6 0.3 7 7 1.3 8 10 1.3
This pentbl will map colors 1,9 to pen 1 and colors 8 and 10 to pen 8. If pen mapping by color is selected and there is no entry for a color table entry, the pen number defaults to pen 0 (background color).
To map the default CGM colors to the default gdf colors, use the following color table.
CGM Table GDF Color Entry Number R G B Name --------- ----------- ---- ---- ---- -------- 1 4 0.3 4 1 0, 0 255 Blue 2 2 0.3 2 2 255 0 0 Red 3 6 0.3 6 3 255 0 255 Magenta 4 3 0.3 3 4 0 255 0 Green 5 7 0.3 7 5 0 255 255 Cyan 6 5 0.3 5 6 255 255 0 Yellow 7 7 0.3 0 7 0 0 0 Black 8 8 0.3 1 8 255 255 255 White
Additionally, if pens of multiple widths are used, you may want to to select pens based on penwidth. The pentable can also accomplish this. Selecting pens based on penwidth may may reduce or eliminate multi-stroking. If the penwidth exactly matchs the width of the line being drawn multi-stroking can be completely eliminated using the -l option. Otherwise, the multi-stroking can be reduced by using the pentable file to pick the closest pen. Be sure to set the plotters front panel to accurately reflect the actual pen width in use. See Appendix C in The graPHIGS Programming Interface: Technical Reference for more information on selecting pens by width.