home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 52
/
Amiga_Dream_52.iso
/
Linux
/
Divers
/
angela-1.28-BETA-bin-Linux-i586.tar.gz
/
angela-1.28-BETA-bin-Linux-i586.tar
/
angela-1.28-BETA
/
module_pling.tcl
< prev
next >
Wrap
Text File
|
1998-05-05
|
3KB
|
128 lines
# This is a module for PLING implementation
proc pling_out { command { arg1 "" } { arg2 "" } { arg3 "" } { arg4 "" } } {
switch $command {
long_info
{
return "{ Pling output }\
{ Pling output }\
{ Oliver Pabst }\
{ 1.0 }\
{ Pling output/Tcl } \
{ Pling output filter as Tcl module for angela! }\
{ Oliver Pabst }\
{ 1.0 }\
{ filter_out }\
{ pling }"
}
extension
{
return ".pling"
}
init
{
}
save
{
pling_out:save $arg1 $arg2 $arg3 $arg4
}
}
}
proc pling_out:save { handle msg nodes edges } {
global tcl_platform
set separator "# -----------------------------------------------------------------------"
puts $handle $separator
puts $handle "# Generated by angela! version [$msg VERSION]. This is PLING format."
puts $handle "# For more informations on this format, see following URL:"
puts $handle "# http://www.mpi-sb.mpg.de/~schwartz/pling.ps"
puts $handle $separator
puts $handle "# Running on $tcl_platform(os) version\
$tcl_platform(osVersion) ($tcl_platform(platform)) $tcl_platform(machine)."
puts $handle $separator
puts $handle "# For more informations about angela!, consult"
puts $handle "# http://www.mpi-sb.mpg.de/~pabst/angela"
puts $handle "# or contact pabst@mpi-sb.mpg.de"
puts $handle $separator
puts $handle "1"
puts $handle "\"\" black 10c center \"\" left \"\" 0 0"
puts $handle "[llength $nodes]"
set index 0
foreach node $nodes {
puts $handle $separator
set info [$msg NODE:EDIT:GET $node]
array set nc [lindex $info 0]
array set ncv [lindex $info 1]
set hash($node) $index
puts $handle "# Node $node"
puts $handle "$index \"$ncv(text:text)\" $ncv(text:textcolor) $ncv(text:width) \
$ncv(text:anchor) \"$ncv(text:font)\" $ncv(text:anchor) \"\" \
$ncv(text:coords) $ncv(node:type) $ncv(shape:coords) \
$ncv(shape:color) $ncv(shape:width) $ncv(shape:outline) \"\" \
$ncv(node:type) $ncv(shape:shape) \"$ncv(shape:shapeargs)\""
incr index
}
puts $handle "[llength $edges]"
set index 0
foreach edge $edges {
puts $handle $separator
set info [$msg EDGE:EDIT:GET $edge]
array set ec [lindex $info 0]
array set ecv [lindex $info 1]
puts $handle "# edge $edge"
if { $ecv(line:bezier) == 0 } {
set smooth 0
} else {
set smooth 1
}
set node1 $hash($ecv(edge:node1))
set node2 $hash($ecv(edge:node2))
set coords $ecv(line:coords)
# set length [llength $coords]
# if { $length > 4 } {
# set coords [lrange $coords 2 [expr $length - 1] ]
# } else {
# set coords ""
# }
puts $handle "$index $node1 $node2\
$ecv(edge:type) $ecv(line:color) $ecv(line:width)\
$ecv(line:arrow) \"$ecv(line:arrowshape)\"\
$smooth $ecv(line:bezier) $ecv(edge:type)\
$coords"
incr index
}
puts $handle $separator
puts $handle "# angela! lives ;)"
}