(in-package "KPML")

;;; File: history cumulation...

(defun RECORD-FEATURE-IN-HISTORY (feature)
  (let ((current-element (first (last *gh-table*))))
    (setf (gh-history-feature current-element) feature)
    (when kpml-i::*graphical-traversal* 
      (update-traversal-graph current-element))
    (setf *gh-table*
      (append (butlast *gh-table* 1)
	      (list current-element)))))


(defun UPDATE-TRAVERSAL-GRAPH (traversal-step)
  (let ((new-system (gh-history-system traversal-step))
	(new-feature (gh-history-feature traversal-step)))
    (unless kpml-i::*graphical-start-pts* 
      (setf kpml-i::*graphical-start-pts* 
	(list (cons new-system new-feature))))
    (setf kpml-i::*fresh-growth* new-feature)
    (setf 
	(gethash 
	 new-system
	 (slot-value kpml-i::*traversal-frame* 'kpml-i::traversal))
      new-feature)
    (clim:redisplay-frame-pane kpml-i::*traversal-frame* 'kpml-i::info)))


