home *** CD-ROM | disk | FTP | other *** search
- HPGLVIEW - A Screen Previewer for HPGL Plot files
-
- Copyright (C) 1991 Giovanni S. Moretti
-
- HPGLVIEW will display the contents of an HPGL file, normally intended for a
- plotter, on the PC's screen. The screen is treated as an A3 or A4 page and
- aspect ratio effects are ignored to maximise the available resolution.
-
- Its designed to show you what the plot looks like on the page or what's in
- an HPGL file that you've just found, not be an absolute mimic of a plot.
- If you need absolute precision, plot it.
-
-
- LICENCING
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 1, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- -----------------------------------------------------------------------------
- Giovanni Moretti | EMAIL: G.Moretti@massey.ac.nz
- Computer Centre, Massey University |
- Palmerston North, New Zealand |
- -----------------------------------------------------------------------------
-
-
- RUNNING THE PROGRAM
-
- HPGLVIEW <filename> [/A3 | /A4 ] [/G graphics-driver graphics-mode ] [/D]
-
- Defaults: A4 page, Autoselect graphics driver, Ignore unknown HPGL commands
-
- Pressing the ESC key will abort any plot in progress.
-
-
- OPTIONS
-
- /A4 (default) - display the plot as it would appear on an A4 page
- /A3 - display the plot as it would appear on an A3 page
- /H /? ? - Display a brief help page and licencing conditions
- /G driver# mode# - Use the indicated Graphics Driver and mode
- Normally autodetection will be used but if you need it
- here it is (eg EGA card with CGA monitor use "/G 1 0" )
- /D - Display unknown HPGL commands at end of plot.
-
-
- GRAPHICS DRIVERS AND (VALID MODES) - Try mode 0 if unsure.
- ----------------------------------
- CGA : 1(0-4) CGA : 2(0-5) EGA: 3(0-1) EGA64: 4(0-1) EGAmono: 5(3)
- IBM8514: 6(0) HercMono: 7(0) ATT400: 8(0-5) VGA: 9(0-2) PC3270: 10(0)
-
-
- RECOGNISED HPGL COMMANDS AND ACTION
- -----------------------------------
-
- CI radius; PLOT a CIRCLE centred at current location.
-
-
- DF; Default - Reset various parameters to a known state. Turns
- scaling and symbol mode to OFF, text direction is horizontal.
-
-
- DI run,rise; Controls direction of displayed text. The BGI Graphics Toolbox
- only supports horizontal and vertical text.
- Also text can't be displayed upside down so it will be in
- approximately the right place but it may face the wrong way.
-
-
- DR run,rise; Direction - Relative; See DI
-
-
- IN; Initialise - Beeps and waits for you to press a key.
- Raises the Pen and resets the scaling points P1 and P2.
- Used to pause between parts of concatenated plot files.
-
-
- IP [ P1x,P2x,P1y,P2y ] ; - DEFINE/RESET SCALING POINTS
- Define the scaling points to be used by the SCALE instruction.
- If there are no arguments, use the default scaling points are
- use which are just a little inside the plot boundaries for the
- chosen page size.
-
-
- LB String^C Display the text "String". Text size and direction will
- be that defined by previous SI/SR and DI/DR commands.
- Text is terminated with a CTRL/C.
-
-
- PA x,y; PLOT ABSOLUTE Move to X,Y - drawing if Pen is down.
- PD [x,y]; PEN DOWN Pen down [ and move to X,Y - ie. DRAW ]
- PU [x,y]; PEN UP Pen up [ and move to X,Y - ie. MOVE ]
- PR x,y; PLOT RELATIVE Move treating X,Y as an Offset from
- current position, drawing if pen is down.
-
- X and Y may be in absolute plotter coordinates or in
- scaled units, depending on whether the SCALE command
- (SC) has been encountered.
-
-
- SC [ Xmin,Xmax,Ymin,Ymax ] ; - ENABLE / RESET COORDINATE SCALING
-
- All succeeding coordinates will be within the range Xmin - Xmax
- & Ymin - Ymax. Scales these values to be displayed within the
- rectangle defined by the IP command or the default IP
- co-ordinates.
-
-
- SI [width,height]; DEFINE TEXT SIZE [ or reset to the default size ]
- The size of all following text is to be
- WIDTH and HEIGHT centimetres.
-
-
- SM character; DEFINE THE SYMBOL CHARACTER. At the conclusion of
- any of the PA, PR, PD commands, plot the symbol
- "character".
-
-
- SP pen-no; SELECT PEN. Changes the plot colour if enough colours
- available.
-
-
- SR width,height; TEXT SIZE Relative [ or reset to default ]
- Text plot size expressed as a percentage of the scaling
- points.
- Text width is width% of P2x - P1x and
- Text Height is height% of P2y-P1y
-
-
- VS speed; VELOCITY SET (of pen) - parsed but ignored.
-
-
- DEFAULT SCALING POINTS in PLOTTER UNITS (0.025mm)
-
- A4 A3
- ----- ------
- P2x 10430 15580
- P1x 430 380
- P2y 7400 10430
- P1y 200 430
-
-
- PHYSICAL LIMITS
- A4 A3
- ----- -----
- X_plot_width_mm 270 399
- Y_plot_height_mm 190 271
- hard_clip_X 10870 15970 plotter units (0.025 mm)
- hard_clip_Y 7600 10870 plotter units (0.025 mm)
-
-
-
- AREAS THAT COULD BE IMPROVED
-
- COMMAND PARSER
-
- Currently the arguments handled are of the form of a two letter command
- followed by zero or more arguments, separated by commas/spaces and ending
- with a semicolon; (eg PD10,30; whereas the HPGL specification indicates
- that arbitrary pairs of co-ordinates can follow some commands. This
- normally doesn't cause any problems as most packages use form
- "PD10,20;PD30,40;" rather than "PD10,20,30,40;"
-
-
- EXTRA COMMANDS
-
- I've implemented only those commands that seem to be most used. There are
- LOTS of others, but for me, this subset is sufficient.
-
-
- RANGE of ARGUMENTS
-
- I've used integers for the arguments whereas LONGS should really be used.
- None of my test plots exceeded the integer range but "Officially ..."
- Fix: recompile changing INTEGERS to LONG - not done as it's probably slower.
-
-
- TO RECOMPILE "HPGLVIEW" WITH INTEGRAL GRAPHICS DRIVERS AND FONTS
-
- Compile BGILINK as supplied with your version of Turbo Pascal (*), as detailed
- in the file BGILINK.PAS. This will generate the necessary DRIVER.TPU and
- .OBJ files. This need only every be done once, in order to convert the
- .BGI files to .OBJ files. Copy the files DRIVER.TPU and LITT.OBJ to the
- same directory as HPGLVIEW.PAS and SMALFONT.PAS. Recompile HPGLVIEW.PAS,
- it will recompile SMALFONT.PAS (which has the SMALL scalable font)
- automatically and link everything together into one .EXE file.
-
-
- Please send me a copy of any major hacks/improvements so I can
- coordinate any new releases.
-
-
- (*) Turbo Pascal is a trademark of Borland International, Scotts Valley
- California.
-
-
-
-
-
-
-
-
-