(FILECREATED "26-Jul-84 20:50:59" {ERIS}<LISPCORE>DIG>FCURVE.;1 3198   

      changes to:  (VARS FCURVECOMS)
		   (FNS FCURVE))


(* Copyright (c) 1984 by Xerox Corporation)

(PRETTYCOMPRINT FCURVECOMS)

(RPAQQ FCURVECOMS ((FNS FCURVE)))
(DEFINEQ

(FCURVE
  [LAMBDA (X0 Y0 X1 Y1 DX DY DDX DDY DDDX DDDY N BRUSHBM DISPLAYDATA BBT ENDING USERFN DISPLAYSTREAM)
                                                             (* edited: "26-Jul-84 20:50")
    (DECLARE (LOCALVARS . T))

          (* Puts a spline segment down. Since it calls BitBlt1 directly, it must clip to both clipping region and the size 
	  of the destination bit map.)


    (PROG (OLDX X Y OLDY DELTAX DELTAY DELTA TX TY OOLDX OOLDY)
          [COND
	    ((NEQ N 0)
	      [COND
		(USERFN                                      (* if there is a user fn, stay in his coordinates.)
			(SETQ OLDX X0)
			(SETQ OLDY Y0))
		(T (SETQ OLDX (\DSPTRANSFORMX (IDIFFERENCE X0 (LRSH BRUSHWIDTH 1))
					      DISPLAYDATA))
		   (SETQ OLDY (\DSPTRANSFORMY (IDIFFERENCE Y0 (LRSH BRUSHHEIGHT 1))
					      DISPLAYDATA]   (* draw origin point)
	      (\CURVESMOOTH OLDX OLDY USERFN DISPLAYSTREAM)
                                                             (* convert the derivatives to fractional 
							     representation.)
	      (SETQ X (FPLUS OLDX .5))
	      (SETQ Y (FPLUS OLDY .5))
	      [for I from 1 to N
		 do                                          (* uses \BOXIPLUS to save box and also set the new value
							     of the variable.)
		    (SETQ X (FPLUS X DX))
		    (SETQ DX (FPLUS DX DDX))
		    (SETQ DDX (FPLUS DDX DDDX))
		    (SETQ Y (FPLUS Y DY))
		    (SETQ DY (FPLUS DY DDY))
		    (SETQ DDY (FPLUS DDY DDDY))
		    (SETQ OOLDX OLDX)
		    (SETQ OOLDY OLDY)
		    (SETQ DELTAX (IDIFFERENCE (SETQ OLDX (FIX X))
					      OOLDX))
		    (SETQ DELTAY (IDIFFERENCE (SETQ OLDY (FIX Y))
					      OOLDY))
		    (SETQ DELTA (IMAX (IABS DELTAX)
				      (IABS DELTAY)))
		    (COND
		      ((EQ DELTA 1)
			(\CURVESMOOTH OLDX OLDY USERFN DISPLAYSTREAM)))
		    (COND
		      ((IGREATERP DELTA 1)
			(SETQ DELTAX (FQUOTIENT DELTAX DELTA))
			(SETQ DELTAY (FQUOTIENT DELTAY DELTA))
			(SETQ TX (FLOAT OOLDX))
			(SETQ TY (FLOAT OOLDY))
			(for I from 0 to DELTA
			   do (\CURVESMOOTH (FIX TX)
					    (FIX TY)
					    USERFN DISPLAYSTREAM)
			      (SETQ TX (FPLUS TX DELTAX))
			      (SETQ TY (FPLUS TY DELTAY]     (* draw the end point)
	      (COND
		(USERFN (\CURVESMOOTH X1 Y1 USERFN DISPLAYSTREAM))
		(T (\CURVESMOOTH (\DSPTRANSFORMX (IDIFFERENCE X1 (LRSH BRUSHWIDTH 1))
						 DISPLAYDATA)
				 (\DSPTRANSFORMY (IDIFFERENCE Y1 (LRSH BRUSHHEIGHT 1))
						 DISPLAYDATA)
				 NIL DISPLAYSTREAM)))
	      (AND DISPLAYSTREAM (MOVETO X1 Y1 DISPLAYSTREAM]
          (COND
	    (ENDING (\CURVESMOOTH (IPLUS \CURX \CURX (IMINUS \OLDX))
				  (IPLUS \CURY \CURY (IMINUS \OLDY))
				  USERFN DISPLAYSTREAM)
		    (\CURVESMOOTH (IPLUS \CURX \CURX (IMINUS \OLDX))
				  (IPLUS \CURY \CURY (IMINUS \OLDY))
				  USERFN DISPLAYSTREAM)))
          (RETURN NIL])
)
(PUTPROPS FCURVE COPYRIGHT ("Xerox Corporation" 1984))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (247 3121 (FCURVE 257 . 3119)))))
STOP