- Timestamp:
- Jan 6, 2016, 4:43:18 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/mapviewer.tcl
r5943 r5950 62 62 public method scale {args} 63 63 public method select {option {args ""}} 64 public method setSelectCallback {cmd} 64 65 65 66 private method KeyPress { key } … … 91 92 private method DoRotate {} 92 93 private method DoSelect {} 94 private method DoSelectCallback {option {args ""}} 93 95 private method DrawLegend { colormap min max } 94 96 private method EarthFile {} … … 113 115 private method ReceiveMapInfo { args } 114 116 private method ReceiveScreenInfo { args } 117 private method ReceiveSelect { option {args ""} } 115 118 private method RequestLegend { colormap w h } 116 119 private method Rotate {option x y} … … 139 142 # layer in the server. 140 143 private variable _viewpoints; 144 private variable _selectCallback ""; 141 145 private variable _click; # info used for rotate operations 142 146 private variable _view; # view params for 3D view … … 215 219 $_parser alias camera [itcl::code $this camera] 216 220 $_parser alias screen [itcl::code $this ReceiveScreenInfo] 217 $_parser alias select [itcl::code $this select]221 $_parser alias select [itcl::code $this ReceiveSelect] 218 222 219 223 # Millisecond delay before animated wait dialog appears … … 877 881 } 878 882 879 # ---------------------------------------------------------------------- 880 # USAGE: select clear 881 # USAGE: select feature 882 # USAGE: select annotation 883 # ---------------------------------------------------------------------- 884 itcl::body Rappture::MapViewer::select {option {args ""}} { 883 itcl::body Rappture::MapViewer::setSelectCallback {cmd} { 884 set _selectCallback $cmd 885 } 886 887 itcl::body Rappture::MapViewer::DoSelectCallback {option {args ""}} { 888 if { $_selectCallback != "" } { 889 set cmd [concat $_selectCallback $option $args] 890 uplevel #0 $cmd 891 } 892 } 893 894 # ---------------------------------------------------------------------- 895 # USAGE: ReceiveSelect clear 896 # USAGE: ReceiveSelect feature <args...> 897 # USAGE: ReceiveSelect annotation <args...> 898 # ---------------------------------------------------------------------- 899 itcl::body Rappture::MapViewer::ReceiveSelect {option {args ""}} { 885 900 DebugTrace "Enter" 886 901 switch $option { … … 889 904 } 890 905 "clear" { 891 906 puts stderr "select clear" 892 907 } 893 908 "feature" { 894 puts stderr "select feature $args" 909 puts stderr "select feature $args" 910 } 911 } 912 eval DoSelectCallback $option $args 913 } 914 915 # ---------------------------------------------------------------------- 916 # USAGE: select clear 917 # USAGE: select feature <args...> 918 # USAGE: select annotation <args...> 919 # 920 # Clients use this method to notify the map widget of a selection event 921 # originating from outside the map 922 # ---------------------------------------------------------------------- 923 itcl::body Rappture::MapViewer::select {option {args ""}} { 924 switch $option { 925 "annotation" { 926 SendCmd "select annotation $args" 927 } 928 "clear" { 929 SendCmd "select clear" 930 } 931 "feature" { 932 SendCmd "select feature $args" 933 } 934 default { 935 puts stderr "Unknown select option \"$option\"" 895 936 } 896 937 } … … 1254 1295 set _first "" 1255 1296 set haveTerrain 0 1297 #SendCmd "map layer visible 0" 1256 1298 foreach dataobj [get -objects] { 1257 1299 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { … … 2479 2521 set selectors [list] 2480 2522 foreach selector [$dataobj selectors $layer] { 2481 array set sinfo [$dataobj selector $layer $selector]2523 array set sinfo [$dataobj selector $layer $selector] 2482 2524 DebugTrace "$selector: [array get sinfo]" 2483 2525 lappend selectors [array get sinfo]
Note: See TracChangeset
for help on using the changeset viewer.