generated by zdoc.tcl on Thu Feb 14 16:15:15 MET 2002

tclLevelSets.tcl



levelset
Comments  
Arguments  
Used by  
Uses  

}


levelset::installLevelSet2D
Comments  
Arguments parent
camera
object
color
Used by  
Uses  
proc levelset::installLevelSet2D { parent camera object color } {
    menubutton $parent.context.object -text "Object" -menu $parent.context.object.m -anchor w -bg $color
    set mobject [menu $parent.context.object.m -bg $color]
    $mobject add command -label "destroy" -command "evaluate {$object -destroy}"

    menubutton $parent.context.graphics -text "Graphics" -menu $parent.context.graphics.m -anchor w -bg $color
    set mgraphics [menu $parent.context.graphics.m -bg $color -postcommand "set levelset::dnb \[$object -drawNB\]"]
    $mgraphics add checkbutton -label "display narrow band" -variable levelset::dnb -onvalue true -offvalue false -selectcolor black -command "evaluate \"$object -drawNB \$levelset::dnb\""
    $mgraphics add command -label "0 level set color..." -command "set col \[interface::selectColor  \[ $object -color\]\]; evaluate \"$object -color \[lindex \$col 0\] \[lindex \$col 1\] \[lindex \$col 2\] \""
    $mgraphics add cascade -label "0 level set width" -menu $mgraphics.width
    menu $mgraphics.width -bg $color -tearoff 0
    $mgraphics.width add command -label "1" -command "evaluate \"$object -width 1\""
    $mgraphics.width add command -label "2" -command "evaluate \"$object -width 2\""
    $mgraphics.width add command -label "3" -command "evaluate \"$object -width 3\""
    $mgraphics.width add command -label "5" -command "evaluate \"$object -width 5\""

    menubutton $parent.context.parameters -text "Parameters" -menu $parent.context.parameters.m -anchor w -bg $color
    set mparameters [menu $parent.context.parameters.m -bg $color]
    $mparameters add command -label "parameters..." -command "levelset::parameter $object $color"

    pack $parent.context.object $parent.context.graphics $parent.context.parameters -side left
}


levelset::parameter
Comments  
Arguments ls
color
Used by  
Uses  
proc levelset::parameter { ls color } {
    set name .param$ls
    if ![winfo exists $name] {
    toplevel $name -bg $color
    scale $name.time -orient horizontal -bg $color -label "Time step" -from 0.01 -to 1.0 -resolution 0.01 -length 300
    $name.time set [$ls -timestep]
    scale $name.balloon -orient horizontal -bg $color -label "Balloon speed" -from -2.0 -to 2.0 -resolution 0.01 -length 300
    $name.balloon set [$ls -balloon]

    bind $name.time <Enter> "focus $name.time"
    bind $name.balloon <Enter> "focus $name.balloon"
    bind $name.time <ButtonRelease-1> "evaluate \"$ls -timestep \[$name.time get\]\""
    bind $name.time <Left> "evaluate \"$ls -timestep \[$name.time get\]\""
    bind $name.time <Right> "evaluate \"$ls -timestep \[$name.time get\]\""
    bind $name.balloon <ButtonRelease-1> "evaluate \"$ls -balloon \[$name.balloon get\]\""
    bind $name.balloon <Left> "evaluate \"$ls -balloon \[$name.time get\]\""
    bind $name.balloon <Right> "evaluate \"$ls -balloon \[$name.time get\]\""

    button $name.dismiss -bg $color -text "Dismiss" -command "destroy .param$ls"
    pack $name.time $name.balloon $name.dismiss -pady 5
    }
}


levelset::uninstallLevelSet2D
Comments  
Arguments parent
camera
object
Used by  
Uses  
proc levelset::uninstallLevelSet2D { parent camera object } {
    destroy $parent.context.object $parent.context.graphics $parent.context.parameters
}