Changeset 5292
- Timestamp:
- Apr 23, 2015, 1:45:49 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/nanovisviewer.tcl
r5290 r5292 100 100 private method GetColormap { cname color } 101 101 private method GetDatasetsWithComponent { cname } 102 private method GetVolumeInfo { w }103 102 private method HideAllMarkers {} 104 103 private method InitComponentSettings { cname } … … 125 124 private method SlicerTip {axis} 126 125 private method SwitchComponent { cname } 127 private method ToggleVolume { tag name }128 126 private method ViewToQuaternion {} { 129 127 return [list $_view(-qw) $_view(-qx) $_view(-qy) $_view(-qz)] … … 132 130 133 131 private variable _arcball "" 134 135 132 private variable _dlist "" ;# list of data objects 136 133 private variable _obj2ovride ;# maps dataobj => style override … … 148 145 private variable _first "" ;# This is the topmost volume. 149 146 private variable _current "" ;# Currently selected component 150 private variable _volcomponents ;# Array of components found 151 private variable _componentsList ;# Array of components found 147 private variable _volcomponents ;# Maps component name to list of 148 ;# dataobj-component tags 149 private variable _componentsList ;# List of components found 152 150 private variable _cname2transferFunction 153 151 private variable _cname2defaultcolormap 154 155 common _downloadPopup ;# download options from popup156 private common _hardcopy157 152 private variable _width 0 158 153 private variable _height 0 159 154 private variable _resizePending 0 160 155 private variable _resizeLegendPending 0 156 157 common _downloadPopup ;# download options from popup 158 private common _hardcopy 161 159 } 162 160 … … 480 478 # put the dataobj list in order according to -raise options 481 479 set dlist $_dlist 482 foreach obj $dlist {483 if {[info exists _obj2ovride($ obj-raise)] &&484 $_obj2ovride($ obj-raise)} {485 set i [lsearch -exact $dlist $ obj]480 foreach dataobj $dlist { 481 if {[info exists _obj2ovride($dataobj-raise)] && 482 $_obj2ovride($dataobj-raise)} { 483 set i [lsearch -exact $dlist $dataobj] 486 484 if {$i >= 0} { 487 485 set dlist [lreplace $dlist $i $i] 488 lappend dlist $ obj486 lappend dlist $dataobj 489 487 } 490 488 } … … 811 809 812 810 # 813 #814 811 # ReceiveLegend -- 815 812 # … … 819 816 # representing the legend in the canvas. In addition, the 820 817 # active transfer function is displayed. 821 #822 818 # 823 819 itcl::body Rappture::NanovisViewer::ReceiveLegend { cname vmin vmax size } { … … 1098 1094 } 1099 1095 1100 1101 1096 # ---------------------------------------------------------------------- 1102 1097 # USAGE: Rotate click <x> <y> … … 1660 1655 1661 1656 blt::table $inner \ 1662 0,0 $inner.axes -cspan 2 -anchor w \ 1663 1,0 $inner.grid -cspan 2 -anchor w \ 1664 2,0 $inner.outline -cspan 2 -anchor w \ 1665 3,0 $inner.volume -cspan 2 -anchor w \ 1666 4,0 $inner.legend -cspan 2 -anchor w \ 1667 5,0 $inner.background_l -anchor e -pady 2 \ 1668 5,1 $inner.background -fill x \ 1669 1670 if 0 { 1671 bind $inner <Map> [itcl::code $this GetVolumeInfo $inner] 1672 } 1657 0,0 $inner.axes -cspan 2 -anchor w \ 1658 1,0 $inner.grid -cspan 2 -anchor w \ 1659 2,0 $inner.outline -cspan 2 -anchor w \ 1660 3,0 $inner.volume -cspan 2 -anchor w \ 1661 4,0 $inner.legend -cspan 2 -anchor w \ 1662 5,0 $inner.background_l -anchor e -pady 2 \ 1663 5,1 $inner.background -fill x 1664 1673 1665 blt::table configure $inner r* -resize none 1674 1666 blt::table configure $inner r6 -resize expand … … 1980 1972 } 1981 1973 1982 1983 1974 itcl::body Rappture::NanovisViewer::DoResize {} { 1984 1975 $_arcball resize $_width $_height … … 2039 2030 } 2040 2031 2041 itcl::body Rappture::NanovisViewer::GetVolumeInfo { w } {2042 set flowobj ""2043 foreach key [array names _obj2flow] {2044 set flowobj $_obj2flow($key)2045 break2046 }2047 if { $flowobj == "" } {2048 return2049 }2050 if { [winfo exists $w.frame] } {2051 destroy $w.frame2052 }2053 set inner [frame $w.frame]2054 blt::table $w \2055 5,0 $inner -fill both -cspan 2 -anchor nw2056 array set hints [$dataobj hints]2057 2058 label $inner.volumes -text "Volumes" -font "Arial 9 bold"2059 blt::table $inner \2060 1,0 $inner.volumes -anchor w \2061 blt::table configure $inner c0 c1 -resize none2062 blt::table configure $inner c2 -resize expand2063 2064 set row 32065 set volumes [get]2066 if { [llength $volumes] > 0 } {2067 blt::table $inner $row,0 $inner.volumes -anchor w2068 incr row2069 }2070 foreach vol $volumes {2071 array unset info2072 array set info $vol2073 set name $info(name)2074 if { ![info exists _settings(-volumevisible-$name)] } {2075 set _settings(-volumevisible-$name) $info(hide)2076 }2077 checkbutton $inner.vol$row -text $info(label) \2078 -variable [itcl::scope _settings(-volumevisible-$name)] \2079 -onvalue 0 -offvalue 1 \2080 -command [itcl::code $this ToggleVolume $key $name] \2081 -font "Arial 9"2082 Rappture::Tooltip::for $inner.vol$row $info(description)2083 blt::table $inner $row,0 $inner.vol$row -anchor w2084 if { !$_settings(-volume-$name) } {2085 $inner.vol$row select2086 }2087 incr row2088 }2089 blt::table configure $inner r* -resize none2090 blt::table configure $inner r$row -resize expand2091 blt::table configure $inner c3 -resize expand2092 event generate [winfo parent [winfo parent $w]] <Configure>2093 }2094 2095 itcl::body Rappture::NanovisViewer::ToggleVolume { tag name } {2096 set bool $_settings(-volumevisible-$name)2097 SendCmd "volume state $bool $name"2098 }2099 2100 2032 itcl::body Rappture::NanovisViewer::SetOrientation { side } { 2101 2033 array set positions { … … 2121 2053 set _settings(-zoom) $_view(-zoom) 2122 2054 } 2123 2124 2055 2125 2056 #
Note: See TracChangeset
for help on using the changeset viewer.