- Timestamp:
- Dec 18, 2013 12:51:26 PM (10 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/nanovisviewer.tcl
r4075 r4088 105 105 private method GetVolumeInfo { w } 106 106 private method HideAllMarkers {} 107 private method AddNewMarker { x y } 107 108 private method InitComponentSettings { cname } 108 109 private method InitSettings { args } … … 126 127 private method Zoom {option} 127 128 private method ToggleVolume { tag name } 129 private method RemoveMarker { x y } 128 130 129 131 private variable _arcball "" … … 333 335 bind $itk_component(legend) <Configure> \ 334 336 [itcl::code $this EventuallyRedrawLegend] 337 bind $itk_component(legend) <KeyPress-Delete> \ 338 [itcl::code $this RemoveMarker %x %y] 339 bind $itk_component(legend) <Enter> \ 340 [list focus $itk_component(legend)] 335 341 336 342 # Hack around the Tk panewindow. The problem is that the requested … … 773 779 set lx 10 774 780 set ly [expr {$h - 1}] 775 if {"" == [$c find withtag transfunc]} {781 if {"" == [$c find withtag colorbar]} { 776 782 $c create image 10 10 -anchor nw \ 777 -image $_image(legend) -tags transfunc783 -image $_image(legend) -tags colorbar 778 784 $c create text $lx $ly -anchor sw \ 779 785 -fill $itk_option(-plotforeground) -tags "limits text vmin" … … 782 788 $c create text [expr {$w/2}] $ly -anchor s \ 783 789 -fill $itk_option(-plotforeground) -tags "limits text title" 784 $c lower transfunc 790 $c lower colorbar 791 $c bind colorbar <ButtonRelease-1> [itcl::code $this AddNewMarker %x %y] 785 792 } 786 793 … … 1469 1476 } 1470 1477 1478 itcl::body Rappture::NanovisViewer::AddNewMarker { x y } { 1479 if { ![info exists _transferFunctionEditors($_current)] } { 1480 continue 1481 } 1482 # Add a new marker to the current transfer function 1483 $_transferFunctionEditors($_current) newMarker $x $y normal 1484 } 1485 1486 itcl::body Rappture::NanovisViewer::RemoveMarker { x y } { 1487 if { ![info exists _transferFunctionEditors($_current)] } { 1488 continue 1489 } 1490 # Add a new marker to the current transfer function 1491 $_transferFunctionEditors($_current) deleteMarker $x $y 1492 } 1493 1471 1494 # ---------------------------------------------------------------------- 1472 1495 # CONFIGURATION OPTION: -plotbackground … … 2513 2536 return "" 2514 2537 } 2538 2539 -
trunk/gui/scripts/transferfunctioneditor.tcl
r3984 r4088 41 41 private method GetScreenPosition { name } 42 42 private method LeaveTick { name } 43 private method NewMarker { x y state }44 43 private method SetRelativeValue { name x } 45 44 private method GetRelativeValue { name } … … 62 61 public method removeMarkers { list } 63 62 public method addMarkers { values } 63 public method newMarker { x y state } 64 public method deleteMarker { x y } 64 65 public method hideMarkers { {list {}} } 65 66 public method showMarkers { {limits {}} } … … 70 71 set _name $name 71 72 set _limits [list 0.0 1.0] 72 $c bind transfunc <ButtonRelease-1> \73 [itcl::code $this NewMarker %x %y normal]74 73 eval configure $args 75 74 } … … 99 98 } 100 99 101 itcl::body Rappture::TransferFunctionEditor::NewMarker { x y state } { 100 itcl::body Rappture::TransferFunctionEditor::deleteMarker { x y } { 101 foreach marker [GetOverlappingMarkers $x $y] { 102 $_canvas delete $_ticks($marker) 103 $_canvas delete $_labels($marker) 104 array unset _ticks $marker 105 array unset _labels $marker 106 array unset _values $marker 107 bell 108 UpdateViewer 109 } 110 } 111 112 itcl::body Rappture::TransferFunctionEditor::newMarker { x y state } { 102 113 foreach id [$_canvas find overlapping \ 103 114 [expr $x-5] [expr $y-5] [expr $x+5] [expr $y+5]] { … … 315 326 itcl::body Rappture::TransferFunctionEditor::addMarkers { values } { 316 327 foreach value $values { 317 set name [ NewMarker 0 0 hidden]328 set name [newMarker 0 0 hidden] 318 329 SetRelativeValue $name $value 319 330 } -
trunk/gui/scripts/vtkvolumeviewer.tcl
r4084 r4088 70 70 private method GetDatasetsWithComponent { cname } 71 71 private method HideAllMarkers {} 72 private method AddNewMarker { x y } 72 73 private method InitComponentSettings { cname } 73 74 private method ParseLevelsOption { cname levels } … … 78 79 private method SetOrientation { side } 79 80 private method SwitchComponent { cname } 81 private method RemoveMarker { x y } 80 82 81 83 private variable _current ""; # Currently selected component … … 382 384 rename -background -plotbackground plotBackground Background 383 385 } 386 bind $itk_component(legend) <KeyPress-Delete> \ 387 [itcl::code $this RemoveMarker %x %y] 388 bind $itk_component(legend) <Enter> \ 389 [list focus $itk_component(legend)] 384 390 385 391 # Hack around the Tk panewindow. The problem is that the requested … … 2218 2224 set lx 10 2219 2225 set ly [expr {$h - 1}] 2220 if {"" == [$c find withtag transfunc]} {2226 if {"" == [$c find withtag colorbar]} { 2221 2227 $c create image 10 10 -anchor nw \ 2222 -image $_image(legend) -tags transfunc2228 -image $_image(legend) -tags colorbar 2223 2229 $c create text $lx $ly -anchor sw \ 2224 2230 -fill $itk_option(-plotforeground) -tags "limits text vmin" … … 2227 2233 $c create text [expr {$w/2}] $ly -anchor s \ 2228 2234 -fill $itk_option(-plotforeground) -tags "limits text title" 2229 $c lower transfunc 2235 $c lower colorbar 2236 $c bind colorbar <ButtonRelease-1> [itcl::code $this AddNewMarker %x %y] 2230 2237 } 2231 2238 … … 2632 2639 } 2633 2640 2641 itcl::body Rappture::VtkVolumeViewer::AddNewMarker { x y } { 2642 if { ![info exists _transferFunctionEditors($_current)] } { 2643 continue 2644 } 2645 # Add a new marker to the current transfer function 2646 $_transferFunctionEditors($_current) newMarker $x $y normal 2647 } 2648 2649 itcl::body Rappture::VtkVolumeViewer::RemoveMarker { x y } { 2650 if { ![info exists _transferFunctionEditors($_current)] } { 2651 continue 2652 } 2653 # Add a new marker to the current transfer function 2654 $_transferFunctionEditors($_current) deleteMarker $x $y 2655 } 2656 2634 2657 itcl::body Rappture::VtkVolumeViewer::SetOrientation { side } { 2635 2658 array set positions {
Note: See TracChangeset
for help on using the changeset viewer.