Animation windows created for the circular highway and racetrack simulations are added to TkShift , by making changes to the following files in <source>/lib/TkShift directory, where <source> is the directory location of your SHIFT installation:
Additional drawing procedures for the highway descriptions are very crude, and will cause TkShift to stop while generating the animation window.
NOTE: The changes described here are tested under version 2.12.
The following changes need to be made in order to create an additional menu item in TkShift animation window:
| animation-create.tcl | Add canvas name to if-elseif section of the file, e.g.:
} elseif {$CanvasName == "Circular"} {
CreateCanvasInstance $CanvasNumber 1 Circular
lappend ExistingCanvases(Circular) $CanvasNumber
set CanvasTypeArray($CanvasNumber) Circular
}
|
| canvases.tcl | Add procedure for canvas drawing to the file, e.g.:
proc DrawTrack {w {zoom_index 1}} {
set lw 4
set sl 100
$w create rectangle [expr $sl/$zoom_index] 0 \
[expr 3*$sl/$zoom_index] [expr $lw/$zoom_index];
...
(more definitions)
...
}
|
| canvas-parameters.tcl |
Add canvas name to "Canvases", and define canvas parameters at the end of the file, e.g.:
set XDefault(Track) "gxp" ... (more definitions) ... set CanvasStructure(Track,procedure) DrawTrack |
Last modified on December 5, 1997