#|

Trace Point

Note: This is an example file showing concepts of the Integration Kit. The code itself is not supported and will never be supported.
|#


(in-package :EXAMPLES)
(use-package :OLI)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defvar *point-list*)
(setq *point-list* nil)

(sd-defdialog 'trace_point
  :dialog-title "Trace Point"
  :variables
  '(
    (REL
     :title "Relation"
     :selection *sd-relation-seltype*
     :initial-value nil
     )

    (VERTEX
     :title "Vertex"
     :selection *sd-vertex-3d-seltype*
     )

    (PART
     :title "Spline Part"
     :value-type :part-incl-new
     :modifies :contents
     :face-part-allowed t
     :wire-part-allowed t
     )
    )

  :ok-action
  '(progn
     (setq *point-list* nil)
     (sd-animate-relation REL
			  :function 'add-point
			  :arguments VERTEX
			  :model-update t)
     (sd-call-cmds (apply
		    'spline_dialog :spline_option_create_expand :point_pick_create
				   :wire_part PART
				   *point-list*
		    ))
     )
)

(defun add-point (vx)
  (setq *point-list* (cons (sd-inq-vertex-geo vx :dest-space :global) *point-list*))
)

;;