home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Der Mediaplex Sampler - Die 6 von Plex
/
6_v_plex.zip
/
6_v_plex
/
DISK2
/
MULTI_04
/
SHOWGL15.ZIP
/
SHOWHPGL.DOC
< prev
next >
Wrap
Text File
|
1991-12-28
|
14KB
|
382 lines
SHOWHPGL A viewing program for HP-GL and HP-GL/2 plotting programs.
Revision 1.5
Introduction
This program is designed to preview HP-GL and HP-GL/2 plotting programs
on the console screen of an IBM PC or compatible computer. It
impliments 46 of 97 HP-GL or HP-GL/2 instruction. Of the 97
instruction, 22 either have no meaning for this type of program or
are otherwise unrelated to drawing. Four instructions are included to
provide backward compatibility with the HP9872 plotter. These instructions
are interpreted as NOP's.
It is written in Microsoft C, version 6.0. It requires MS-DOS
version 3.0 or above to run. This program is meant to be used as a
preview tools for HP-GL files. It is as accurate as it could be made
with the limited information and resources available at the time it
was written. Known bugs or deficiencies are listed after the
instruction set summary.
Usage
SHOWHPGL -[video][paper][plotter][debug] [filename]
where
filename optional filename for HP-GL source file. If a
filename is not supplied, standard input is
assumed.
video option to force usage of a particular video
mode. Values are: c, e, v, for CGA, EGA, or
VGA.
'c' will force CGA 640 x 200 monochrome mode,
'e' will force EGA 640 x 350 16 color mode,
'v' will force VGA 640 x 480 16 color mode.
Default mode is autodetect and select
highest resolutions standard mode available.
No SVGA modes are supported.
paper One of the following standard paper sizes:
A, B, C, D, E, or A4, A3, A2, A1, A0 .
Default size is A. Case is important!!
A0 is a paper size option: a0 is unknown.
plotter Default emulation is HP 7470/7475 plotter.
'dp' will select DraftPro emulation.
The HP 7470/7475 have the plotter units coordinate
origin in the lower left corner. The DraftPro
uses the center of the page as the origin.
debug Default is to silently pass errors. -db will
turn on error output to stdout.
The user may also set the environment variable HP-GL to a default set
of switches, i.e.,
set hpgl=dpA3
specifies default options of DraftPro mode and A3 size paper.
If command line switches are present, the environment settings are
ignored. Multiple paper size selections will cause the program to
abort. Multiple video mode selections will default to the highest
resolution autodetected mode.
The switch character is defined as '-'. It is hard coded into the
program. Directory path names may include either or both '\' and '/'
directory separators. This program has been tested under MS-DOS 3.20
and MS-DOS 5.0 .
All video graphics functions draw using the video BIOS. No direct
screen I/O is used. Additional BIOS supported graphics modes may be
supported by defining the appropriate structures in graphix.h and the
macros in graph.h and making appropriate changes to the mode lists in
autogrph.c and showhpgl.c .
When the debugging flag is turned on, this program generates diagnostic
output text strings when illegal or unsupported instructions are
encountered. THESE STRINGS APPEAR IN THE GRAPHICS DISPLAY AND MAY
INTERFERE WITH THE DRAWING IF SUFFICIENT ERRORS OCCUR. If you expect
large numbers of errors and wish to retain a listing of the output,
redirect any generated output to a file.
Note that this program DOES NOT restore the video mode which was
in use prior to calling this program. Although the EGA and VGA
display systems are capable of better than 80 columns and 25 rows on
the screen, they do not appear as supported IBM BIOS video modes.
Determination of nonstandard video mode parameters was beyond the
scope of this program. If you want to restore a recognized video mode
at the end of program execution, add the following code to showhpgl.c just
before the end of main ():
twait (infile, 50);
graphics_off ();
This will introduce a 50 second delay before restoring the video mode.
If the video mode was not a BIOS standard video mode, graphics_off ()
may not be able to restore it properly.
Compilation
The entire package is compiled as follows:
cl [-qc] showhpgl.c hpgl1.c hpgl2.c getargs.c autogrph.c graphix.lib
Note that at least hpgl1.c and hpgl2.c must be compiled with the default
optimization (i.e., no -qc option). Failure to do so will result in
a _TEXT segment which exceeds 64K and the link will fail. graphix.lib
is compiled in the small memory model.
Because graphix.lib internally uses Microsoft interrupt calling
functions, it is unlikely that this can be ported to Borland C without
re-writing the interrupt calls in graphix.lib
Distribution Package
The distribution package includes the following:
showhpgl.doc this document
showhpgl.exe the executable program file
showhpgl.c main program
hpgl1.c additional functions
hpgl2.c additional functions
hpgl.h header file for showhpgl.c, hpgl1.c hpgl2.c
getargs.c command line options and arguments
autogr.c video graphix adapter detection
labels.c labeling font for showhpgl (part of graphix.lib)
graphix.lib graphics functions library
graphix.h header file for main program (showhpgl.c)
graph.h header file for additional modules (hpgl1.c,
hpgl2.c)
license.doc license agreement
HP-GL test programs
attest.dpf AT: 3-point arc, absolute
cptest.dpf CP: character plot
dvtest.dpf DV: variable text path (fails this test)
ea_ertst.dpf EA, ER: edge rectangle absolute and relative
estest.dpf ES: extra inter-character spacing
ewtest.dpf EW: outline wedge
iwtest.dpf IW: soft-clip window
labels.dpf LB, LO, SL, SR, DV: labels and label origins, char.
slant, char. size (relative), direction vertical.
petest.dpf PE: polyline encoded
prtest.dpf PR: relative plotting
ra_rrtst.dpf RA, RR: filled rectangle, absolute (no solid fills)
rttest.dpf RT: 3-point arc, relative
smtest.dpf SM: symbol mode
test1.dpf AA, AR, CI, IP, SC, SL, PR: non-specific test program
test3.dpf LB,LO,TL,XT,YT: test labels, label origins, x-,
& y-ticks
fwdaltbx.dpf drawing to demonstrate the -dp drawing option.
Use -C or larger for paper size.
Most of these test programs are taken from "The HP-GL/2 Reference Guide"
and, as such are copyright 1990 by Hewlett-Packard. This book provides
illustrations of what the output of most of these programs should look
like accompanying the description of the instruction.
The file labels.c is included for those who wish to modify the font used
for labeling. This font is incorporated into graphix.lib. To modify the
font, make the required changes to labels.c, compile it to a ".obj" file,
and update the library using "LIB -+labels;" (Microsoft library manager).
You may then re-link the remaining files to create a new program which
uses the new fonts.
Licensing
Please refer to the license agreement in license.doc. Use of this
software and the enclosed source code is limited to the terms of the
license.
Bug Reports:
Please report any bugs to
becker@lennon.src.honeywell.com (Robert Becker).
If you prefer, mail them to me at
Robert Becker
15836 Quebec Circle
Eden Prairie, MN 55346
Instructions Status
The following is a list of instructions and the level of implimentation
in showhpgl.exe of HP-GL/2 instructions. Note that not all instructions
are HP-GL/2 instructions. Those with notations in the source column
indicate where this instruction was found. Status indicates the level of
implimentation of the instruction. There are four levels of implimentation:
Full: instruction is fully functional as per HP-GL/2
Partial: instruction implimentation is incomplete
NOP: no action or action not meaningful for this application
N/A: not available: instruction was not implimented.
There are 38 Full, 8 partial, 26 NOP, and 29 N/A instructions. Of the N/A
instructions, 11 are related to character set or font selection. Of the
NOP instructions, 12 are related to output or digitizing a point and 4 are
for backward compatibility with earlier products. All output instruction
that have no meaning in this application and are implimented as NOP
instructions. No dual context mode instructions (HP-GL & PCL) have been
inplimented.
Command Description Status source Comments
AA arc absolute Full
AC anchor corner Full
AD alternate font definition N/A
AF advance full page NOP compatibility w/HP9872
AH advance half-page NOP compatibility w/HP9872
AR arc relative Full
AT 3 point arc absolute Full
BP begin plot Partial waits TWAIT seconds before clearing plot from screen
CA designate alternate char. set N/A 7470
CF char. fill mode N/A
CI circle Full
CP character plot Full
CS designate std. character set N/A
CR color range N/A
CT chord tolerance Full
DC digitizer clear NOP
DF default Full
DI absolute label direction Full
DL download character N/A
DP digitize point NOP
DR relative label direction Full
DS designate char. set into slot N/A DraftPro
DT Define label terminator Full
DV Define variable text path Partial No line feed reversal
EA edge rectangle absolute Full
EC enable cutter NOP
EP edge polygon N/A
ER edge rectangle relative Full
ES extra space Full
ESC escape code instructions Partial No PCL mode switch commands
EW edge wedge Full
FI primary font selection by ID N/A
FN secondary font selection by ID N/A
FP fill polygon N/A
FR frame advance N/A
FT fill type Partial Only hatched and cross-hatched fills
GM graphics memory NOP DraftPro
IM input mask NOP 7470
IN initialize Full Since there is no 'front panel', IN1 is same as IN
IP input P1 & P2 Full
IR input relative P1 & P2 Full
IW input window Full
LA line attributes NOP No wide lines available
LB label Full
LO label origin Full
LT line type Partial No adaptive line patterns
MC merge control N/A
MG message to panel NOP
MT media type NOP
NP number of pens NOP
NR not ready Full
OA output pen position & status NOP 7470
OC output commanded positon & sts NOP 7470
OD output digitized point & sts NOP
OE output error NOP
OH output hard-clip limits NOP
OI output identification NOP
OO output options NOP 7470
OP output P1 & P2 NOP
OS output status NOP
OW output window NOP 7470
PA plot absolute Full
PC assign pen colors N/A
PD pen down Full
PE polyline encoded Full
PG page advance Modified Waits 6 seconds before clearing screen
PM polygon mode N/A
PR plot relative Full
PS plot size Full
PU pen up Full
PW pen width N/A
QL quality level NOP
RA fill rectangle absolute Partial only hatch & cross-hatch fills
RF raster fill definition N/A
RO rotate coordinate system N/A
RP replot N/A
RR fill rectangle relative Partial only hatch & cross-hatch fills
RT relative arc 3-point Full
SA select alternate font N/A
SB scalable or bitmap font N/A
SC scale plot Full
SD standard font definition N/A
SI absolute char. size Full
SL char. slant Full
SM symbol mode Full
SP select pen Full
SR relative char. size Full
SS select standard char. set N/A
ST sort vectors NOP
SV screened vectors N/A
TL tick length Full 7470
TD transparent data N/A
TR transparency mode N/A
UC user defined character N/A
UL user defined line pattern N/A
VA adaptive pen velocity NOP compatibility w/HP9872
VN normal pen velocity NOP compatibility w/HP9872
VS velocity select NOP
WG fill wedge Partial Outline of wedge, only (no filling available)
WU pen width unit selection N/A
XT x-tick Full 7470
YT y-tick Full 7470
Notes:
BP instruction is checked for syntax. BP will wait PG_DELAY seconds
before clearing the screen if the screen was plotted on. If the
screen was not plotted on, the plotter is initialized. In either
case, the plotter is initialized.
PG instruction generates a wait of PG_DELAY seconds before clearing
the screen.
PG_DELAY is defined in hpgl.h as 6 seconds.
HP-GL and HP-GL/2 distinguish between <cr> and <lf> for
positioning on labels. The C-language, being based in UNIX,
assumes the <lf> is the newline character and <cr> has no
meaning. This assumption is also present in this program and
some test case labeling and character plotting tests will fail
because of this. The test program dvtest.dpf fails because of
this. The display should look something like:
D A ABC
E B DEF
F C GHI
G
H
I
Several of the HP-GL/2 specifications are incomplete. For
example, when one is drawing a wedge with symbol mode on,
placement of the symbol is unspecified. Similarly, when TD
(transparent data) mode is on, the font used to display the
control characters is not specified. Error handling is not
always specified. For example, when CT is used to specify
deviation distance on circles and arcs, this reference does
not specify what action to take if a distance tolerance is
not specified for subsequent circles and arcs. The DraftPro
manual specifies that the default shall be 5 degrees in this
case. The Addison-Wesley book does not specify what action
to take.
For hatch and cross-hatch fills, it is not clearly specified
for the case of user-unit defined hatch x-spacing if the scale
in the y-direction should affect the spacing of the hatch. In this
implimentation, it was decided that the hatch spacing displayed on
the screen should be invariant with the rotation angle.
HP-GL, HP-GL/2, HP, Hewlett-Packard, and DraftPro are registered
trademarks of the Hewlett-Packard company.
PC, CGA, EGA, VGA are or may be registered trademarks of the IBM
company.
UNIX is a trademark of AT&T.
Reference:
"The HP-GL/2 Reference Guide", Addison-Wesley Publishing Company.