HdB1

Other

Fortran) programs containing calls to Calcomp plotroutines can be
   forced to produce AVS GEOM code by linking them to the necessary libraries,
   for example as is implemented by the following script:
	echo $1 ; fc -fi $1.f -o $1 /usr/avs/lib/libcalcomp.a \
	/usr/avs/lib/libflow_f.a /usr/avs/lib/libgeom.a /usr/avs/lib/libutil.a
6. Plotfiles will be recognized by AVS as GEOM files, but only if their names
   end with the suffix ".geom". A programming example:
	program MAIN
	open(1,file='myplot.geom')
	call plots(0,0,1) ! Parameters: dummy, dummy, logical unit number
*	Make your drawings here ...
	call lasplo ! Don't forget to write the AVS GEOM plotfile to disk
	end
7. In order to view the contents of "myplot.geom", type:
	avs &
   Click with left mouse button:  "Geometry Viewer", "Read Object". Then select
   proper directory with "New Dir" and (.geom) plotfile with "New File".
   Clicking at "Normalize" will blow up the picture, so that it will fit into
   the whole graphics window.
   Oh well, I suppose this is all well known ...
Please remember: anything FREE comes without garantee!
-
* Han de Bruijn; Applications@Convex | "A little bit of Physics * No
* TUD Computing Centre; P.O. Box 354 |  would be NO idleness in * Oil
* 2600 AJ  Delft; The Netherlands.   |  Mathematics" (HdB).     * for
* E-mail: Han.deBruijn@RC.TUDelft.NL | Fax: +31 15 78 37 87 --- * Blood
AVS - Calcomp interface
=======================
This product was developed for C3820, ConvexOS/10, Fortran Compiler 6.0.
_Not_ included in this version of the basic Calcomp routines are:
AXIS     COPYRIGHT 1968 CALIFORNIA COMPUTER PRODUCTS         V048
LINE     COPYRIGHT 1968 CALIFORNIA COMPUTER PRODUCTS         V048
NUMBER   COPYRIGHT 1968 CALIFORNIA COMPUTER PRODUCTS         V048
SCALE    COPYRIGHT 1968 CALIFORNIA COMPUTER PRODUCTS         V048
They should be supplied by your local Calcomp-routines installation.
A so-called GEOM driver for the Application Visualization System (AVS) has 
been built into the classical RC-plotroutines (Calcomp), as an AVS course
material spin-off. This means that AVS *.geom  files can be produced by the
plotroutines, which can be read in and visualized by the Geometry Viewer.
1. In order to create the AVS-GEOM Calcomp library "libcalcomp.a" :
	Doe
2. The library is linked to a central, user-accessible place:
	ln -s libcalcomp.a /usr/avs/lib/libcalcomp.a
3. ASCII documentation is contained in the files  *.txt :
	plot.txt	symbol.txt
4. Sample programs should be executed as a test, like in:
	Exec pg15
   Especially the "lasplo" routine can give trouble when linking, since it is
   a little bit system-dependent. In that case, we wish you happy hunting ...
5. Other (Fortran) programs containing calls to Calcomp plotroutines can be
   forced to produce AVS GEOM code by linking them to the necessary libraries,
   for example as is implemented by the following script:
	echo $1 ; fc -fi $1.f -o $1 /usr/avs/lib/libcalcomp.a \
	/usr/avs/lib/libflow_f.a /usr/avs/lib/libgeom.a /usr/avs/lib/libutil.a
6. Plotfiles will be recognized by AVS as GEOM files, but only if their names
   end with the suffix ".geom". A programming example:
	program MAIN
	open(1,file='myplot.geom')
	call plots(0,0,1) ! Parameters: dummy, dummy, logical unit number
*	Make your drawings here ...
	call lasplo ! Don't forget to write the AVS GEOM plotfile to disk
	end
