- Timestamp:
- Feb 13, 2015, 2:11:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/mapviewer.tcl
r5008 r5022 104 104 private method Rotate {option x y} 105 105 private method Select {option x y} 106 private method SetLayerOpacity { dataobj layer {value 100}} 106 private method SetHeading { {value 0} } 107 private method SetLayerOpacity { dataobj layer {value 100} } 107 108 private method SetLayerStyle { dataobj layer } 108 109 private method SetLayerVisibility { dataobj layer } 110 private method SetPitch { {value -89.999} } 109 111 private method SetTerrainStyle { style } 110 112 private method UpdateLayerControls {} … … 310 312 Rappture::Tooltip::for $itk_component(zoomout) "Zoom out" 311 313 312 if { [catch { 313 BuildLayerTab 314 BuildMapTab 315 BuildTerrainTab 316 BuildCameraTab 317 } errs] != 0 } { 318 puts stderr errs=$errs 319 } 314 BuildLayerTab 315 BuildMapTab 316 BuildTerrainTab 317 BuildCameraTab 320 318 321 319 # Legend … … 441 439 [itcl::code $this Pan set 0 10] 442 440 441 bind $itk_component(view) <Shift-KeyPress-Left> \ 442 [itcl::code $this Pan set 2 0] 443 bind $itk_component(view) <Shift-KeyPress-Right> \ 444 [itcl::code $this Pan set -2 0] 445 bind $itk_component(view) <Shift-KeyPress-Up> \ 446 [itcl::code $this Pan set 0 -2] 447 bind $itk_component(view) <Shift-KeyPress-Down> \ 448 [itcl::code $this Pan set 0 2] 449 450 # Bindings for rotation via keyboard 451 bind $itk_component(view) <Control-Left> \ 452 [itcl::code $this Rotate set 10 0] 453 bind $itk_component(view) <Control-Right> \ 454 [itcl::code $this Rotate set -10 0] 455 bind $itk_component(view) <Control-Up> \ 456 [itcl::code $this Rotate set 0 -10] 457 bind $itk_component(view) <Control-Down> \ 458 [itcl::code $this Rotate set 0 10] 459 460 bind $itk_component(view) <Control-Shift-Left> \ 461 [itcl::code $this Rotate set 2 0] 462 bind $itk_component(view) <Control-Shift-Right> \ 463 [itcl::code $this Rotate set -2 0] 464 bind $itk_component(view) <Control-Shift-Up> \ 465 [itcl::code $this Rotate set 0 -2] 466 bind $itk_component(view) <Control-Shift-Down> \ 467 [itcl::code $this Rotate set 0 2] 468 469 # Bindings for zoom via keyboard 470 bind $itk_component(view) <KeyPress-Prior> \ 471 [itcl::code $this Zoom out] 472 bind $itk_component(view) <KeyPress-Next> \ 473 [itcl::code $this Zoom in] 474 bind $itk_component(view) <KeyPress-Home> \ 475 [itcl::code $this camera reset] 476 477 # Keyboard shortcuts 478 # Reset heading to North 479 bind $itk_component(view) <n> \ 480 [itcl::code $this SetHeading] 481 # Reset pitch to top-down (2D) view 482 bind $itk_component(view) <p> \ 483 [itcl::code $this SetPitch] 484 443 485 # Binding for mouse motion events 444 486 set _motion(compress) 1 … … 450 492 # +[itcl::code $this SendCmd "map pin hover %x %y"] 451 493 } 452 453 bind $itk_component(view) <Shift-KeyPress-Left> \454 [itcl::code $this Pan set 2 0]455 bind $itk_component(view) <Shift-KeyPress-Right> \456 [itcl::code $this Pan set -2 0]457 bind $itk_component(view) <Shift-KeyPress-Up> \458 [itcl::code $this Pan set 0 -2]459 bind $itk_component(view) <Shift-KeyPress-Down> \460 [itcl::code $this Pan set 0 2]461 462 # Bindings for zoom via keyboard463 bind $itk_component(view) <KeyPress-Prior> \464 [itcl::code $this Zoom out]465 bind $itk_component(view) <KeyPress-Next> \466 [itcl::code $this Zoom in]467 494 468 495 bind $itk_component(view) <Enter> "focus $itk_component(view)" … … 1402 1429 catch {unset _click} 1403 1430 } 1431 "set" { 1432 set w [winfo width $itk_component(view)] 1433 set h [winfo height $itk_component(view)] 1434 set dx [expr $x / double($w)] 1435 set dy [expr $y / double($h)] 1436 if {[expr (abs($dx) > 0.0 || abs($dy) > 0.0)]} { 1437 EventuallyRotate $dx $dy 1438 } 1439 } 1404 1440 default { 1405 1441 error "bad option \"$option\": should be click, drag, release" … … 1505 1541 } 1506 1542 } 1543 } 1544 1545 itcl::body Rappture::MapViewer::SetHeading { {value 0} } { 1546 set _view(heading) $value 1547 camera set heading 1548 } 1549 1550 itcl::body Rappture::MapViewer::SetPitch { {value -89.999} } { 1551 set _view(pitch) $value 1552 camera set pitch 1507 1553 } 1508 1554
Note: See TracChangeset
for help on using the changeset viewer.