File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -351,7 +351,22 @@ Args:
351351 ; ; fname finished with '.pdf', remove it
352352 (setq fname (subseq str 0 (1- (length str))))
353353 )))
354- (send self :write-to-file fname result-path title))
354+ (send self :write-to-file fname result-path title " pdf" ))
355+ (:write-to-png (fname &optional result-path
356+ (title (string-right-trim " .png" fname)))
357+ " write graph structure to png
358+ Args:
359+ fname: filename for output
360+ result-path: list of solver-node, it's result of (send solver :solve graph)
361+ title: title of graph
362+ "
363+ (when (substringp " .png" fname)
364+ (let ((str (string-right-trim " png" fname)))
365+ (when (= (elt str (1- (length str))) #\. )
366+ ; ; fname finished with '.png', remove it
367+ (setq fname (subseq str 0 (1- (length str))))
368+ )))
369+ (send self :write-to-file fname result-path title " png" ))
355370 (:original-draw-mode ()
356371 " change draw-mode to original mode"
357372 (send self :draw-both-arc nil )
Original file line number Diff line number Diff line change 267267 ; ; write graph to pdf file
268268 (warning-message 2 " write to /tmp/robots_in_jsk.pdf~% " )
269269 (send g :write-to-pdf " /tmp/robots_in_jsk.pdf" nil " robots_in_jsk" )
270+
271+ ; ; write graph to png file
272+ (warning-message 2 " write to /tmp/robots_in_jsk.png~% " )
273+ (send g :write-to-png " /tmp/robots_in_jsk.png" nil " robots_in_jsk" )
270274 g))
271275
272276(eval-when (load eval )
You can’t perform that action at this time.
0 commit comments