7. In order to view the contents of "myplot.geom", type:
	avs &
   Click with left mouse button:  "Geometry Viewer", "Read Object". Then select
   proper directory with "New Dir" and (.geom) plotfile with "New File".
   Clicking at "Normalize" will blow up the picture, so that it will fit into
   the whole graphics window.
   Oh well, I suppose this is all well known ...
Please remember: anything FREE comes without garantee!
-
* Han de Bruijn; Applications@Convex | "A little bit of Physics * No
* TUD Computing Centre; P.O. Box 354 |  would be NO idleness in * Oil
* 2600 AJ  Delft; The Netherlands.   |  Mathematics" (HdB).     * for
* E-mail: Han.deBruijn@RC.TUDelft.NL | Fax: +31 15 78 37 87 --- * Blood
Calcomp implementation at the Convex of TU Delft Computing Centre
=================================================================
April 10, 1989 the "RC-plotroutines" (Calcomp) were released at the Convex
C240 of TU Delft Computing Centre. The reason is that many applications
still make use of this "de facto" graphics standard.
Here "RC" means "RekenCentrum", which is Dutch for "Computing Centre".
There is hardly any installation where "Calcomp" routines actually 
correspond with the original of California Computer Products.
For example, at our IBM mainframe the plotroutines, instead of
"Calcomp", produce so-called GPGS-DIC plotfiles
(General Purpose Graphic System - Device Independent Code).
Also at the Convex, the plotroutines are modified. 
Therefore, they produce no "Calcomp" plotter code.
But in addition to GPGS-DIC, as at the IBM mainframe,
they can produce coded information for Tektronix terminal screens,
for Hewlett Packard pen-plotters, for the Computing Centre Benson
plotter, and others.
GPGS en HP-GL plotfiles are meant for real drawings, and therefore 
must contain plot-information which is scaled correctly. 
Tektronix plotfiles on the contrary are meant only for "previewing"
purposes; they are not plotted in real inches.
Calcomp Basic Software
======================
The lowest level of software used in producing a plot is termed Basic
Software. Host Computer Basic Software (HCBS) consists of a set of
subroutines which allow the programmer to perform elementary plotting
operations such as drawing lines or annotation, selecting a pen,
scaling the plot, etc.
This chapter is intended to provide an explanation of the
subroutines included in the Basic Software package and how
they are used to produce graphical output.
The HCBS subroutines are callable directly from FORTRAN programs.
Standard FORTRAN name conventions are used throughout this chapter
and in the HCBS package.
The following subroutines are included as part of the standard HCBS package:
1.  PLOT    Plots straight line between two points; establish plot origin.
            Also contains six entry points for auxiliary functions:
            PLOTS, FACTOR, WHERE, NEWPEN, LASPLO, OFFSET.
2.  SYMBOL  Plots annotation and special symbols (: MARK).
3.  NUMBER  Plots the decimal equivalent of an internal floating point number.
4.  SCALE   Determines starting value and scale for an array of data
            to be plotted on a graph.
5.  AXIS    Draws an annotated axis line for a graph.
6.  LINE(S) Scales and plots a set of data points defined by X and Y
            coordinate arrays.
PLOT SUBROUTINE
===============
Many graphic applications require the generation of X-Y graphs to
show the relationship between two or more sets of data.
Usually these graphs can be produced easily and quickly by a 
suitable programmed combination of the five supporting 
subroutines SCALE, AXIS, LINE, SYMBOL and NUMBER.
These subroutines do not directly produce plotter commands; they only
compute appropriate arguments that define pen positions, and then call
the PLOT subroutine, which generates the actual plotter commands.
When plotting requirements cannot be satisfied by using the
supporting subroutines, the user can call the PLOT subroutine,
which gives him direct control of pen movement (to any X, Y 
coordinate position) or pen status (up or down).
    PLOT     Main plotroutine
             ----------------
