Changeset 4633
- Timestamp:
- Sep 10, 2014, 1:55:49 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/mapviewer.tcl
r4630 r4633 82 82 protected method MouseScroll { direction } 83 83 protected method Pan {option x y} 84 protected method Pin {option x y} 84 85 protected method Rebuild {} 85 86 protected method ReceiveMapInfo { args } … … 137 138 private variable _sendEarthFile 0 138 139 private variable _useServerManip 0 140 private variable _labelCount 0 139 141 } 140 142 … … 179 181 # to update the Lat/Long coordinate display 180 182 array set _motion { 181 compress 0183 compress 1 182 184 delay 100 183 enable 0185 enable 1 184 186 pending 0 185 187 x 0 … … 358 360 [itcl::code $this camera go %x %y 0.4] 359 361 362 # Pin placemark annotations 363 bind $itk_component(view) <Control-ButtonPress-1> \ 364 +[itcl::code $this Pin add %x %y] 365 bind $itk_component(view) <Control-ButtonPress-3> \ 366 +[itcl::code $this Pin delete %x %y] 367 360 368 # Bindings for rotation via mouse 361 369 bind $itk_component(view) <ButtonPress-2> \ … … 394 402 [itcl::code $this EventuallyHandleMotionEvent %x %y] 395 403 } 404 #bind $itk_component(view) <Motion> \ 405 # +[itcl::code $this SendCmd "map pin hover %x %y"] 396 406 } 397 407 … … 455 465 set sendResize 0 456 466 } 457 set _start [clock clicks -milliseconds]467 #set _start [clock clicks -milliseconds] 458 468 if {$sendResize} { 459 469 SendCmd "screen size $_width $_height" … … 847 857 848 858 # ---------------------------------------------------------------------- 849 # USAGE: ReceiveImage - bytes <size> -type <type> -token <token>859 # USAGE: ReceiveImage -type <type> -token <token> -bytes <size> 850 860 # 851 861 # Invoked automatically whenever the "image" command comes in from … … 857 867 set readyForNextFrame 1 858 868 array set info { 869 -bytes 0 859 870 -token "???" 860 -bytes 0861 871 -type image 862 872 } … … 878 888 return 879 889 } 890 set timeReceived [clock clicks -milliseconds] 891 set elapsed [expr $timeReceived - $_start] 880 892 set option [lindex $args 0] 881 893 switch -- $option { … … 888 900 } 889 901 if {$len == 5} { 890 puts stderr "\[$token \] Map coords out of range"902 puts stderr "\[$token - $elapsed\] Map coords out of range" 891 903 } elseif {$len < 7} { 892 904 foreach { x y z } [lrange $args 2 end] break 893 puts stderr "\[$token \] Map coords: $x $y $z"905 puts stderr "\[$token - $elapsed\] Map coords: $x $y $z" 894 906 } elseif {$len < 8} { 895 907 foreach { x y z screenX screenY } [lrange $args 2 end] break 896 puts stderr "\[$token \] Map coords($screenX,$screenY): $x $y $z"908 puts stderr "\[$token - $elapsed\] Map coords($screenX,$screenY): $x $y $z" 897 909 } else { 898 910 foreach { x y z screenX screenY srs vert } [lrange $args 2 end] break 899 puts stderr "\[$token \] Map coords($screenX,$screenY): $x $y $z {$srs} {$vert}"911 puts stderr "\[$token - $elapsed\] Map coords($screenX,$screenY): $x $y $z {$srs} {$vert}" 900 912 } 901 913 } … … 1156 1168 1157 1169 itcl::body Rappture::MapViewer::MouseMotion {} { 1158 SendCmd "mouse motion $_motion(x) $_motion(y)" 1170 #SendCmd "mouse motion $_motion(x) $_motion(y)" 1171 SendCmd "map pin hover $_motion(x) $_motion(y)" 1159 1172 set _motion(pending) 0 1160 1173 } … … 1286 1299 default { 1287 1300 error "bad option \"$option\": should be click, drag, release" 1301 } 1302 } 1303 } 1304 1305 itcl::body Rappture::MapViewer::Pin {option x y} { 1306 set _click(x) $x 1307 set _click(y) $y 1308 switch -- $option { 1309 "add" { 1310 incr _labelCount 1311 set label "Label $_labelCount" 1312 SendCmd [list "map" "pin" "add" $x $y $label] 1313 } 1314 "delete" { 1315 SendCmd "map pin delete $x $y" 1288 1316 } 1289 1317 }
Note: See TracChangeset
for help on using the changeset viewer.