Date: 1 July 1980 14:57-EDT From: George J. Carrette To: "(FILE [GJC;GRAPHS USAGE])" at MIT-MC Date: 1 July 1980 14:53-EDT From: George J. Carrette To: MEM at MIT-MC, JGA at MIT-MC cc: "(FILE [FILE GJC;GRAPHS USAGE])" at MIT-MC The generic functions are set-pen, move-pen, vector-pen, draw-point, draw-line. set-window, set-viewport, get-window, get-viewport. The first argument to these functions is always a graphic object. The rest of the arguments are always paired X,Y. e.g. (set-pen foo x y) and (draw-line foo x1 y1 x2 y2). The coordinate arguments can either be numbers, arrays of numbers, or lists of numbers. (make-ards-stream) makes you an ards-object. (make-graphics-stream ) takes an ards-object and returns a flonum-scaling graphics stream. Other operations are conviently accessed with the CALL function. (call 'cursorpos 'c) (call 'which-operations) (call 'open 'tty) (call 'open 'dsk '((foo) bar >)) (call 'close) No compile-time considerations are needed when using the generic operators. However, users of call should do (or (get 'closure 'version) (load '((gjc)close))) at eval and compile times.  A graphics stream is a special object which these generic functions can operate on. These objects keep an internal state, such as the position of the last point plotted, and the values of the scaling factors. Loading GJC;GRAPHS FASL will make the the relevant functions autoloading. Functions for hardware specific objects are in different files. See GRAPHZ DEMO for example usage. (MAKE-ARDS-STREAM) returns an object which takes fixnum arguments and outputs ARDs graphics codes to file or TTY objects which it stores internaly. This is a primitive stream. (MAKE-TEK-STREAM) is not yet implemented. (MAKE-GRAPHICS-STREAM ) takes a primitive stream as argument and returns a stream which can do floating point scaling and clipping, and setting of windows and viewports. (GRAPHICS-STREAM-OPEN &OPTIONAL ) is 'TTY or 'DSK. is the file name when opened in 'DSK mode. (GRAPHICS-STREAM-CLOSE ) closes any DSK file. (SET-PEN X Y) (MOVE-PEN X Y) draws a line from the last point the new point. (VECTOR-PEN X Y) does a relative move of the pen. (DRAW-POINT X Y) draws a line of length 0. (GRAPHICS-STREAM-TYO ) presently does a character TYO. Does not try and enforce clipping. #\CR may cause lossage. Line-drawing of characters and scaling may be supported in the future. The following are not supported in primitive graphic streams. (SET-WINDOW X0 X1 Y0 Y1) the window is the apparent flonum size. (SET-VIEWPORT X0 X1 Y0 Y1) The viewport is set in "hardware" or rather, primitive stream dependant, fixnums. The default values for these are usually reasonable, by definition. (MAKE-GRAPHICS-SFA ) takes a graphics stream and returns and SFA which may be used as an argument to PRINT, FORMAT, etc. (MAKE-TRACED-FUNCTOR ) takes a functor (a graphics stream is a functor) and returns a functor which is traced. Trace information is output to the value of TRACED-FUNCTOR-MSGFILE which should NOT be a stream which calls any traced functors! The returned functor is not equal to the argument, i.e. the argument is not side effected.