The main entry to the PLOT subroutine is used to move the pen in a
straight line to a new position, with the pen either up or down during
the movement. It converts the arguments to the appropriate sequence of
plotter commands and outputs these to the attached device. 
Note that PLOTS must be called before any other entries are called.
The calling sequence has three arguments:
CALL PLOT    (XPAGE, YPAGE, IPEN)
XPAGE, YPAGE   are the X,Y coordinates, in inches form the current

Reference

point (origin), of the position to which the pen
               is to be moved. An origin (where both X,Y equal zero) may
               be established anywhere on (or off) the plotting surface,
               as explained below for negative IPEN values. For metric
               plotting systems, the X,Y coordinates are in centimeters.
IPEN          is a signed integer which controls pen status
              (up or down), and origin definition.
              If IPEN = 2, the pen is down during movement, thus 
	      drawing a visible line.
              If IPEN = 3, the pen is up during movement.
              If IPEN = -2 or -3, a new origin is defined at the
              terminal position after the movement is completed as 
	      for IPEN = 2 or 3 .
              The logical X,Y coordinates of the new pen position are 
	      set equal to zero. This position is the reference point 
	      for succeeding pen movements. All of the plotter commands
              accumulated in the output buffer are transmitted to the

Output

device.
	 Computing Centre extensions:
	 ----------------------------
	 | IPEN | = 12   pen down with OFFSET (see OFFSET entry)
	 | IPEN | = 13   pen up with OFFSET   (see OFFSET entry)
         If IPEN = 999, the effects are the same as if IPEN = -3,
	 exept that the output device is closed in addition.
Six other functions are closely associated with the PLOT operation, as follows:
1.  PLOTS    Performs initialization
2.  FACTOR   Adjusts the overall size of a plot.
3.  WHERE    Returns the current pen location.
4.  NEWPEN   Selects pens.
5.  LASPLO   End of plot.
6.  OFFSET   Defining offsets (RC-extension).
In some basic software packages, these functions are programmed as
separate entry points within the PLOT subroutine. 
In other software packages [ amongst wich those of RC TU Delft ]
they are separate subroutines which call PLOT with a special value 
of IPEN to perform the necessary operation. In either case, the 
calling sequence and the function is the same. The discussion here 
assumes that they are entry points in the PLOT subroutine.
 
PLOTS ENTRY
-----------
The PLOTS entry is used to initialize the PLOT subroutine. It must be 
called once for EACH picture (before any other call to PLOT, SYMBOL,
NUMBER, AXIS or LINE is made). This entry sets up certain constants
and (re)opens the plot output device.
Its calling sequence, RC-Convex AVS version, has NO arguments:
	CALL PLOTS
FACTOR ENTRY
------------
The FACTOR entry to the PLOT subroutine enables the use to enlarge
or reduce the size of the entire plot by changing the ratio of the
desired plot size to the normal plot size.
CALL FACTOR (FACT)
FACT is the ratio of the desired plot size to the normal plot size.
     For example, if FACT = 2.0, all subsequent pen movements will 
     be twice their normal size. When FACT is reset to 1.0, all 
     plotting returns to normal size (: _absolute_ scaling).
     During the debugging of a plotting application program, 
     computer and plotting time can be saved by reducing the size 
     of the entire plot output.
     This is done by calling FACTOR with a value less than 1.0, 
     after calling PLOTS.
     When debugging is completed, this call statement can be removed.
  
WHERE ENTRY
-----------
The WHERE entry sets the three variables designated in the calling
sequence to the pen's current position coordinates and the plot-sizing
factor (that are in use by the PLOT subroutine). This permits user-
written subroutines to know the pen's current location for optimizing
pen movement.
The calling sequence has three arguments:
CALL WHERE    (RXPAGE, RYPAGE, RFACT)
RXPAGE,       are variables that will be set to the pen's current
RYPAGE        position coordinates resulting from the previous call 
              to PLOT (which may have been called by SYMBOL, 
	      NUMBER, AXIS or LINE).
RFACT         is set to the current plot-sizing factor; i.e., 
              the value last supplied by a call to FACTOR or 1.0
	      if FACTOR has not been called.
