Changeset 6351
- Timestamp:
- May 18, 2016, 7:37:52 AM (8 years ago)
- Location:
- branches/blt4_trunk
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4_trunk
- Property svn:mergeinfo changed
/branches/1.6 (added) merged: 6282,6291 /trunk merged: 6295-6304,6316,6318,6324-6339,6343-6346,6348
- Property svn:mergeinfo changed
-
branches/blt4_trunk/builder/scripts/templates/clang.tl
r3177 r6351 180 180 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) 181 181 182 install: 183 182 184 clean: 183 185 $(RM) @@FILEROOT@@c run*.xml -
branches/blt4_trunk/builder/scripts/templates/fortran77.tl
r3177 r6351 179 179 $(FC) $(FCFLAGS) $(INCLUDES) $< -o $@ $(LIBS) 180 180 181 install: 182 181 183 clean: 182 184 $(RM) @@FILEROOT@@f77 run*.xml -
branches/blt4_trunk/builder/scripts/templates/java.tl
r3177 r6351 126 126 $(JAVAC) $(CLASSPATH) $< 127 127 128 install: 129 128 130 clean: 129 131 $(RM) @@FILEROOT@@.class run*.xml -
branches/blt4_trunk/examples/mapviewer/layers/add_remove_layers.tcl
r6286 r6351 80 80 81 81 # Update map 82 $mapviewer delete 83 $mapviewer add $map 82 $mapviewer refresh 84 83 puts stderr "Deleted OSM Layer, Added colorramp" 85 84 } … … 95 94 96 95 # Update map 97 $mapviewer delete 98 $mapviewer add $map 96 $mapviewer refresh 99 97 puts stderr "Deleted colorramp Layer, Added line layer" 100 98 } … … 111 109 112 110 # Update map 113 $mapviewer delete 114 $mapviewer add $map 111 $mapviewer refresh 115 112 puts stderr "Deleted line Layer, Added OSM layer" 116 113 } … … 123 120 124 121 # Update map 125 $mapviewer delete 126 $mapviewer add $map 122 $mapviewer refresh 127 123 puts stderr "Added colorramp layer" 128 124 } … … 135 131 136 132 # Update map 137 $mapviewer delete 138 $mapviewer add $map 133 $mapviewer refresh 139 134 puts stderr "Added line layer" 140 135 } -
branches/blt4_trunk/examples/mapviewer/layers/remove_single_layer.tcl
r6286 r6351 85 85 86 86 # Update the map 87 $mapviewer delete 88 $mapviewer add $map 87 $mapviewer refresh 89 88 } 90 89 -
branches/blt4_trunk/examples/mapviewer/placard/placard_disable_example.tcl
r6286 r6351 73 73 74 74 # Make sure the MapViewer rebuilds the map 75 update idletasks 75 $mapviewer refresh 76 76 77 77 # disable the placard for the "stations" layer of $map -
branches/blt4_trunk/gui/apps/launcher.tcl
r5663 r6351 42 42 set params(execute) "" 43 43 set params(input) "" 44 45 set rapptureInfo(cwd) [pwd] 44 46 45 47 if {[info exists env(TOOL_PARAMETERS)]} { -
branches/blt4_trunk/gui/scripts/flowvisviewer.tcl
r6269 r6351 641 641 set op [lindex $args 0] 642 642 switch -- $op { 643 -objects{643 "-objects" { 644 644 # put the dataobj list in order according to -raise options 645 645 set dlist $_dlist … … 656 656 return $dlist 657 657 } 658 -image{658 "-image" { 659 659 if {[llength $args] != 2} { 660 660 error "wrong # args: should be \"get -image view|legend\"" … … 2815 2815 radiobutton $inner.image_button -text "Image File" \ 2816 2816 -variable [itcl::scope _downloadPopup(format)] \ 2817 -font "Arial 9 2817 -font "Arial 9" \ 2818 2818 -value image 2819 2819 Rappture::Tooltip::for $inner.image_button \ -
branches/blt4_trunk/gui/scripts/gauge.tcl
r6021 r6351 636 636 $itk_component(spindn) configure -state $itk_option(-state) 637 637 $itk_component(presets) configure -state $itk_option(-state) 638 if { [info exists itk_component(uq)] } { 639 $itk_component(uq) configure -state $itk_option(-state) 640 } 638 641 _redraw ;# fix gauge 639 642 } … … 756 759 757 760 $popup configure \ 758 -deactivatecommand [itcl::code $this _pop_uq_deactivate]761 -deactivatecommand [itcl::code $this _pop_uq_deactivate] 759 762 } 760 763 update -
branches/blt4_trunk/gui/scripts/map.tcl
r6269 r6351 31 31 32 32 public method addLayer { type name paramArray driver driverParamArray {stylesheet {}} {script {}} {selectors {}} } 33 public method addSelector { layerName selectorName paramArray } 33 34 public method addViewpoint { name props } 34 35 public method clearExtents {} 35 36 public method deleteLayer { layerName } 37 public method deleteSelector { layerName selectorName } 36 38 public method deleteViewpoint { viewpointName } 39 public method dirty { key args } { 40 if {[llength $args] == 0} { 41 if { [info exists _dirty($key)] } { 42 return $_dirty($key) 43 } else { 44 return 0 45 } 46 } else { 47 set _dirty($key) [lindex $args 0] 48 } 49 } 37 50 public method getPlacardConfig { layerName } 38 51 public method hasLayer { layerName } … … 50 63 public method setAttribution { attribution } 51 64 public method setCamera { camera } 65 public method setColormap { layerName colormap } 52 66 public method setDescription { description } 53 67 public method setExtents { xmin ymin xmax ymax {srs "wgs84"} } … … 55 69 public method setPlacardConfig { layerName attrlist style padding } 56 70 public method setProjection { projection } 71 public method setScript { layerName script } 57 72 public method setStyle { style } 73 public method setStylesheet { layerName stylesheet } 58 74 public method setToolInfo { id name command title revision } 59 75 public method setType { type } … … 70 86 private variable _tree ""; # Tree of information about the map. 71 87 private variable _isValid 0; 88 private variable _dirty; 89 array set _dirty { 90 viewpoints 0 91 } 72 92 private common _nextSelector 0; 73 93 private common _layerTypes … … 629 649 array set selector $selectorItem 630 650 if { [info exists selector(id)] } { 631 set id $selector(id)651 set selectorId $selector(id) 632 652 } else { 633 set id "selector[incr _nextSelector]"634 } 635 set snode [$_tree insert $sparent -label $ id]653 set selectorId "selector[incr _nextSelector]" 654 } 655 set snode [$_tree insert $sparent -label $selectorId] 636 656 foreach key { name style styleExpression query queryBounds queryOrderBy } { 637 657 if {[info exists selector($key)]} { … … 765 785 } 766 786 } 787 set _dirty($id) 1 767 788 return $id 768 789 } … … 804 825 } 805 826 $_tree delete $id 827 array unset _dirty $layerName 806 828 } 807 829 … … 868 890 } 869 891 892 itcl::body Rappture::Map::setScript { layerName script } { 893 set id [$_tree findchild root->"layers" $layerName] 894 if { $id < 0 } { 895 error "unknown layer \"$layerName\"" 896 } 897 $_tree set $id "script" $script 898 set _dirty($layerName) 1 899 } 900 901 itcl::body Rappture::Map::setStylesheet { layerName stylesheet } { 902 set id [$_tree findchild root->"layers" $layerName] 903 if { $id < 0 } { 904 error "unknown layer \"$layerName\"" 905 } 906 $_tree set $id "stylesheet" $stylesheet 907 set _dirty($layerName) 1 908 } 909 910 itcl::body Rappture::Map::setColormap { layerName colormap } { 911 set id [$_tree findchild root->"layers" $layerName] 912 if { $id < 0 } { 913 error "unknown layer \"$layerName\"" 914 } 915 $_tree set $id "colorramp.colormap" $colormap 916 set _dirty($layerName) 1 917 } 918 870 919 # ---------------------------------------------------------------------- 871 920 # USAGE: selectors … … 904 953 return 1 905 954 } 955 } 956 957 itcl::body Rappture::Map::addSelector { layerName name params } { 958 set nodeid $name 959 set layerid [$_tree findchild root->"layers" $layerName] 960 if { $layerid < 0 } { 961 error "unknown layer \"$layerName\"" 962 } 963 if {[hasSelector $layerName $nodeid]} { 964 error "Selector '$nodeid' already exists" 965 } 966 set parent [$_tree findchild root->"layers"->"$layerName" "selectors"] 967 if { $parent == "" } { 968 set parent [$_tree insert $layerid -label "selectors"] 969 } 970 set child [$_tree insert $parent -label $nodeid] 971 array set info $params 972 foreach key { name style styleExpression query queryBounds queryOrderBy } { 973 if { [info exists info($key)] && 974 $info($key) != ""} { 975 $_tree set $child $key $info($key) 976 } 977 } 978 set _dirty($layerName) 1 979 } 980 981 itcl::body Rappture::Map::deleteSelector { layerName selectorName } { 982 set id [$_tree findchild root->"layers"->"$layerName"->"selectors" $selectorName] 983 if { $id < 0 } { 984 error "unknown selector \"$selectorName\"" 985 } 986 $_tree delete $id 987 set _dirty($layerName) 1 906 988 } 907 989 … … 971 1053 $_tree set $child z $info(altitude) 972 1054 } 1055 set _dirty(viewpoints) 1 973 1056 } 974 1057 … … 979 1062 } 980 1063 $_tree delete $id 1064 set _dirty(viewpoints) 1 981 1065 } 982 1066 -
branches/blt4_trunk/gui/scripts/mapviewer.tcl
r6284 r6351 61 61 public method parameters {title args} { # do nothing } 62 62 public method placard {option args} 63 public method refresh {} { Rebuild } 63 64 public method scale {args} 64 65 public method select {option {args ""}} … … 857 858 return $dlist 858 859 } 859 -image{860 "-image" { 860 861 if {[llength $args] < 2} { 861 862 error "wrong # args: should be \"get -image view|legend\"" … … 1466 1467 set _layers($tag) 1 1467 1468 SetLayerStyle $dataobj $layer 1468 } 1469 } elseif { [$dataobj dirty $layer] } { 1470 # Recreate layer 1471 # FIXME: retain layer order 1472 SendCmd "map layer delete $tag" 1473 SetLayerStyle $dataobj $layer 1474 } 1475 $dataobj dirty $layer 0 1469 1476 # Don't change visibility of shared/base layers 1470 1477 if { !$info(shared) } { … … 2804 2811 set wfsType "" 2805 2812 SendStylesheetFiles $info(stylesheet) 2813 set ssSize [string length $info(stylesheet)] 2814 set scriptSize [string length $script] 2815 set selectorsSize [string length $selectors] 2806 2816 if { [info exists info(ogr.connection)] } { 2807 set cmd [list map layer add $tag feature db $format $info(ogr.layer) $info(ogr.connection) $info(cache) $ info(stylesheet) $script $selectors]2817 set cmd [list map layer add $tag feature db $format $info(ogr.layer) $info(ogr.connection) $info(cache) $ssSize $scriptSize $selectorsSize] 2808 2818 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2809 2819 lappend cmd $style(-minrange) $style(-maxrange) 2810 2820 } 2811 2821 } else { 2812 set cmd [list map layer add $tag feature $info(driver) $format $wfsType $info(ogr.url) $info(cache) $ info(stylesheet) $script $selectors]2822 set cmd [list map layer add $tag feature $info(driver) $format $wfsType $info(ogr.url) $info(cache) $ssSize $scriptSize $selectorsSize] 2813 2823 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2814 2824 lappend cmd $style(-minrange) $style(-maxrange) … … 2817 2827 } 2818 2828 SendCmd $cmd 2829 if { $ssSize > 0 } { SendData $info(stylesheet) } 2830 if { $scriptSize > 0 } { SendData $script } 2831 if { $selectorsSize > 0} { SendData $selectors } 2819 2832 SendCmd "map layer opacity $style(-opacity) $tag" 2820 2833 } -
branches/blt4_trunk/gui/scripts/mesh.tcl
r5659 r6351 211 211 set result [ReadUnstructuredGrid $path] 212 212 } elseif {[$_mesh element "node"] != "" && [$_mesh element "element"] != ""} { 213 puts stderr "WARNING: <node>/<element> mesh is deprecated. Please use an unstructured mesh instead." 213 214 set result [ReadNodesElements $path] 214 215 } … … 1438 1439 array set node2celltype { 1439 1440 3 5 1440 4 101441 4 9 1441 1442 8 12 1442 1443 6 13 … … 1452 1453 set numNodes [llength $nodeList] 1453 1454 if { ![info exists node2celltype($numNodes)] } { 1454 puts stderr "WARNING: bad node s/elements mesh \$path\": unknown number of indices \"$_numNodes\": should be 3, 4, 5, 6, or 8"1455 puts stderr "WARNING: bad node/element mesh \$path\": unknown number of nodes \"$numNodes\": should be 3, 4, 5, 6, or 8" 1455 1456 return 0 1456 1457 } 1457 1458 set celltype $node2celltype($numNodes) 1459 if { $_dim == 3 && $numNodes == 4 } { 1460 # If mesh is 3D, assume a tetrahedron (default is quad) 1461 # XXX: Does prophet output tets, and if so what is the node order? 1462 set celltype 10 1463 } 1458 1464 append celltypes "$celltype\n" 1459 if { $celltype == 12 } { 1460 # Formerly used voxels instead of hexahedrons. We're converting 1461 # it here to be backward compatible and still fault-tolerant of 1462 # non-axis aligned cells. 1465 if { $celltype == 9 } { 1466 # Fix the node order for quad cells 1467 # (this converts from PROPHET convention to VTK convention) 1468 set newList {} 1469 foreach i { 0 1 3 2 } { 1470 lappend newList [lindex $nodeList $i] 1471 } 1472 set nodeList $newList 1473 } elseif { $celltype == 12 } { 1474 # Fix the node order for hexahedron cells 1475 # (this converts from PROPHET convention to VTK convention) 1463 1476 set newList {} 1464 1477 foreach i { 0 1 3 2 4 5 7 6 } { -
branches/blt4_trunk/gui/scripts/nanovisviewer.tcl
r6269 r6351 462 462 set op [lindex $args 0] 463 463 switch -- $op { 464 -objects{464 "-objects" { 465 465 # put the dataobj list in order according to -raise options 466 466 set dlist $_dlist … … 477 477 return $dlist 478 478 } 479 -image{479 "-image" { 480 480 if {[llength $args] != 2} { 481 481 error "wrong # args: should be \"get -image view|legend\"" … … 1549 1549 } else { 1550 1550 # $n : absolute value, compute relative 1551 lappend list [expr {(double($value)-$min)/($max-$min)]}1551 lappend list [expr {(double($value)-$min)/($max-$min)}] 1552 1552 } 1553 1553 } … … 2029 2029 radiobutton $inner.image_button -text "Image File" \ 2030 2030 -variable [itcl::scope _downloadPopup(format)] \ 2031 -font "Arial 9 2031 -font "Arial 9" \ 2032 2032 -value image 2033 2033 Rappture::Tooltip::for $inner.image_button \ -
branches/blt4_trunk/gui/scripts/probdisteditor.tcl
r6021 r6351 19 19 option add *ProbDistEditor*Entry.width 10 widgetDefault 20 20 21 21 itcl::class Rappture::ProbDistEditor { 22 22 inherit itk::Widget 23 23 24 24 itk_option define -fillcolor fillColor FillColor "" 25 25 26 constructor {args} { # defined below } 26 constructor {args} { 27 # defined below 28 } 27 29 public method value {{newval ""}} 28 30 public method mode {{newval ""}} … … 33 35 protected method _apply {op {widget ""}} 34 36 35 protected variable _dispatcher "" ;# dispatcher for !events36 protected variable _mode "" ;# type of distribution function37 protected variable _value ;# data values for mode-detail38 protected variable _uvalue ;# data values for mode-detail with units39 protected variable _umin ;# minimum allowed value for tool with units40 protected variable _umax ;# maximum allowed value for tool with units41 protected variable _units ;# units for min and max37 protected variable _dispatcher ""; # dispatcher for !events 38 protected variable _mode ""; # type of distribution function 39 protected variable _value; # data values for mode-detail 40 protected variable _uvalue; # data values for mode-detail with units 41 protected variable _umin; # minimum allowed value for tool with units 42 protected variable _umax; # maximum allowed value for tool with units 43 protected variable _units; # units for min and max 42 44 } 43 45 -
branches/blt4_trunk/gui/scripts/responseviewer.tcl
r6032 r6351 147 147 148 148 itcl::body Rappture::ResponseViewer::_plot_response {var1 var2} { 149 #puts "plotting $var1 vs $var2"150 151 set fname response_result.xml152 153 set rs $_response154 if {[catch {exec puq get_response $fname $rs $var1 $var2 $_label} res]} {149 #puts stderr "plotting $var1 vs $var2" 150 global rapptureInfo 151 set fname [file join $rapptureInfo(cwd) "response_result.xml"] 152 if { [catch { 153 exec puq.sh get_response $fname $_response $var1 $var2 $_label 154 } res] != 0 } { 155 155 set fp [open "response.err" r] 156 156 set rdata [read $fp] 157 157 close $fp 158 puts "Surrogate Model failed: $res\n$rdata"158 puts stderr "Surrogate Model failed: $res\n$rdata" 159 159 error "Sampling of Surrogate Model failed: $res\n$rdata" 160 160 # FIXME: Maybe put in text box instead of error()? … … 163 163 164 164 set xmlobj [Rappture::library $fname] 165 #puts "xmlobj=$xmlobj"165 #puts stderr "xmlobj=$xmlobj" 166 166 set w $itk_component(frame).field 167 167 -
branches/blt4_trunk/gui/scripts/transferfunctioneditor.tcl
r5640 r6351 42 42 private method GetScreenPosition { name } 43 43 private method LeaveTick { name } 44 private method SetRelativeValue 45 private method GetRelativeValue 44 private method SetRelativeValue { name x } 45 private method GetRelativeValue { name } 46 46 private method RemoveDuplicateMarkers {name x y} 47 47 private method SetScreenPosition { name } … … 225 225 } 226 226 227 itcl::body Rappture::TransferFunctionEditor::GetRelativeValue 227 itcl::body Rappture::TransferFunctionEditor::GetRelativeValue { name } { 228 228 return $_values($name) 229 229 } 230 230 231 itcl::body Rappture::TransferFunctionEditor::SetRelativeValue { name value } { 231 itcl::body Rappture::TransferFunctionEditor::SetRelativeValue { name value } { 232 if {$value < 0.0} { 233 set value 0.0 234 } elseif {$value > 1.0} { 235 set value 1.0 236 } 232 237 set _values($name) $value 233 238 set x [GetScreenPosition $name] -
branches/blt4_trunk/gui/scripts/visviewer.tcl
r6052 r6351 20 20 itk_option define -receivecommand receiveCommand ReceiveCommand "" 21 21 22 private common _servers ;# array of visualization server lists23 set _servers(geovis) "localhost:2015"24 set _servers(nanovis) "localhost:2000"25 set _servers(pymol) "localhost:2020"26 set _servers(vmdmds) "localhost:2018"27 set _servers(vtkvis) "localhost:2010"28 29 private common _done ; # Used to indicate status of send.30 private variable _buffer ; # buffer for incoming/outgoing commands31 private variable _outbuf ; # buffer for outgoing commands32 private variable _blockOnWrite 0; # Should writes to socket block?33 private variable _initialized34 private variable _isOpen 035 private variable _afterId -136 private variable _icon 037 private variable _trace 0 ; # Protocol tracing for console38 private variable _logging 0 ; # Command logging to file39 # Number of milliseconds to wait before idle timeout. If greater than 0,40 # automatically disconnect from the visualization server when idle timeout41 # is reached.42 private variable _idleTimeout 43200000; # 12 hours43 #private variable _idleTimeout 5000; # 5 seconds44 #private variable _idleTimeout 0; # No timeout45 46 protected variable _debug 047 protected variable _serverType "???";# Type of server.48 protected variable _sid "" ; # socket connection to server49 protected variable _maxConnects 10050 protected variable _buffering 051 protected variable _cmdSeq 0 ; # Command sequence number52 protected variable _dispatcher ""; # dispatcher for !events53 protected variable _hosts "" ; # list of hosts for server54 protected variable _parser "" ; # interpreter for incoming commands55 protected variable _image56 protected variable _hostname57 protected variable _numConnectTries 058 protected variable _debugConsole 059 protected variable _reportClientInfo 160 # Number of milliscends to wait for server reply before displaying wait61 # dialog. If set to 0, dialog is never displayed.62 protected variable _waitTimeout 063 64 22 constructor { args } { 65 23 # defined below … … 68 26 # defined below 69 27 } 70 # Used internally only. 71 private method BuildConsole {} 72 private method DebugConsole {} 73 private method HideConsole {} 74 private method ReceiveHelper {} 75 private method SendDebugCommand {} 76 private method SendHelper {} 77 private method ServerDown {} 78 private method Shuffle { servers } 79 private method TraceComm { channel {data {}} } 80 private method WaitDialog { state } 81 private method Waiting { option widget } 28 public proc GetServerList { type } { 29 return $_servers($type) 30 } 31 public proc SetServerList { type namelist } { 32 # Convert the comma separated list into a Tcl list. OGRE also adds 33 # a trailing comma that we want to ignore. 34 regsub -all "," $namelist " " namelist 35 CheckNameList $namelist 36 set _servers($type) $namelist 37 } 38 public proc RemoveServerFromList { type server } { 39 if { ![info exists _servers($type)] } { 40 error "unknown server type \"$type\"" 41 } 42 set i [lsearch $_servers($type) $server] 43 if { $i < 0 } { 44 return 45 } 46 set _servers($type) [lreplace $_servers($type) $i $i] 47 } 48 public proc SetPymolServerList { namelist } { 49 SetServerList "pymol" $namelist 50 } 51 public proc SetNanovisServerList { namelist } { 52 SetServerList "nanovis" $namelist 53 } 54 public proc SetVtkServerList { namelist } { 55 SetServerList "vtk" $namelist 56 } 82 57 83 58 protected method CheckConnection {} … … 117 92 protected method ToggleConsole {} 118 93 94 protected variable _debug 0 95 protected variable _serverType "???";# Type of server. 96 protected variable _sid ""; # socket connection to server 97 protected variable _maxConnects 100 98 protected variable _buffering 0 99 protected variable _cmdSeq 0; # Command sequence number 100 protected variable _dispatcher ""; # dispatcher for !events 101 protected variable _hosts ""; # list of hosts for server 102 protected variable _parser ""; # interpreter for incoming commands 103 protected variable _image 104 protected variable _hostname 105 protected variable _numConnectTries 0 106 protected variable _debugConsole 0 107 protected variable _reportClientInfo 1 108 # Number of milliscends to wait for server reply before displaying wait 109 # dialog. If set to 0, dialog is never displayed. 110 protected variable _waitTimeout 0 111 112 private method BuildConsole {} 113 private method DebugConsole {} 114 private method HideConsole {} 115 private method ReceiveHelper {} 116 private method SendDebugCommand {} 117 private method SendHelper {} 118 private method ServerDown {} 119 private method Shuffle { servers } 120 private method TraceComm { channel {data {}} } 121 private method WaitDialog { state } 122 private method Waiting { option widget } 123 119 124 private proc CheckNameList { namelist } { 120 125 foreach host $namelist { … … 125 130 } 126 131 } 127 public proc GetServerList { type } { 128 return $_servers($type) 129 } 130 public proc SetServerList { type namelist } { 131 # Convert the comma separated list into a Tcl list. OGRE also adds 132 # a trailing comma that we want to ignore. 133 regsub -all "," $namelist " " namelist 134 CheckNameList $namelist 135 set _servers($type) $namelist 136 } 137 public proc RemoveServerFromList { type server } { 138 if { ![info exists _servers($type)] } { 139 error "unknown server type \"$type\"" 140 } 141 set i [lsearch $_servers($type) $server] 142 if { $i < 0 } { 143 return 144 } 145 set _servers($type) [lreplace $_servers($type) $i $i] 146 } 147 public proc SetPymolServerList { namelist } { 148 SetServerList "pymol" $namelist 149 } 150 public proc SetNanovisServerList { namelist } { 151 SetServerList "nanovis" $namelist 152 } 153 public proc SetVtkServerList { namelist } { 154 SetServerList "vtk" $namelist 155 } 132 133 private variable _buffer; # buffer for incoming/outgoing commands 134 private variable _outbuf; # buffer for outgoing commands 135 private variable _blockOnWrite 0; # Should writes to socket block? 136 private variable _initialized 137 private variable _isOpen 0 138 private variable _afterId -1 139 private variable _icon 0 140 private variable _trace 0; # Protocol tracing for console 141 private variable _logging 0; # Command logging to file 142 # Number of milliseconds to wait before idle timeout. If greater than 0, 143 # automatically disconnect from the visualization server when idle timeout 144 # is reached. 145 private variable _idleTimeout 43200000; # 12 hours 146 #private variable _idleTimeout 5000;# 5 seconds 147 #private variable _idleTimeout 0; # No timeout 148 149 private common _servers; # array of visualization server lists 150 set _servers(geovis) "localhost:2015" 151 set _servers(nanovis) "localhost:2000" 152 set _servers(pymol) "localhost:2020" 153 set _servers(vmdmds) "localhost:2018" 154 set _servers(vtkvis) "localhost:2010" 155 private common _done; # Used to indicate status of send. 156 156 } 157 157 … … 864 864 -xscrollmode auto -yscrollmode auto 865 865 text $inner.scrl.text \ 866 -font "Arial 9 866 -font "Arial 9" -background white -relief sunken -bd 1 \ 867 867 -height 5 -wrap word -width 60 868 868 $inner.scrl contents $inner.scrl.text -
branches/blt4_trunk/gui/scripts/vtkglyphviewer.tcl
r6252 r6351 102 102 private method ReceiveDataset { args } 103 103 private method ReceiveImage { args } 104 private method ReceiveLegend { colormap title vmin vmax size }104 private method ReceiveLegend { colormap title min max size } 105 105 private method RequestLegend {} 106 106 private method Rotate {option x y} … … 151 151 private variable _rotatePending 0 152 152 private variable _cutplanePending 0 153 private variable _field ""154 153 private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar) 155 154 private variable _fields … … 591 590 } 592 591 array set params $settings 593 set params(-description) ""594 set params(-param) ""595 array set params $settings596 592 597 593 if {$params(-color) == "auto" || $params(-color) == "autoreset"} { … … 691 687 return $dlist 692 688 } 693 -image{689 "-image" { 694 690 if {[llength $args] != 2} { 695 691 error "wrong # args: should be \"get -image view\"" … … 705 701 } 706 702 default { 707 error "bad option \"$op\": should be -objects or -image"703 error "bad option \"$op\": should be -objects, -visible or -image" 708 704 } 709 705 } … … 2212 2208 SendCmd "camera zoom $_view($what)" 2213 2209 } 2214 2210 } 2215 2211 } 2216 2212 } … … 2246 2242 radiobutton $inner.vtk_button -text "VTK data file" \ 2247 2243 -variable [itcl::scope _downloadPopup(format)] \ 2248 -font "Arial 9 2244 -font "Arial 9" \ 2249 2245 -value vtk 2250 2246 Rappture::Tooltip::for $inner.vtk_button "Save as VTK data file." 2251 2247 radiobutton $inner.image_button -text "Image File" \ 2252 2248 -variable [itcl::scope _downloadPopup(format)] \ 2253 -font "Arial 9 2249 -font "Arial 9" \ 2254 2250 -value image 2255 2251 Rappture::Tooltip::for $inner.image_button \ -
branches/blt4_trunk/gui/scripts/vtkheightmapviewer.tcl
r6269 r6351 71 71 private method BuildDownloadPopup { widget command } 72 72 private method CameraReset {} 73 private method Combo { option }74 73 private method Connect {} 75 74 private method CurrentDatasets {args} … … 88 87 private method IsValidObject { dataobj } 89 88 private method LeaveLegend {} 89 private method LegendTitleAction { option } 90 90 private method MotionLegend { x y } 91 91 private method Pan {option x y} … … 214 214 215 215 array set _settings { 216 -ax isflymode "static"216 -axesvisible 1 217 217 -axislabels 1 218 218 -axisminorticks 1 219 -axis visible 1219 -axismode "static" 220 220 -colormap BCGYR 221 221 -colormapdiscrete 0 … … 243 243 array set _changed { 244 244 -colormap 0 245 -colormapdiscrete 0 246 -colormapvisible 0 247 -edges 0 248 -isolinecolor 0 249 -isolinesvisible 0 245 250 -numisolines 0 246 251 -opacity 0 252 -wireframe 0 247 253 } 248 254 itk_component add view { … … 483 489 } 484 490 array set params $settings 485 set params(-description) ""486 set params(-param) ""487 array set params $settings488 491 489 492 if {$params(-color) == "auto" || $params(-color) == "autoreset"} { … … 583 586 return $dlist 584 587 } 585 -image{588 "-image" { 586 589 if {[llength $args] != 2} { 587 590 error "wrong # args: should be \"get -image view\"" … … 597 600 } 598 601 default { 599 error "bad option \"$op\": should be -objects or -image"602 error "bad option \"$op\": should be -objects, -visible or -image" 600 603 } 601 604 } … … 1017 1020 -activeforeground $itk_option(-plotforeground) \ 1018 1021 -font "Arial 8" \ 1019 -command [itcl::code $this Combo invoke]1022 -command [itcl::code $this LegendTitleAction save] 1020 1023 set _fields($fname) [list $label $units $components] 1021 1024 if { $_curFldName == "" } { … … 1090 1093 PanCamera 1091 1094 InitSettings -xgrid -ygrid -zgrid \ 1092 -ax isvisible -axislabels -heightmapscale -field -isheightmap \1095 -axesvisible -axislabels -heightmapscale -field -isheightmap \ 1093 1096 -numisolines 1094 1097 if { [array size _fields] < 2 } { … … 1351 1354 } 1352 1355 switch -- $what { 1353 "-axisflymode" { 1354 set mode [$itk_component(axisflymode) value] 1355 set mode [$itk_component(axisflymode) translate $mode] 1356 set _settings($what) $mode 1357 SendCmd "axis flymode $mode" 1356 "-axesvisible" { 1357 set bool $_settings($what) 1358 SendCmd "axis visible all $bool" 1358 1359 } 1359 1360 "-axislabels" { … … 1365 1366 SendCmd "axis minticks all $bool" 1366 1367 } 1367 "-axisvisible" { 1368 set bool $_settings($what) 1369 SendCmd "axis visible all $bool" 1368 "-axismode" { 1369 set mode [$itk_component(axismode) value] 1370 set mode [$itk_component(axismode) translate $mode] 1371 set _settings($what) $mode 1372 SendCmd "axis flymode $mode" 1370 1373 } 1371 1374 "-background" { … … 1391 1394 if { $color == "none" } { 1392 1395 if { $_settings(-colormapvisible) } { 1396 set _changed(-colormapvisible) 1 1393 1397 SendCmd "heightmap surface 0" 1394 1398 set _settings(-colormapvisible) 0 … … 1396 1400 } else { 1397 1401 if { !$_settings(-colormapvisible) } { 1402 set _changed(-colormapvisible) 1 1398 1403 SendCmd "heightmap surface 1" 1399 1404 set _settings(-colormapvisible) 1 … … 1408 1413 EventuallyRequestLegend 1409 1414 } 1410 "-colormapvisible" {1411 set bool $_settings($what)1412 SendCmd "heightmap surface $bool"1413 }1414 1415 "-colormapdiscrete" { 1416 set _changed($what) 1 1415 1417 set bool $_settings($what) 1416 1418 set numColors [expr $_settings(-numisolines) + 1] … … 1428 1430 EventuallyRequestLegend 1429 1431 } 1432 "-colormapvisible" { 1433 set _changed($what) 1 1434 set bool $_settings($what) 1435 SendCmd "heightmap surface $bool" 1436 } 1430 1437 "-edges" { 1438 set _changed($what) 1 1431 1439 set bool $_settings($what) 1432 1440 SendCmd "heightmap edges $bool" … … 1574 1582 } 1575 1583 "-isolinecolor" { 1584 set _changed($what) 1 1576 1585 set color [$itk_component(isolinecolor) value] 1577 1586 if { $color == "none" } { 1578 1587 if { $_settings(-isolinesvisible) } { 1588 set _changed(-isolinesvisible) 1 1579 1589 SendCmd "heightmap isolines 0" 1580 1590 set _settings(-isolinesvisible) 0 1581 1591 } 1582 1592 } else { 1593 set _settings($what) $color 1583 1594 if { !$_settings(-isolinesvisible) } { 1595 set _changed(-isolinesvisible) 1 1584 1596 SendCmd "heightmap isolines 1" 1585 1597 set _settings(-isolinesvisible) 1 … … 1590 1602 } 1591 1603 "-isolinesvisible" { 1604 set _changed($what) 1 1592 1605 set bool $_settings($what) 1606 set color [$itk_component(isolinecolor) value] 1607 if { $bool && $color != $_settings(-isolinecolor)} { 1608 $itk_component(isolinecolor) value $_settings(-isolinecolor) 1609 } 1593 1610 SendCmd "heightmap isolines $bool" 1594 1611 DrawLegend … … 1634 1651 } 1635 1652 "-outline" { 1653 set _changed($what) 1 1636 1654 if { $_settings(-isheightmap) } { 1637 1655 SendCmd "outline visible 0" … … 1657 1675 } 1658 1676 "-wireframe" { 1677 set _changed($what) 1 1659 1678 set bool $_settings($what) 1660 1679 SendCmd "heightmap wireframe $bool" … … 1717 1736 set cmap $_currentColormap 1718 1737 if { ![info exists _colormaps($cmap)] } { 1719 BuildColormap $cmap1720 set _colormaps($cmap) 11738 BuildColormap $cmap 1739 set _colormaps($cmap) 1 1721 1740 } 1722 1741 #SendCmd "legend $cmap scalar $_curFldName {} $w $h 0" … … 2034 2053 checkbutton $inner.visible \ 2035 2054 -text "Axes" \ 2036 -variable [itcl::scope _settings(-ax isvisible)] \2037 -command [itcl::code $this AdjustSetting -ax isvisible] \2055 -variable [itcl::scope _settings(-axesvisible)] \ 2056 -command [itcl::code $this AdjustSetting -axesvisible] \ 2038 2057 -font "Arial 9" 2039 2058 checkbutton $inner.labels \ … … 2066 2085 label $inner.mode_l -text "Mode" -font "Arial 9" 2067 2086 2068 itk_component add axis flymode {2087 itk_component add axismode { 2069 2088 Rappture::Combobox $inner.mode -width 10 -editable 0 2070 2089 } … … 2074 2093 "furthest_triad" "farthest" \ 2075 2094 "outer_edges" "outer" 2076 $itk_component(axis flymode) value $_settings(-axisflymode)2077 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axis flymode]2095 $itk_component(axismode) value $_settings(-axismode) 2096 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axismode] 2078 2097 2079 2098 blt::table $inner \ … … 2212 2231 radiobutton $inner.vtk_button -text "VTK data file" \ 2213 2232 -variable [itcl::scope _downloadPopup(format)] \ 2214 -font "Arial 9 2233 -font "Arial 9" \ 2215 2234 -value vtk 2216 2235 Rappture::Tooltip::for $inner.vtk_button "Save as VTK data file." 2217 2236 radiobutton $inner.image_button -text "Image File" \ 2218 2237 -variable [itcl::scope _downloadPopup(format)] \ 2219 -font "Arial 9 2238 -font "Arial 9" \ 2220 2239 -value image 2221 2240 Rappture::Tooltip::for $inner.image_button \ … … 2258 2277 set tag $dataobj-$comp 2259 2278 array set style { 2260 -color BCGYR 2261 -levels 10 2262 -opacity 1.0 2279 -color BCGYR 2280 -colormapvisible 1 2281 -edgecolor black 2282 -edges 0 2283 -isolinecolor black 2284 -isolinesvisible 1 2285 -isolinewidth 1.0 2286 -levels 10 2287 -linewidth 1.0 2288 -opacity 1.0 2289 -outline 0 2290 -wireframe 0 2263 2291 } 2264 2292 set stylelist [$dataobj style $comp] … … 2298 2326 DrawLegend 2299 2327 } 2328 foreach setting {-edges -outline -wireframe \ 2329 -colormapvisible -isolinecolor -isolinesvisible} { 2330 if {$_changed($setting)} { 2331 # User-modified UI setting overrides style 2332 set style($setting) $_settings($setting) 2333 } else { 2334 # Set UI control to style setting (tool provided or default) 2335 set _settings($setting) $style($setting) 2336 } 2337 } 2338 2300 2339 SendCmd "outline add $tag" 2301 2340 SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag" 2302 SendCmd "outline visible $_settings(-outline) $tag" 2341 SendCmd "outline visible $style(-outline) $tag" 2342 2303 2343 set scale [GetHeightmapScale] 2304 2344 SendCmd "[list heightmap add contourlist $_contourList $scale $tag]" 2305 2345 set _comp2scale($tag) $_settings(-heightmapscale) 2306 SendCmd "heightmap edges $_settings(-edges) $tag" 2307 SendCmd "heightmap wireframe $_settings(-wireframe) $tag" 2346 SendCmd "heightmap edges $style(-edges) $tag" 2347 SendCmd "heightmap linecolor [Color2RGB $style(-edgecolor)] $tag" 2348 SendCmd "heightmap linewidth $style(-linewidth) $tag" 2349 SendCmd "heightmap wireframe $style(-wireframe) $tag" 2308 2350 SetCurrentColormap $style(-color) 2309 set color [$itk_component(isolinecolor) value] 2310 SendCmd "heightmap isolinecolor [Color2RGB $color] $tag" 2351 SendCmd "heightmap isolinecolor [Color2RGB $style(-isolinecolor)] $tag" 2352 $itk_component(isolinecolor) value $style(-isolinecolor) 2353 SendCmd "heightmap isolinewidth $style(-isolinewidth) $tag" 2311 2354 SendCmd "heightmap lighting $_settings(-isheightmap) $tag" 2312 SendCmd "heightmap isolines $ _settings(-isolinesvisible) $tag"2313 SendCmd "heightmap surface $ _settings(-colormapvisible) $tag"2355 SendCmd "heightmap isolines $style(-isolinesvisible) $tag" 2356 SendCmd "heightmap surface $style(-colormapvisible) $tag" 2314 2357 SendCmd "heightmap opacity $style(-opacity) $tag" 2315 2358 set _settings(-opacity) [expr $style(-opacity) * 100.0] … … 2349 2392 # DrawLegend -- 2350 2393 # 2351 # Draws the legend in theown canvas on the right side of the plot area.2394 # Draws the legend in its own canvas on the right side of the plot area. 2352 2395 # 2353 2396 itcl::body Rappture::VtkHeightmapViewer::DrawLegend {} { … … 2437 2480 } 2438 2481 2439 $c bind title <ButtonPress> [itcl::code $this Combopost]2440 $c bind title <Enter> [itcl::code $this Combo activate]2441 $c bind title <Leave> [itcl::code $this Combo deactivate]2482 $c bind title <ButtonPress> [itcl::code $this LegendTitleAction post] 2483 $c bind title <Enter> [itcl::code $this LegendTitleAction enter] 2484 $c bind title <Leave> [itcl::code $this LegendTitleAction leave] 2442 2485 # Reset the item coordinates according the current size of the plot. 2443 2486 if { [info exists _limits($_curFldName)] } { … … 2553 2596 2554 2597 # ---------------------------------------------------------------------- 2555 # USAGE: _dropdown post 2556 # USAGE: _dropdown unpost 2557 # USAGE: _dropdown select 2558 # 2559 # Used internally to handle the dropdown list for this combobox. The 2560 # post/unpost options are invoked when the list is posted or unposted 2561 # to manage the relief of the controlling button. The select option 2562 # is invoked whenever there is a selection from the list, to assign 2563 # the value back to the gauge. 2564 # ---------------------------------------------------------------------- 2565 itcl::body Rappture::VtkHeightmapViewer::Combo {option} { 2598 # USAGE: LegendTitleAction post 2599 # USAGE: LegendTitleAction enter 2600 # USAGE: LegendTitleAction leave 2601 # USAGE: LegendTitleAction save 2602 # 2603 # Used internally to handle the dropdown list for the fields menu combobox. 2604 # The post option is invoked when the field title is pressed to launch the 2605 # dropdown. The enter option is invoked when the user mouses over the field 2606 # title. The leave option is invoked when the user moves the mouse away 2607 # from the field title. The save option is invoked whenever there is a 2608 # selection from the list, to alert the visualization server. 2609 # ---------------------------------------------------------------------- 2610 itcl::body Rappture::VtkHeightmapViewer::LegendTitleAction {option} { 2566 2611 set c $itk_component(view) 2567 2612 switch -- $option { … … 2573 2618 tk_popup $itk_component(fieldmenu) $x $y 2574 2619 } 2575 activate{2620 enter { 2576 2621 $c itemconfigure title -fill red 2577 2622 } 2578 deactivate {2623 leave { 2579 2624 $c itemconfigure title -fill $itk_option(-plotforeground) 2580 2625 } 2581 invoke {2626 save { 2582 2627 $itk_component(field) value $_curFldLabel 2583 2628 AdjustSetting -field 2584 2629 } 2585 2630 default { 2586 error "bad option \"$option\": should be post, unpost, select"2631 error "bad option \"$option\": should be post, enter, leave or save" 2587 2632 } 2588 2633 } -
branches/blt4_trunk/gui/scripts/vtkimageviewer.tcl
r6269 r6351 70 70 private method BuildImageTab {} 71 71 private method BuildDownloadPopup { widget command } 72 private method Combo { option }73 72 private method Connect {} 74 73 private method CurrentDatasets {args} … … 86 85 private method IsValidObject { dataobj } 87 86 private method LeaveLegend {} 87 private method LegendTitleAction { option } 88 88 private method MotionLegend { x y } 89 89 private method Pan {option x y} … … 209 209 210 210 array set _settings { 211 -ax isflymode "static"211 -axesvisible 1 212 212 -axislabels 1 213 213 -axisminorticks 1 214 -axis visible 1214 -axismode "static" 215 215 -backingcolor white 216 216 -backingvisible 1 … … 473 473 } 474 474 array set params $settings 475 set params(-description) ""476 set params(-param) ""477 array set params $settings478 475 479 476 if {$params(-color) == "auto" || $params(-color) == "autoreset"} { … … 573 570 return $dlist 574 571 } 575 -image{572 "-image" { 576 573 if {[llength $args] != 2} { 577 574 error "wrong # args: should be \"get -image view\"" … … 587 584 } 588 585 default { 589 error "bad option \"$op\": should be -objects or -image"586 error "bad option \"$op\": should be -objects, -visible or -image" 590 587 } 591 588 } … … 990 987 -activeforeground $itk_option(-plotforeground) \ 991 988 -font "Arial 8" \ 992 -command [itcl::code $this Combo invoke]989 -command [itcl::code $this LegendTitleAction save] 993 990 set _fields($fname) [list $label $units $components] 994 991 if { $_curFldName == "" } { … … 1047 1044 PanCamera 1048 1045 InitSettings -xgrid -ygrid -zgrid \ 1049 -ax isvisible -axislabels -field -view3d1046 -axesvisible -axislabels -field -view3d 1050 1047 if { [array size _fields] < 2 } { 1051 1048 catch {blt::table forget $itk_component(field) $itk_component(field_l)} … … 1298 1295 } 1299 1296 switch -- $what { 1300 "-axisflymode" { 1301 set mode [$itk_component(axisflymode) value] 1302 set mode [$itk_component(axisflymode) translate $mode] 1303 set _settings($what) $mode 1304 SendCmd "axis flymode $mode" 1297 "-axesvisible" { 1298 set bool $_settings($what) 1299 SendCmd "axis visible all $bool" 1305 1300 } 1306 1301 "-axislabels" { … … 1312 1307 SendCmd "axis minticks all $bool" 1313 1308 } 1314 "-axisvisible" { 1315 set bool $_settings($what) 1316 SendCmd "axis visible all $bool" 1309 "-axismode" { 1310 set mode [$itk_component(axismode) value] 1311 set mode [$itk_component(axismode) translate $mode] 1312 set _settings($what) $mode 1313 SendCmd "axis flymode $mode" 1317 1314 } 1318 1315 "-background" { … … 1396 1393 SendCmd "camera reset" 1397 1394 DrawLegend 1395 } 1396 "-legendvisible" { 1397 if { !$_settings($what) } { 1398 $itk_component(view) delete legend 1399 } 1400 DrawLegend 1401 } 1402 "-level" { 1403 set val $_settings($what) 1404 SendCmd "image level $val" 1405 } 1406 "-opacity" { 1407 set _changed($what) 1 1408 if { $_settings(-view3d) } { 1409 set _settings(-saveopacity) $_settings($what) 1410 set val [expr $_settings($what) * 0.01] 1411 SendCmd "image opacity $val" 1412 } else { 1413 SendCmd "image opacity 1.0" 1414 } 1415 } 1416 "-outline" { 1417 set bool $_settings($what) 1418 SendCmd "outline visible $bool" 1419 } 1420 "-stretchtofit" { 1421 set bool $_settings($what) 1422 if { $bool } { 1423 if { $_settings(-view3d) } { 1424 SendCmd "camera aspect native" 1425 } else { 1426 SendCmd "camera aspect window" 1427 } 1428 } else { 1429 SendCmd "camera aspect native" 1430 } 1398 1431 } 1399 1432 "-view3d" { … … 1451 1484 set val $_settings($what) 1452 1485 SendCmd "image window $val" 1453 }1454 "-level" {1455 set val $_settings($what)1456 SendCmd "image level $val"1457 }1458 "-legendvisible" {1459 if { !$_settings($what) } {1460 $itk_component(view) delete legend1461 }1462 DrawLegend1463 }1464 "-opacity" {1465 set _changed($what) 11466 if { $_settings(-view3d) } {1467 set _settings(-saveopacity) $_settings($what)1468 set val [expr $_settings($what) * 0.01]1469 SendCmd "image opacity $val"1470 } else {1471 SendCmd "image opacity 1.0"1472 }1473 }1474 "-outline" {1475 set bool $_settings($what)1476 SendCmd "outline visible $bool"1477 }1478 "-stretchtofit" {1479 set bool $_settings($what)1480 if { $bool } {1481 if { $_settings(-view3d) } {1482 SendCmd "camera aspect native"1483 } else {1484 SendCmd "camera aspect window"1485 }1486 } else {1487 SendCmd "camera aspect native"1488 }1489 1486 } 1490 1487 "-xgrid" - "-ygrid" - "-zgrid" { … … 1798 1795 checkbutton $inner.visible \ 1799 1796 -text "Axes" \ 1800 -variable [itcl::scope _settings(-ax isvisible)] \1801 -command [itcl::code $this AdjustSetting -ax isvisible] \1797 -variable [itcl::scope _settings(-axesvisible)] \ 1798 -command [itcl::code $this AdjustSetting -axesvisible] \ 1802 1799 -font "Arial 9" 1803 1800 checkbutton $inner.labels \ … … 1830 1827 label $inner.mode_l -text "Mode" -font "Arial 9" 1831 1828 1832 itk_component add axis flymode {1829 itk_component add axismode { 1833 1830 Rappture::Combobox $inner.mode -width 10 -editable 0 1834 1831 } … … 1838 1835 "furthest_triad" "farthest" \ 1839 1836 "outer_edges" "outer" 1840 $itk_component(axis flymode) value $_settings(-axisflymode)1841 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axis flymode]1837 $itk_component(axismode) value $_settings(-axismode) 1838 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axismode] 1842 1839 1843 1840 blt::table $inner \ … … 1976 1973 radiobutton $inner.vtk_button -text "VTK data file" \ 1977 1974 -variable [itcl::scope _downloadPopup(format)] \ 1978 -font "Arial 9 1975 -font "Arial 9" \ 1979 1976 -value vtk 1980 1977 Rappture::Tooltip::for $inner.vtk_button "Save as VTK data file." 1981 1978 radiobutton $inner.image_button -text "Image File" \ 1982 1979 -variable [itcl::scope _downloadPopup(format)] \ 1983 -font "Arial 9 1980 -font "Arial 9" \ 1984 1981 -value image 1985 1982 Rappture::Tooltip::for $inner.image_button \ … … 2095 2092 # DrawLegend -- 2096 2093 # 2097 # Draws the legend in theown canvas on the right side of the plot area.2094 # Draws the legend in its own canvas on the right side of the plot area. 2098 2095 # 2099 2096 itcl::body Rappture::VtkImageViewer::DrawLegend {} { … … 2156 2153 set x1 [expr $x2 - ($iw*12)/10] 2157 2154 2158 $c bind title <ButtonPress> [itcl::code $this Combopost]2159 $c bind title <Enter> [itcl::code $this Combo activate]2160 $c bind title <Leave> [itcl::code $this Combo deactivate]2155 $c bind title <ButtonPress> [itcl::code $this LegendTitleAction post] 2156 $c bind title <Enter> [itcl::code $this LegendTitleAction enter] 2157 $c bind title <Leave> [itcl::code $this LegendTitleAction leave] 2161 2158 # Reset the item coordinates according the current size of the plot. 2162 2159 if { [info exists _limits($_curFldName)] } { … … 2272 2269 2273 2270 # ---------------------------------------------------------------------- 2274 # USAGE: _dropdown post 2275 # USAGE: _dropdown unpost 2276 # USAGE: _dropdown select 2277 # 2278 # Used internally to handle the dropdown list for this combobox. The 2279 # post/unpost options are invoked when the list is posted or unposted 2280 # to manage the relief of the controlling button. The select option 2281 # is invoked whenever there is a selection from the list, to assign 2282 # the value back to the gauge. 2283 # ---------------------------------------------------------------------- 2284 itcl::body Rappture::VtkImageViewer::Combo {option} { 2271 # USAGE: LegendTitleAction post 2272 # USAGE: LegendTitleAction enter 2273 # USAGE: LegendTitleAction leave 2274 # USAGE: LegendTitleAction save 2275 # 2276 # Used internally to handle the dropdown list for the fields menu combobox. 2277 # The post option is invoked when the field title is pressed to launch the 2278 # dropdown. The enter option is invoked when the user mouses over the field 2279 # title. The leave option is invoked when the user moves the mouse away 2280 # from the field title. The save option is invoked whenever there is a 2281 # selection from the list, to alert the visualization server. 2282 # ---------------------------------------------------------------------- 2283 itcl::body Rappture::VtkImageViewer::LegendTitleAction {option} { 2285 2284 set c $itk_component(view) 2286 2285 switch -- $option { … … 2292 2291 tk_popup $itk_component(fieldmenu) $x $y 2293 2292 } 2294 activate{2293 enter { 2295 2294 $c itemconfigure title -fill red 2296 2295 } 2297 deactivate {2296 leave { 2298 2297 $c itemconfigure title -fill $itk_option(-plotforeground) 2299 2298 } 2300 invoke {2299 save { 2301 2300 $itk_component(field) value $_curFldLabel 2302 2301 AdjustSetting -field 2303 2302 } 2304 2303 default { 2305 error "bad option \"$option\": should be post, unpost, select"2304 error "bad option \"$option\": should be post, enter, leave or save" 2306 2305 } 2307 2306 } -
branches/blt4_trunk/gui/scripts/vtkisosurfaceviewer.tcl
r6252 r6351 107 107 private method ReceiveDataset { args } 108 108 private method ReceiveImage { args } 109 private method ReceiveLegend { colormap title vmin vmax size }109 private method ReceiveLegend { colormap title min max size } 110 110 private method RequestLegend {} 111 111 private method Rotate {option x y} … … 160 160 private variable _rotatePending 0 161 161 private variable _cutplanePending 0 162 private variable _field ""163 162 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 164 163 private variable _fields … … 618 617 } 619 618 array set params $settings 620 set params(-description) ""621 set params(-param) ""622 array set params $settings623 619 624 620 if {$params(-color) == "auto" || $params(-color) == "autoreset"} { … … 718 714 return $dlist 719 715 } 720 -image{716 "-image" { 721 717 if {[llength $args] != 2} { 722 718 error "wrong # args: should be \"get -image view\"" … … 732 728 } 733 729 default { 734 error "bad option \"$op\": should be -objects or -image"730 error "bad option \"$op\": should be -objects, -visible or -image" 735 731 } 736 732 } … … 1505 1501 } 1506 1502 "-isolinecolor" { 1507 set color [$itk_component(isoline Color) value]1503 set color [$itk_component(isolinecolor) value] 1508 1504 set _settings($what) $color 1509 1505 DrawLegend … … 1741 1737 1742 1738 label $inner.linecolor_l -text "Isolines" -font "Arial 9" 1743 itk_component add isoline Color {1739 itk_component add isolinecolor { 1744 1740 Rappture::Combobox $inner.linecolor -width 10 -editable 0 1745 1741 } … … 1756 1752 "none" "none" 1757 1753 1758 $itk_component(isoline Color) value "white"1754 $itk_component(isolinecolor) value $_settings(-isolinecolor) 1759 1755 bind $inner.linecolor <<Value>> \ 1760 1756 [itcl::code $this AdjustSetting -isolinecolor] … … 2184 2180 SendCmd "camera zoom $_view($what)" 2185 2181 } 2186 2182 } 2187 2183 } 2188 2184 } … … 2218 2214 radiobutton $inner.vtk_button -text "VTK data file" \ 2219 2215 -variable [itcl::scope _downloadPopup(format)] \ 2220 -font "Arial 9 2216 -font "Arial 9" \ 2221 2217 -value vtk 2222 2218 Rappture::Tooltip::for $inner.vtk_button "Save as VTK data file." 2223 2219 radiobutton $inner.image_button -text "Image File" \ 2224 2220 -variable [itcl::scope _downloadPopup(format)] \ 2225 -font "Arial 9 2221 -font "Arial 9" \ 2226 2222 -value image 2227 2223 Rappture::Tooltip::for $inner.image_button \ … … 2259 2255 array set style { 2260 2256 -color BCGYR 2257 -constcolor white 2261 2258 -cutplaneedges 0 2262 2259 -cutplanelighting 1 … … 2284 2281 set style(-opacity) 1.0 2285 2282 } 2283 set style(-constcolor) $itk_option(-plotforeground) 2286 2284 array set style [$dataobj style $comp] 2287 2285 #DebugTrace [array get style] … … 2315 2313 } 2316 2314 if { $_currentColormap == "" } { 2317 SetCurrentColormap $style(-color)2318 2315 $itk_component(colormap) value $style(-color) 2319 2316 } … … 2343 2340 2344 2341 SendCmd "cutplane add $tag" 2345 SendCmd "cutplane color [Color2RGB $ itk_option(-plotforeground)] $tag"2342 SendCmd "cutplane color [Color2RGB $style(-constcolor)] $tag" 2346 2343 foreach axis {x y z} { 2347 2344 set pos [expr $style(-${axis}cutplaneposition) * 0.01] … … 2359 2356 2360 2357 SendCmd "outline add $tag" 2361 SendCmd "outline color [Color2RGB $ itk_option(-plotforeground)] $tag"2358 SendCmd "outline color [Color2RGB $style(-constcolor)] $tag" 2362 2359 SendCmd "outline visible $style(-outline) $tag" 2363 2360 … … 2367 2364 SendCmd "contour3d edges $style(-edges) $tag" 2368 2365 set _settings(-isosurfaceedges) $style(-edges) 2369 #SendCmd "contour3d color [Color2RGB $style(-co lor)] $tag"2366 #SendCmd "contour3d color [Color2RGB $style(-constcolor)] $tag" 2370 2367 SendCmd "contour3d lighting $style(-lighting) $tag" 2371 2368 set _settings(-isosurfacelighting) $style(-lighting) -
branches/blt4_trunk/gui/scripts/vtkmeshviewer.tcl
r6210 r6351 411 411 } 412 412 array set params $settings 413 set params(-description) ""414 set params(-param) ""415 array set params $settings416 413 417 414 if {$params(-color) == "auto" || $params(-color) == "autoreset"} { … … 510 507 return $dlist 511 508 } 512 -image{509 "-image" { 513 510 if {[llength $args] != 2} { 514 511 error "wrong # args: should be \"get -image view\"" … … 524 521 } 525 522 default { 526 error "bad option \"$op\": should be -objects or -image"523 error "bad option \"$op\": should be -objects, -visible or -image" 527 524 } 528 525 } … … 1467 1464 radiobutton $inner.vtk_button -text "VTK data file" \ 1468 1465 -variable [itcl::scope _downloadPopup(format)] \ 1469 -font " Helvetica 9" \1466 -font "Arial 9" \ 1470 1467 -value vtk 1471 1468 Rappture::Tooltip::for $inner.vtk_button "Save as VTK data file." -
branches/blt4_trunk/gui/scripts/vtkstreamlinesviewer.tcl
r6252 r6351 72 72 private method BuildSurfaceTab {} 73 73 private method DrawLegend {} 74 private method Combo { option }75 74 private method Connect {} 76 75 private method CurrentDatasets {args} … … 91 90 private method IsValidObject { dataobj } 92 91 private method LeaveLegend {} 92 private method LegendTitleAction { option } 93 93 private method MotionLegend { x y } 94 94 private method Pan {option x y} … … 101 101 private method ReceiveDataset { args } 102 102 private method ReceiveImage { args } 103 private method ReceiveLegend { colormap title vmin vmax size }103 private method ReceiveLegend { colormap title min max size } 104 104 private method RequestLegend {} 105 105 private method Rotate {option x y} … … 145 145 private variable _curFldName "" 146 146 private variable _curFldLabel "" 147 private variable _field ""148 147 private variable _streamlinesLength 0 149 148 private variable _numSeeds 200 … … 552 551 } 553 552 array set params $settings 554 set params(-description) ""555 set params(-param) ""556 array set params $settings557 553 558 554 if {$params(-color) == "auto" || $params(-color) == "autoreset"} { … … 653 649 return $dlist 654 650 } 655 -image{651 "-image" { 656 652 if {[llength $args] != 2} { 657 653 error "wrong # args: should be \"get -image view\"" … … 667 663 } 668 664 default { 669 error "bad option \"$op\": should be -objects or -image"665 error "bad option \"$op\": should be -objects, -visible or -image" 670 666 } 671 667 } … … 1046 1042 -activeforeground $itk_option(-plotforeground) \ 1047 1043 -font "Arial 8" \ 1048 -command [itcl::code $this Combo invoke]1044 -command [itcl::code $this LegendTitleAction save] 1049 1045 set _fields($fname) [list $label $units $components] 1050 1046 if { $_curFldName == "" && $components == 3 } { … … 2068 2064 radiobutton $inner.vtk_button -text "VTK data file" \ 2069 2065 -variable [itcl::scope _downloadPopup(format)] \ 2070 -font " Helvetica 9" \2066 -font "Arial 9" \ 2071 2067 -value vtk 2072 2068 Rappture::Tooltip::for $inner.vtk_button "Save as VTK data file." … … 2185 2181 2186 2182 # ---------------------------------------------------------------------- 2187 # USAGE: ReceiveLegend <colormap> <title> < vmin> <vmax> <size>2183 # USAGE: ReceiveLegend <colormap> <title> <min> <max> <size> 2188 2184 # 2189 2185 # Invoked automatically whenever the "legend" command comes in from … … 2191 2187 # specified <size> will follow. 2192 2188 # ---------------------------------------------------------------------- 2193 itcl::body Rappture::VtkStreamlinesViewer::ReceiveLegend { colormap title vmin vmax size } {2189 itcl::body Rappture::VtkStreamlinesViewer::ReceiveLegend { colormap title min max size } { 2194 2190 set _legendPending 0 2195 2191 set _title $title … … 2255 2251 $c bind colormap <Motion> [itcl::code $this MotionLegend %x %y] 2256 2252 } 2257 $c bind title <ButtonPress> [itcl::code $this Combopost]2258 $c bind title <Enter> [itcl::code $this Combo activate]2259 $c bind title <Leave> [itcl::code $this Combo deactivate]2253 $c bind title <ButtonPress> [itcl::code $this LegendTitleAction post] 2254 $c bind title <Enter> [itcl::code $this LegendTitleAction enter] 2255 $c bind title <Leave> [itcl::code $this LegendTitleAction leave] 2260 2256 # Reset the item coordinates according the current size of the plot. 2261 2257 $c itemconfigure title -text $title … … 2380 2376 2381 2377 # ---------------------------------------------------------------------- 2382 # USAGE: _dropdown post 2383 # USAGE: _dropdown unpost 2384 # USAGE: _dropdown select 2385 # 2386 # Used internally to handle the dropdown list for this combobox. The 2387 # post/unpost options are invoked when the list is posted or unposted 2388 # to manage the relief of the controlling button. The select option 2389 # is invoked whenever there is a selection from the list, to assign 2390 # the value back to the gauge. 2391 # ---------------------------------------------------------------------- 2392 itcl::body Rappture::VtkStreamlinesViewer::Combo {option} { 2378 # USAGE: LegendTitleAction post 2379 # USAGE: LegendTitleAction enter 2380 # USAGE: LegendTitleAction leave 2381 # USAGE: LegendTitleAction save 2382 # 2383 # Used internally to handle the dropdown list for the fields menu combobox. 2384 # The post option is invoked when the field title is pressed to launch the 2385 # dropdown. The enter option is invoked when the user mouses over the field 2386 # title. The leave option is invoked when the user moves the mouse away 2387 # from the field title. The save option is invoked whenever there is a 2388 # selection from the list, to alert the visualization server. 2389 # ---------------------------------------------------------------------- 2390 itcl::body Rappture::VtkStreamlinesViewer::LegendTitleAction {option} { 2393 2391 set c $itk_component(view) 2394 2392 switch -- $option { … … 2400 2398 tk_popup $itk_component(fieldmenu) $x $y 2401 2399 } 2402 activate{2400 enter { 2403 2401 $c itemconfigure title -fill red 2404 2402 } 2405 deactivate {2403 leave { 2406 2404 $c itemconfigure title -fill white 2407 2405 } 2408 invoke {2406 save { 2409 2407 $itk_component(field) value $_curFldLabel 2410 2408 AdjustSetting -field 2411 2409 } 2412 2410 default { 2413 error "bad option \"$option\": should be post, unpost, select"2411 error "bad option \"$option\": should be post, enter, leave or save" 2414 2412 } 2415 2413 } -
branches/blt4_trunk/gui/scripts/vtksurfaceviewer.tcl
r6252 r6351 69 69 private method BuildDownloadPopup { widget command } 70 70 private method BuildSurfaceTab {} 71 private method Combo { option }72 71 private method Connect {} 73 72 private method CurrentDatasets {args} … … 85 84 private method IsValidObject { dataobj } 86 85 private method LeaveLegend {} 86 private method LegendTitleAction { option } 87 87 private method MotionLegend { x y } 88 88 private method Pan {option x y} … … 95 95 private method ReceiveDataset { args } 96 96 private method ReceiveImage { args } 97 private method ReceiveLegend { colormap title vmin vmax size }97 private method ReceiveLegend { colormap title min max size } 98 98 private method RequestLegend {} 99 99 private method Rotate {option x y} … … 139 139 private variable _legendPending 0 140 140 private variable _rotatePending 0 141 private variable _field ""142 141 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 143 142 private variable _fields … … 474 473 } 475 474 array set params $settings 476 set params(-description) ""477 set params(-param) ""478 array set params $settings479 475 480 476 if {$params(-color) == "auto" || $params(-color) == "autoreset"} { … … 574 570 return $dlist 575 571 } 576 -image{572 "-image" { 577 573 if {[llength $args] != 2} { 578 574 error "wrong # args: should be \"get -image view\"" … … 588 584 } 589 585 default { 590 error "bad option \"$op\": should be -objects or -image"586 error "bad option \"$op\": should be -objects, -visible or -image" 591 587 } 592 588 } … … 1318 1314 "-isolinecolor" { 1319 1315 set _changed($what) 1 1320 set color [$itk_component(isolineColor) value] 1321 set _settings($what) $color 1322 SendCmd "contour2d linecolor [Color2RGB $color]" 1316 set color [$itk_component(isolinecolor) value] 1317 if { $color == "none" } { 1318 if { $_settings(-isolinesvisible) } { 1319 set _changed(-isolinesvisible) 1 1320 foreach tag [CurrentDatasets -visible] { 1321 SendCmd "contour2d visible 0 $tag" 1322 } 1323 set _settings(-isolinesvisible) 0 1324 } 1325 } else { 1326 set _settings($what) $color 1327 if { !$_settings(-isolinesvisible) } { 1328 set _changed(-isolinesvisible) 1 1329 foreach tag [CurrentDatasets -visible] { 1330 SendCmd "contour2d visible 1 $tag" 1331 } 1332 set _settings(-isolinesvisible) 1 1333 } 1334 SendCmd "contour2d linecolor [Color2RGB $color]" 1335 } 1323 1336 DrawLegend 1324 1337 } … … 1328 1341 SendCmd "contour2d visible 0" 1329 1342 if { $bool } { 1343 if { [$itk_component(isolinecolor) value] != $_settings(-isolinecolor)} { 1344 $itk_component(isolinecolor) value $_settings(-isolinecolor) 1345 } 1330 1346 foreach tag [CurrentDatasets -visible] { 1331 1347 SendCmd "contour2d visible $bool $tag" … … 1546 1562 1547 1563 label $inner.linecolor_l -text "Isolines" -font "Arial 9" 1548 itk_component add isoline Color {1564 itk_component add isolinecolor { 1549 1565 Rappture::Combobox $inner.linecolor -width 10 -editable 0 1550 1566 } … … 1561 1577 "none" "none" 1562 1578 1563 $itk_component(isoline Color) value "white"1579 $itk_component(isolinecolor) value $_settings(-isolinecolor) 1564 1580 bind $inner.linecolor <<Value>> \ 1565 1581 [itcl::code $this AdjustSetting -isolinecolor] … … 1797 1813 SendCmd "camera zoom $_view($what)" 1798 1814 } 1799 1815 } 1800 1816 } 1801 1817 } … … 1831 1847 radiobutton $inner.vtk_button -text "VTK data file" \ 1832 1848 -variable [itcl::scope _downloadPopup(format)] \ 1833 -font "Arial 9 1849 -font "Arial 9" \ 1834 1850 -value vtk 1835 1851 Rappture::Tooltip::for $inner.vtk_button "Save as VTK data file." 1836 1852 radiobutton $inner.image_button -text "Image File" \ 1837 1853 -variable [itcl::scope _downloadPopup(format)] \ 1838 -font "Arial 9 1854 -font "Arial 9" \ 1839 1855 -value image 1840 1856 Rappture::Tooltip::for $inner.image_button \ … … 2170 2186 } 2171 2187 2172 $c bind title <ButtonPress> [itcl::code $this Combopost]2173 $c bind title <Enter> [itcl::code $this Combo activate]2174 $c bind title <Leave> [itcl::code $this Combo deactivate]2188 $c bind title <ButtonPress> [itcl::code $this LegendTitleAction post] 2189 $c bind title <Enter> [itcl::code $this LegendTitleAction enter] 2190 $c bind title <Leave> [itcl::code $this LegendTitleAction leave] 2175 2191 # Reset the item coordinates according the current size of the plot. 2176 2192 $c itemconfigure title -text $title … … 2197 2213 2198 2214 # ---------------------------------------------------------------------- 2199 # USAGE: _dropdown post 2200 # USAGE: _dropdown unpost 2201 # USAGE: _dropdown select 2202 # 2203 # Used internally to handle the dropdown list for this combobox. The 2204 # post/unpost options are invoked when the list is posted or unposted 2205 # to manage the relief of the controlling button. The select option 2206 # is invoked whenever there is a selection from the list, to assign 2207 # the value back to the gauge. 2208 # ---------------------------------------------------------------------- 2209 itcl::body Rappture::VtkSurfaceViewer::Combo {option} { 2215 # USAGE: LegendTitleAction post 2216 # USAGE: LegendTitleAction enter 2217 # USAGE: LegendTitleAction leave 2218 # USAGE: LegendTitleAction save 2219 # 2220 # Used internally to handle the dropdown list for the fields menu combobox. 2221 # The post option is invoked when the field title is pressed to launch the 2222 # dropdown. The enter option is invoked when the user mouses over the field 2223 # title. The leave option is invoked when the user moves the mouse away 2224 # from the field title. The save option is invoked whenever there is a 2225 # selection from the list, to alert the visualization server. 2226 # ---------------------------------------------------------------------- 2227 itcl::body Rappture::VtkSurfaceViewer::LegendTitleAction {option} { 2210 2228 set c $itk_component(view) 2211 2229 switch -- $option { … … 2219 2237 tk_popup $itk_component(fieldmenu) $x $y 2220 2238 } 2221 activate{2239 enter { 2222 2240 $c itemconfigure title -fill red 2223 2241 } 2224 deactivate {2242 leave { 2225 2243 $c itemconfigure title -fill $itk_option(-plotforeground) 2226 2244 } 2227 invoke {2245 save { 2228 2246 $itk_component(field) value $_curFldLabel 2229 2247 AdjustSetting -field 2230 2248 } 2231 2249 default { 2232 error "bad option \"$option\": should be post, unpost, select"2250 error "bad option \"$option\": should be post, enter, leave or save" 2233 2251 } 2234 2252 } … … 2320 2338 -activeforeground $itk_option(-plotforeground) \ 2321 2339 -font "Arial 8" \ 2322 -command [itcl::code $this Combo invoke]2340 -command [itcl::code $this LegendTitleAction save] 2323 2341 set _fields($fname) [list $label $units $components] 2324 2342 if { $_curFldName == "" } { -
branches/blt4_trunk/gui/scripts/vtkviewer.tcl
r6210 r6351 104 104 private method ReceiveDataset { args } 105 105 private method ReceiveImage { args } 106 private method ReceiveLegend { colormap title vmin vmax size }106 private method ReceiveLegend { colormap title min max size } 107 107 private method RequestLegend {} 108 108 private method Rotate {option x y} … … 595 595 } 596 596 array set params $settings 597 set params(-description) ""598 set params(-param) ""599 array set params $settings600 597 601 598 if {$params(-color) == "auto" || $params(-color) == "autoreset"} { … … 695 692 return $dlist 696 693 } 697 -image{694 "-image" { 698 695 if {[llength $args] != 2} { 699 696 error "wrong # args: should be \"get -image view\"" … … 709 706 } 710 707 default { 711 error "bad option \"$op\": should be -objects or -image"708 error "bad option \"$op\": should be -objects, -visible or -image" 712 709 } 713 710 } … … 2588 2585 radiobutton $inner.vtk_button -text "VTK data file" \ 2589 2586 -variable [itcl::scope _downloadPopup(format)] \ 2590 -font " Helvetica 9" \2587 -font "Arial 9" \ 2591 2588 -value vtk 2592 2589 Rappture::Tooltip::for $inner.vtk_button "Save as VTK data file." … … 2866 2863 2867 2864 # ---------------------------------------------------------------------- 2868 # USAGE: ReceiveLegend <colormap> <title> < vmin> <vmax> <size>2865 # USAGE: ReceiveLegend <colormap> <title> <min> <max> <size> 2869 2866 # 2870 2867 # Invoked automatically whenever the "legend" command comes in from … … 2872 2869 # specified <size> will follow. 2873 2870 # ---------------------------------------------------------------------- 2874 itcl::body Rappture::VtkViewer::ReceiveLegend { colormap title vmin vmax size } {2875 set _limits(vmin) $ vmin2876 set _limits(vmax) $ vmax2871 itcl::body Rappture::VtkViewer::ReceiveLegend { colormap title min max size } { 2872 set _limits(vmin) $min 2873 set _limits(vmax) $max 2877 2874 set _title $title 2878 2875 if { [IsConnected] } { -
branches/blt4_trunk/gui/scripts/vtkvolumeviewer.tcl
r6252 r6351 74 74 private method BuildVolumeComponents {} 75 75 private method BuildVolumeTab {} 76 private method Combo { option }77 76 private method ComputeAlphamap { cname } 78 77 private method ComputeTransferFunction { cname } … … 97 96 private method IsValidObject { dataobj } 98 97 private method LeaveLegend {} 98 private method LegendTitleAction { option } 99 99 private method MotionLegend { x y } 100 100 private method Pan {option x y} … … 109 109 private method ReceiveDataset { args } 110 110 private method ReceiveImage { args } 111 private method ReceiveLegend { colormap title vmin vmax size }111 private method ReceiveLegend { colormap title min max size } 112 112 private method RemoveMarker { x y } 113 113 private method RequestLegend {} … … 240 240 array set _settings { 241 241 -axesvisible 1 242 -axisflymode static243 242 -axislabels 1 244 243 -axisminorticks 1 244 -axismode "static" 245 245 -background black 246 246 -color "default" … … 536 536 } 537 537 array set params $settings 538 set params(-description) ""539 set params(-param) ""540 array set params $settings541 538 542 539 if {$params(-color) == "auto" || $params(-color) == "autoreset"} { … … 638 635 return $dlist 639 636 } 640 -image{637 "-image" { 641 638 if {[llength $args] != 2} { 642 639 error "wrong # args: should be \"get -image view\"" … … 652 649 } 653 650 default { 654 error "bad option \"$op\": should be -objects or -image"651 error "bad option \"$op\": should be -objects, -visible or -image" 655 652 } 656 653 } … … 1004 1001 set _first "" 1005 1002 InitSettings -background \ 1006 -xgrid -ygrid -zgrid -axis flymode \1003 -xgrid -ygrid -zgrid -axismode \ 1007 1004 -axesvisible -axislabels -axisminorticks 1008 1005 StopBufferingCommands … … 1086 1083 -activeforeground $itk_option(-plotforeground) \ 1087 1084 -font "Arial 8" \ 1088 -command [itcl::code $this Combo invoke]1085 -command [itcl::code $this LegendTitleAction save] 1089 1086 set _fields($fname) [list $label $units $components] 1090 1087 if { $_curFldName == "" } { … … 1351 1348 } 1352 1349 switch -- $what { 1353 "-current" { 1354 set cname [$itk_component(volcomponents) value] 1355 SwitchComponent $cname 1350 "-axesvisible" { 1351 set bool $_settings($what) 1352 SendCmd "axis visible all $bool" 1353 } 1354 "-axislabels" { 1355 set bool $_settings($what) 1356 SendCmd "axis labels all $bool" 1357 } 1358 "-axisminorticks" { 1359 set bool $_settings($what) 1360 SendCmd "axis minticks all $bool" 1361 } 1362 "-axismode" { 1363 set mode [$itk_component(axismode) value] 1364 set mode [$itk_component(axismode) translate $mode] 1365 set _settings($what) $mode 1366 SendCmd "axis flymode $mode" 1356 1367 } 1357 1368 "-background" { … … 1368 1379 DrawLegend 1369 1380 } 1370 "-volumeoutline" { 1371 set bool $_settings($what) 1372 SendCmd "outline visible 0" 1373 foreach tag [GetDatasetsWithComponent $_current] { 1374 SendCmd "outline visible $bool $tag" 1375 } 1376 } 1377 "-legendvisible" { 1378 set bool $_settings($what) 1379 if { $bool } { 1380 blt::table $itk_component(plotarea) \ 1381 1,0 $itk_component(legend) -fill x 1382 } else { 1383 blt::table forget $itk_component(legend) 1384 } 1385 } 1386 "-volumevisible" { 1387 set bool $_settings($what) 1388 set _settings($_current${what}) $bool 1389 # Only the data objects in the array _obj2ovride(*-raise) are 1390 # in the working set and can be displayed on screen. The global 1391 # volume control determines whether they are visible. 1392 # 1393 # Note: The use of the current component is a hold over from 1394 # nanovis. If we can't display more than one volume, 1395 # we don't have to limit the effects to a specific 1396 # component. 1397 foreach tag [GetDatasetsWithComponent $_current] { 1398 foreach {dataobj cname} [split $tag -] break 1399 if { [info exists _obj2ovride($dataobj-raise)] } { 1400 SendCmd "volume visible $bool $tag" 1401 } 1402 } 1403 if { $bool } { 1404 Rappture::Tooltip::for $itk_component(volume) \ 1405 "Hide the volume" 1406 } else { 1407 Rappture::Tooltip::for $itk_component(volume) \ 1408 "Show the volume" 1409 } 1410 } 1411 "-volumeblendmode" { 1412 set val [$itk_component(blendmode) value] 1413 set mode [$itk_component(blendmode) translate $val] 1414 set _settings($what) $mode 1415 set _settings($_current${what}) $mode 1416 foreach tag [GetDatasetsWithComponent $_current] { 1417 SendCmd "volume blendmode $mode $tag" 1418 } 1419 } 1420 "-volumeambient" { 1421 # Other parts of the code use the -volumeambient setting to 1422 # tell if the component settings have been initialized 1423 if { ![info exists _settings($_current${what})] } { 1424 InitComponentSettings $_current 1425 } 1426 set val $_settings($what) 1427 set _settings($_current${what}) $val 1428 set ambient [expr {0.01*$val}] 1429 foreach tag [GetDatasetsWithComponent $_current] { 1430 SendCmd "volume shading ambient $ambient $tag" 1431 } 1432 } 1433 "-volumediffuse" { 1434 set val $_settings($what) 1435 set _settings($_current${what}) $val 1436 set diffuse [expr {0.01*$val}] 1437 foreach tag [GetDatasetsWithComponent $_current] { 1438 SendCmd "volume shading diffuse $diffuse $tag" 1439 } 1440 } 1441 "-volumespecularlevel" - "-volumespecularexponent" { 1442 set val $_settings($what) 1443 set _settings($_current${what}) $val 1444 set level [expr {0.01*$val}] 1445 set exp $_settings($what) 1446 foreach tag [GetDatasetsWithComponent $_current] { 1447 SendCmd "volume shading specular $level $exp $tag" 1448 } 1449 } 1450 "-volumelighting" { 1451 set bool $_settings($what) 1452 set _settings($_current${what}) $bool 1453 foreach tag [GetDatasetsWithComponent $_current] { 1454 SendCmd "volume lighting $bool $tag" 1455 } 1456 } 1457 "-volumeopacity" { 1458 set val $_settings($what) 1459 set _settings($_current${what}) $val 1460 set val [expr {0.01*$val}] 1461 foreach tag [GetDatasetsWithComponent $_current] { 1462 SendCmd "volume opacity $val $tag" 1463 } 1464 } 1465 "-volumequality" { 1466 set val $_settings($what) 1467 set _settings($_current${what}) $val 1468 set val [expr {0.01*$val}] 1469 foreach tag [GetDatasetsWithComponent $_current] { 1470 SendCmd "volume quality $val $tag" 1471 } 1472 } 1473 "-axesvisible" { 1474 set bool $_settings($what) 1475 SendCmd "axis visible all $bool" 1476 } 1477 "-axislabels" { 1478 set bool $_settings($what) 1479 SendCmd "axis labels all $bool" 1480 } 1481 "-axisminorticks" { 1482 set bool $_settings($what) 1483 SendCmd "axis minticks all $bool" 1484 } 1485 "-xgrid" - "-ygrid" - "-zgrid" { 1486 set axis [string range $what 1 1] 1487 set bool $_settings($what) 1488 SendCmd "axis grid $axis $bool" 1489 } 1490 "-axisflymode" { 1491 set mode [$itk_component(axismode) value] 1492 set mode [$itk_component(axismode) translate $mode] 1493 set _settings($what) $mode 1494 SendCmd "axis flymode $mode" 1495 } 1496 "-cutplanesvisible" { 1497 set bool $_settings($what) 1498 foreach dataset [CurrentDatasets -visible] { 1499 SendCmd "$_cutplaneCmd visible $bool $dataset" 1500 } 1381 "-color" { 1382 set color [$itk_component(colormap) value] 1383 set _settings($what) $color 1384 set _settings($_current${what}) $color 1385 ResetColormap $_current $color 1386 } 1387 "-current" { 1388 set cname [$itk_component(volcomponents) value] 1389 SwitchComponent $cname 1501 1390 } 1502 1391 "-cutplanelighting" { … … 1524 1413 } 1525 1414 } 1526 "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" { 1527 set axis [string range $what 1 1] 1415 "-cutplanesvisible" { 1528 1416 set bool $_settings($what) 1529 if { $bool } {1530 $itk_component(${axis}CutScale) configure -state normal \1531 -troughcolor white1532 } else {1533 $itk_component(${axis}CutScale) configure -state disabled \1534 -troughcolor grey821535 }1536 1417 foreach dataset [CurrentDatasets -visible] { 1537 SendCmd "$_cutplaneCmd axis $axis $bool $dataset" 1538 } 1539 } 1540 "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" { 1541 set axis [string range $what 1 1] 1542 set pos [expr $_settings($what) * 0.01] 1543 foreach dataset [CurrentDatasets -visible] { 1544 SendCmd "$_cutplaneCmd slice ${axis} ${pos} $dataset" 1545 } 1546 set _cutplanePending 0 1547 } 1548 "-volumethickness" { 1549 set _settings($_current${what}) $_settings($what) 1550 updateTransferFunctions 1551 } 1552 "-color" { 1553 set color [$itk_component(colormap) value] 1554 set _settings($what) $color 1555 set _settings($_current${what}) $color 1556 ResetColormap $_current $color 1418 SendCmd "$_cutplaneCmd visible $bool $dataset" 1419 } 1557 1420 } 1558 1421 "-field" { … … 1584 1447 SendCmd "camera reset" 1585 1448 DrawLegend 1449 } 1450 "-legendvisible" { 1451 set bool $_settings($what) 1452 if { $bool } { 1453 blt::table $itk_component(plotarea) \ 1454 1,0 $itk_component(legend) -fill x 1455 } else { 1456 blt::table forget $itk_component(legend) 1457 } 1458 } 1459 "-volumeambient" { 1460 # Other parts of the code use the -volumeambient setting to 1461 # tell if the component settings have been initialized 1462 if { ![info exists _settings($_current${what})] } { 1463 InitComponentSettings $_current 1464 } 1465 set val $_settings($what) 1466 set _settings($_current${what}) $val 1467 set ambient [expr {0.01*$val}] 1468 foreach tag [GetDatasetsWithComponent $_current] { 1469 SendCmd "volume shading ambient $ambient $tag" 1470 } 1471 } 1472 "-volumeblendmode" { 1473 set val [$itk_component(blendmode) value] 1474 set mode [$itk_component(blendmode) translate $val] 1475 set _settings($what) $mode 1476 set _settings($_current${what}) $mode 1477 foreach tag [GetDatasetsWithComponent $_current] { 1478 SendCmd "volume blendmode $mode $tag" 1479 } 1480 } 1481 "-volumediffuse" { 1482 set val $_settings($what) 1483 set _settings($_current${what}) $val 1484 set diffuse [expr {0.01*$val}] 1485 foreach tag [GetDatasetsWithComponent $_current] { 1486 SendCmd "volume shading diffuse $diffuse $tag" 1487 } 1488 } 1489 "-volumelighting" { 1490 set bool $_settings($what) 1491 set _settings($_current${what}) $bool 1492 foreach tag [GetDatasetsWithComponent $_current] { 1493 SendCmd "volume lighting $bool $tag" 1494 } 1495 } 1496 "-volumeopacity" { 1497 set val $_settings($what) 1498 set _settings($_current${what}) $val 1499 set val [expr {0.01*$val}] 1500 foreach tag [GetDatasetsWithComponent $_current] { 1501 SendCmd "volume opacity $val $tag" 1502 } 1503 } 1504 "-volumeoutline" { 1505 set bool $_settings($what) 1506 SendCmd "outline visible 0" 1507 foreach tag [GetDatasetsWithComponent $_current] { 1508 SendCmd "outline visible $bool $tag" 1509 } 1510 } 1511 "-volumequality" { 1512 set val $_settings($what) 1513 set _settings($_current${what}) $val 1514 set val [expr {0.01*$val}] 1515 foreach tag [GetDatasetsWithComponent $_current] { 1516 SendCmd "volume quality $val $tag" 1517 } 1518 } 1519 "-volumespecularlevel" - "-volumespecularexponent" { 1520 set val $_settings($what) 1521 set _settings($_current${what}) $val 1522 set level [expr {0.01*$val}] 1523 set exp $_settings($what) 1524 foreach tag [GetDatasetsWithComponent $_current] { 1525 SendCmd "volume shading specular $level $exp $tag" 1526 } 1527 } 1528 "-volumethickness" { 1529 set _settings($_current${what}) $_settings($what) 1530 updateTransferFunctions 1531 } 1532 "-volumevisible" { 1533 set bool $_settings($what) 1534 set _settings($_current${what}) $bool 1535 # Only the data objects in the array _obj2ovride(*-raise) are 1536 # in the working set and can be displayed on screen. The global 1537 # volume control determines whether they are visible. 1538 # 1539 # Note: The use of the current component is a hold over from 1540 # nanovis. If we can't display more than one volume, 1541 # we don't have to limit the effects to a specific 1542 # component. 1543 foreach tag [GetDatasetsWithComponent $_current] { 1544 foreach {dataobj cname} [split $tag -] break 1545 if { [info exists _obj2ovride($dataobj-raise)] } { 1546 SendCmd "volume visible $bool $tag" 1547 } 1548 } 1549 if { $bool } { 1550 Rappture::Tooltip::for $itk_component(volume) \ 1551 "Hide the volume" 1552 } else { 1553 Rappture::Tooltip::for $itk_component(volume) \ 1554 "Show the volume" 1555 } 1556 } 1557 "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" { 1558 set axis [string range $what 1 1] 1559 set bool $_settings($what) 1560 if { $bool } { 1561 $itk_component(${axis}CutScale) configure -state normal \ 1562 -troughcolor white 1563 } else { 1564 $itk_component(${axis}CutScale) configure -state disabled \ 1565 -troughcolor grey82 1566 } 1567 foreach dataset [CurrentDatasets -visible] { 1568 SendCmd "$_cutplaneCmd axis $axis $bool $dataset" 1569 } 1570 } 1571 "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" { 1572 set axis [string range $what 1 1] 1573 set pos [expr $_settings($what) * 0.01] 1574 foreach dataset [CurrentDatasets -visible] { 1575 SendCmd "$_cutplaneCmd slice ${axis} ${pos} $dataset" 1576 } 1577 set _cutplanePending 0 1578 } 1579 "-xgrid" - "-ygrid" - "-zgrid" { 1580 set axis [string range $what 1 1] 1581 set bool $_settings($what) 1582 SendCmd "axis grid $axis $bool" 1586 1583 } 1587 1584 default { … … 1908 1905 "furthest_triad" "farthest" \ 1909 1906 "outer_edges" "outer" 1910 $itk_component(axismode) value $_settings(-axis flymode)1911 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axis flymode]1907 $itk_component(axismode) value $_settings(-axismode) 1908 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axismode] 1912 1909 1913 1910 blt::table $inner \ … … 2174 2171 radiobutton $inner.vtk_button -text "VTK data file" \ 2175 2172 -variable [itcl::scope _downloadPopup(format)] \ 2176 -font " Helvetica 9" \2173 -font "Arial 9" \ 2177 2174 -value vtk 2178 2175 Rappture::Tooltip::for $inner.vtk_button "Save as VTK data file." … … 2252 2249 2253 2250 # ---------------------------------------------------------------------- 2254 # USAGE: ReceiveLegend <colormap> <title> < vmin> <vmax> <size>2251 # USAGE: ReceiveLegend <colormap> <title> <min> <max> <size> 2255 2252 # 2256 2253 # Invoked automatically whenever the "legend" command comes in from … … 2258 2255 # specified <size> will follow. 2259 2256 # ---------------------------------------------------------------------- 2260 itcl::body Rappture::VtkVolumeViewer::ReceiveLegend { colormap title vmin vmax size } {2257 itcl::body Rappture::VtkVolumeViewer::ReceiveLegend { colormap title min max size } { 2261 2258 if { [isconnected] } { 2262 2259 set bytes [ReceiveBytes $size] … … 2428 2425 2429 2426 # ---------------------------------------------------------------------- 2430 # USAGE: _dropdown post 2431 # USAGE: _dropdown unpost 2432 # USAGE: _dropdown select 2433 # 2434 # Used internally to handle the dropdown list for this combobox. The 2435 # post/unpost options are invoked when the list is posted or unposted 2436 # to manage the relief of the controlling button. The select option 2437 # is invoked whenever there is a selection from the list, to assign 2438 # the value back to the gauge. 2439 # ---------------------------------------------------------------------- 2440 itcl::body Rappture::VtkVolumeViewer::Combo {option} { 2427 # USAGE: LegendTitleAction post 2428 # USAGE: LegendTitleAction enter 2429 # USAGE: LegendTitleAction leave 2430 # USAGE: LegendTitleAction save 2431 # 2432 # Used internally to handle the dropdown list for the fields menu combobox. 2433 # The post option is invoked when the field title is pressed to launch the 2434 # dropdown. The enter option is invoked when the user mouses over the field 2435 # title. The leave option is invoked when the user moves the mouse away 2436 # from the field title. The save option is invoked whenever there is a 2437 # selection from the list, to alert the visualization server. 2438 # ---------------------------------------------------------------------- 2439 itcl::body Rappture::VtkVolumeViewer::LegendTitleAction {option} { 2441 2440 set c $itk_component(view) 2442 2441 switch -- $option { … … 2448 2447 tk_popup $itk_component(fieldmenu) $x $y 2449 2448 } 2450 activate{2449 enter { 2451 2450 $c itemconfigure title -fill red 2452 2451 } 2453 deactivate {2452 leave { 2454 2453 $c itemconfigure title -fill $itk_option(-plotforeground) 2455 2454 } 2456 invoke {2455 save { 2457 2456 $itk_component(field) value $_curFldLabel 2458 2457 AdjustSetting -field 2459 2458 } 2460 2459 default { 2461 error "bad option \"$option\": should be post, unpost, select"2460 error "bad option \"$option\": should be post, enter, leave or save" 2462 2461 } 2463 2462 } … … 2510 2509 } else { 2511 2510 # $n : absolute value, compute relative 2512 lappend list [expr {(double($value)-$min)/($max-$min)]}2511 lappend list [expr {(double($value)-$min)/($max-$min)}] 2513 2512 } 2514 2513 } -
branches/blt4_trunk/lang/tcl/scripts/library.tcl
r6021 r6351 75 75 close $fid 76 76 } errs] != 0 } { 77 global errorInfo 77 78 puts stderr "can't open \"$fname\": errs=$errs errorInfo=$errorInfo" 78 79 } … … 90 91 close $fid 91 92 } errs] != 0 } { 93 global errorInfo 92 94 puts stderr "can't open \"$fname\": errs=$errs errorInfo=$errorInfo" 93 95 } … … 1067 1069 # ---------------------------------------------------------------------- 1068 1070 itcl::body Rappture::LibraryObj::uq_get_vars {{tfile ""}} { 1069 set varout \[1070 set varlist []1071 set varout "\[" 1072 set varlist {} 1071 1073 1072 1074 if {$tfile == ""} { -
branches/blt4_trunk/lang/tcl/scripts/task.tcl
r6252 r6351 218 218 219 219 # write out the driver.xml file for the tool 220 set file "driver[pid].xml" 220 global rapptureInfo 221 set file [file join $rapptureInfo(cwd) "driver[pid].xml"] 221 222 set status [catch { 222 223 set fid [open $file w] … … 578 579 set rdir $_resources(-resultdir) 579 580 } else { 580 set rdir "." 581 global rapptureInfo 582 set rdir $rapptureInfo(cwd) 581 583 } 582 584 } elseif {$resultdir ne ""} { -
branches/blt4_trunk/puq/puq.sh.in
r6210 r6351 21 21 script=$1 22 22 shift 23 exec ${python} ${puq_exec_prefix}/${script}.py $*23 exec ${python} ${puq_exec_prefix}/${script}.py "$@" 24 24
Note: See TracChangeset
for help on using the changeset viewer.