drawing
TCL/TK UseCase4
Abstract : Used by both the Tcl code and the PP Group's C++ code to
create objects and display them.
Comments : The names of the calls in here are the exact ones called in the
C++. First the object structure is created, then it is displayed.
#All this procs basically do the same thing. Each creates the data
#structure (either vertex or edge) and sets the variables for that structure.
#Then the proc will call createEdge or createVertex to place the egde or
#vertex on the canvas. These function calls are also the onces called by
#the C++ Propagation Pattern Group to give them display control.
####
# UPDATE for Use Case 4: createEdge and createVertex are no longer called here.
# They are called from within newVertex and newEdge.
####
#Construction vertex.
proc tclCVert { id lbl coords {lblCoords {0 -20}} } {
#puts "tcl is sending: $id Constr $lbl $lblCoords $coords"
newVertex $id Constr $lbl $lblCoords $coords
}
#Alternation vertex.
proc tclAVert { id lbl coords {lblCoords {0 -20}} } {
newVertex $id Alter $lbl $lblCoords $coords
}
#Construction edge.
proc tclCEdge { id lbl srcVert dstVert {lblCoords {0 -10}} {nodes {}} } {
newEdge $id $lbl Constr $srcVert $dstVert $lblCoords $nodes
}
#Alternation edge.
proc tclAEdge { id srcVert dstVert {nodes {}} } {
newEdge $id fakelbl Alter $srcVert $dstVert {} $nodes
}
#This proc moves a vertex label.
#Propagation Patterns do not use this function.
proc tclCMoveLabelTo { name coords } {
moveVertexLabel $name $coords
}