NEWPEN ENTRY
------------
The NEWPEN entry enables program selection of any of the available
pens for multipen plotters. If a call to NEWPEN is made for a 
single pen plotter, it is ignored. 
Pen No. 1 is the firtst in the sequence of pens.
Pen No. 1 is initially selected when the PLOTS entry is called.
The calling sequence is as follows:
  CALL NEWPEN (INP)
  
  INP       specifies the number of the pen to be selected.
The old pen is raised and the new pen is moved to the same 
physical location at which the old pen was positioned.
LASPLO ENTRY
------------
The LASPLO entry to the PLOT subroutine is used to finish the 
current plot.
Its calling sequence invokes no arguments:
 CALL LASPLO
Another way to finish the current plot is to perform a 
call to subroutine PLOT with IPEN=999, for example:
 CALL PLOT(0.0, 0.0, 999)
Warning: be sure that this subroutine is actually called. Otherwise,
(all of the) plot-data may be missing.
OFFSET ENTRY (RC-extension)
------------
Usage of this extension should be discouraged.
The OFFSET entry in PLOT enables the user to create a separate 
coordinate system with its own origin and scale factors.
These factors don't have to be the same for x- and y-direction.
In that coordinate system, drawings can be made by PLOT only (!),
where the usage of OFFSET is indicated by giving to IPEN one 
of the values  +12 , -12 , +13 , -13 .
See menu-entry for PLOT.
Calling sequence, with four parameters:
CALL OFFSET (XOFF, XFCT, YOFF, YFCT)
XOFF, YOFF -  Two real numbers defining the coordinates of the 
	      current origin with respect to the OFFSET-origin, 
	      calculated with the OFFSET scale factors
	      XFCT and YFCT, respectively.
XFCT, YFCT -  Two real numbers defining the scaling factors for 
	      the x- and y-coordinates, respectively.
Remark
------
If X1 and Y1 are coordinates of a point in the OFFSET coordinate 
system, then they are expressed back into the coordinates 
X and Y of the current system by the following formulas:
		X = ( X1 - XOFF ) / XFCT
		Y = ( Y1 - YOFF ) / YFCT
SYMBOL/MARK SUBROUTINES ( + RC-Convex Extensions)
=======================
The SYMBOL/MARK subroutine procedures plot annotation at any angle
and in practically any size.
0.  There are two SYMBOL/MARK call formats:
1.  the "standard" call, which can be used to draw text such as titles,
    captions, and legends;
2.  the "special" call, which is used to draw special centered symbols
    such as a box, octagon, triangle, etc., for plotting data points.
Both forms of the SYMBOL/MARK calling sequences have six arguments.
Note: "RC" means "RekenCentrum", which is Dutch for "Computing Centre".
 
RC-Extensions for subroutines SYMBOL/MARK
-----------------------------------------
The original Calcomp routines at our IBM mainframe are IBM oriented.
Therefore, one may expect some trouble if it comes to the processing of
character strings; for this implies a conversion procedure between
ASCII and EBCDIC coding.
The Calcomp routines originally have been written in Fortran IV.
Character type variables were unknown at that time.
A text string could be supplied as a "Hollerith" or "IBCD", 
which means something like "Integer Byte Coded Decimal".
This history implies that we can not completely avoid EBCDIC-ASCII
conversion issues in our treatment.
In fact, it is the fourth parameter in subroutine SYMBOL
that gives the trouble, because:
- in the "standard" call it is of type character;
- in the "special"  call it is of type integer,
which is incompatible with modern (Fortran) language definitions.
Everything probably goes right, if you keep yourself to the following rules:
1. Use SYMBOL only if the fourth parameter is of CHARACTER type;
2. If the fourth parameter is of integer type, then use 
   subroutine-entry MARK instead of SYMBOL.
   MARK is Computing Centre extension.
