(FILECREATED "21-Aug-86 00:29:16" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH092.;1 2575   

      changes to:  (VARS RHTPATCH092COMS)
		   (FNS NC.LayoutNewBrowserNodes))


(* Copyright (c) 1986 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT RHTPATCH092COMS)

(RPAQQ RHTPATCH092COMS ((* * Change to NCBROWSERCARD)
			  (FNS NC.LayoutNewBrowserNodes)))
(* * Change to NCBROWSERCARD)

(DEFINEQ

(NC.LayoutNewBrowserNodes
  (LAMBDA (RootNode NewNodes BrowserFormat SpecialBrowserSpecs)
                                                             (* rht: "21-Aug-86 00:28")

          (* * Hold onto old location of RootNode. Then layout the subgraph having root RootNode and lattice NewNodes.
	  Finally, translate the locations of NewNodes using old loc of RootNode.)



          (* * rht 8/21/86: LAYOUTGRAPH destroys FROMNODES of root node. Now we save and restore these after LAYOUTGRAPH is 
	  called.)


    (LET ((OldRootNodePos (fetch (GRAPHNODE NODEPOSITION) of RootNode))
	  (Lattice (CONS RootNode NewNodes))
	  (FromNodes (fetch (GRAPHNODE FROMNODES) of RootNode))
	  NewRootNodePos)
         (LAYOUTGRAPH Lattice (LIST (fetch (GRAPHNODE NODEID) of RootNode))
			(SUBST (QUOTE LATTICE)
				 NC.*Graph*BrowserFormat BrowserFormat)
			(fetch (SPECIALBROWSERSPECS Font) of SpecialBrowserSpecs)
			(fetch (SPECIALBROWSERSPECS MotherD) of SpecialBrowserSpecs)
			(fetch (SPECIALBROWSERSPECS PersonalD) of SpecialBrowserSpecs)
			(fetch (SPECIALBROWSERSPECS FamilyD) of SpecialBrowserSpecs))
                                                             (* Restore FROMNODES of RootNode.)
         (replace (GRAPHNODE FROMNODES) of RootNode with FromNodes)
         (SETQ NewRootNodePos (fetch (GRAPHNODE NODEPOSITION) of RootNode))
         (for Node in Lattice
	    bind (XOffset ←(DIFFERENCE (fetch XCOORD of OldRootNodePos)
					   (fetch XCOORD of NewRootNodePos)))
		   (YOffset ←(DIFFERENCE (fetch YCOORD of OldRootNodePos)
					   (fetch YCOORD of NewRootNodePos)))
	    do (LET ((NodePos (fetch (GRAPHNODE NODEPOSITION) of Node)))
		      (replace (GRAPHNODE NODEPOSITION) of Node
			 with (create POSITION
					  XCOORD ←(PLUS XOffset (fetch XCOORD of NodePos))
					  YCOORD ←(PLUS YOffset (fetch YCOORD of NodePos))))))))
)
)
(PUTPROPS RHTPATCH092 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (403 2493 (NC.LayoutNewBrowserNodes 413 . 2491)))))
STOP