home *** CD-ROM | disk | FTP | other *** search
- SHOWHPGL A viewing program for HP-GL and HP-GL/2 plotting programs.
-
-
-
- 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 45 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.
-
- 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] [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.
-
-
- 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 .
-
- NOTE: 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, wish
- to retain a listing of the output, or can not tolerate this text in
- the display, redirect any generated output to a file.
-
- Note also 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
-
- 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
- autogrph.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)
-
- 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)
- dvtest1.dpf DV: variable text path
- 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
- label4.dpf LB, LO: labels and label origins
- prtest.dpf PR: relative plotting
- ratest.dpf RA: filled rectangle, absolute (outline, only: no fill)
- rrtest.dpf RR: filled rectangle, relative (outline, only: no fill)
- rttest.dpf RT: 3-point arc, relative
- sltest.dpf SL: character slant
- smtest.dpf SM: symbol mode
- srtest.dpf SR: relative text size
- test1.dpf AR,IP,SC,PR: non-specific test program
- test2.dpf IP,SL,AA,CI: 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. There are
- 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
-
- 1. This program and the component files are supplied on an as-is
- basis. They have been thoroughly tested, but may still contain
- unknown bugs.
-
- 2. The source code and object code is copyright 1991 or as
- otherwise noted by Robert C. Becker.
-
- 3. The executable program may be used for any purpose except
- commercial resale. It is otherwise not restricted in any way.
- Licenses for commercial resale may be obtained from the author.
-
- 4. The source code may be modified for personal use. Modified
- source code must retain the original copyright notice and may
- not be re-distributed. Modifications may be included in the
- form of "difference files" which are included as additional
- files to this distribution.
-
- 5. Portions of the source code may be extracted for use in other
- programs provided the copyright notice remains in the source code,
- and those programs do not materially replicate the function of the
- program for which this code was generated (that is, you may not
- use this source code as a basis for a commercial HP-GL or HP-GL/2
- file viewer).
-
- 6. Works which contain portions of the source code provided herein
- may be freely distributed. No license is required for such
- distributions, but the original copyright notice must be retained
- within the salient portions of the code.
-
- 7. This package may be re-distributed for a fee covering the
- reproduction costs. The files listed under Distribution
- Package must be distributed without modification and the
- complete set of files listed must be included.
-
- 8. The usage of the word "portions" indicates 1) less than 50% of the
- source code supplied herein; 2) that the content of a program which
- is the beneficiary of this source code may not be composed of more
- than 35% of source code taken from this distribution.
-
- Author's Note: In case anyone thinks this is a particularly onerous set of
- conditions to follow, 1) remember, this is a free program for you to use;
- 2) remember the affair of the "Foley Extra DOS" utilities in which all
- manner of accusations were made regarding ownership, authorship, and
- plagerism; 3) if you really want to use this as a basis for a commercial
- tool, contact me.
-
-
- Bug Reports:
-
- Please report any bugs to
-
- becker@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 36 Full, 9 partial, 22 NOP, and 30 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.
- 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
- 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 N/A
- 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 Partial left & bottom parameters for isotropic scaling not implimented
- 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
- 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 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.
-
-