Subroutine MARK behaves exactly as described in the 
The strokes-table on page 32 is part of that description.
In fact, it represents a part of the EBCDIC table.
However, it was impossible to bring this table in correspondence with
ASCII, without introducing further incompatibilities. 
Instead, we composed a new ASCII strokes-table. 
It is this table which is used when subroutine SYMBOL is invoked 
at the Convex. You can also use lowercase characters with SYMBOL !
You cannot do that with MARK. On the other hand, the special
(centered) symbols cannot be created with SYMBOL,
but only by invoking MARK.
If you have thought of a mixture of special symbols and text,
in such a way that the above recipe is not sufficient,
then you should be able to manipulate with character codes.
We added an extra subroutine to the Calcomp library, for this purpose.
Its calling sequence is:
      CALL EBCDIC(string)
An ASCII string goes in; an EBCDIC string comes out. 
You must think of the rest yourself:
      CALL MARK( ....., STRING, ...)
 The 'standard' call is:
 ----------------------
 CALL SYMBOL (XPAGE, YPAGE, HEIGHT, IBCD, ANGLE, +NCHAR)
 
 XPAGE     are the coordinates, in inches, of the lower left-hand corner
 YPAGE     (before character rotation) of the first character to be
           produced. The pen is up while moving to this point.
 
           Annotation may be continued from the position following that
           at which the last annotation ended. Continuation occurs when
           XPAGE and/or YPAGE equals 999.0, and may be applied to X or Y
           independently. (Calling WHERE to obtain the current pen
           position and using RXPAGE, RYPAGE in another call to SYMBOL
           would not give the same results as using 999).
 
 HEIGHT    is the height, in inches, of the character to be plotted.
           The width of a character, including spacing, is normally the
           same as the height (e.g., a string of 10 characters 0.14 inch
           high is 1.4 inches wide).
 
 IBCD      is the text, in internal computer representation (usually BCD
           or A-type format), to be used as annotation. The character(s)
           must be left-justified and contiguous in: a single variable,
           an array, or a Hollerith literal (if the compiler permits).
       !!  Fortran 77 : IBCD is simply of type CHARACTER.
           Blanks in the text do not cause any pen movement until the
           next nonblank character is started.
 
           The text must be right-justified in IBCD if a single character
           is desired and NCHAR = 0.
 
 ANGLE     is the angle, in degrees from the X-axis, at which the
           annotation is to be plotted. If ANGLE = 0.0, the character(s)
           will be plotted right side up and parallel to the X-axis.
 
 +NCHAR    is the number of characters to be plotted from IBCD.
           If NCHAR > 0, the data must be left-justified in the first
           element of IBCD.
 
           If NCHAR = 0, one alpanumeric character is produced, using a
           single character which is right-justified in the first 
	   element of IBCD.
 
 The 'special' call
 ------------------
 The second form is the 'special' call, which produces only a single 
 symbol based on the index value of INTEQ - not on the BCD 
 representation of a character (Fortran 77: non-character).
 Instead of invoking SYMBOL, at the RC-Convex the following calling 
 sequence has to be used:
 CALL MARK (XPAGE, YPAGE, HEIGHT, INTEQ, ANGLE, -ICODE)
 
 XPAGE,    are the same as described for the 'standard' call.
 YPAGE,
 ANGLE     If the symbol to be produced is one of the centered symbols
           (i.e., if INTEQ is less than 14), XPAGE, YPAGE represent 
           the geometric center of the character produced.
 
 HEIGHT    is the height (and width), in inches, of the centered symbol
           to be drawn.
 
 INTEQ     is the integer equivalent of the desired symbol. (All valid
           integers and their symbols are listed in the Symbol Table of
           the applicable computer supplement.) If INTEQ is 0 through 13,
           a centered symbol is produced.
 
 -ICODE    is negative and determines whether the pen is up of down
           during the move to XPAGE, YPAGE.
 
           When -ICODE is:
 
           -1, the pen is up during the move, after which a single
           symbol is produced.
           -2, or less, the pen is down during the move, after which a
           single symbol is produced.