Changeset 6414
- Timestamp:
- Jul 1, 2016 7:11:32 AM (8 years ago)
- Location:
- branches/blt4_trunk
- Files:
-
- 4 deleted
- 33 edited
- 22 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4_trunk
- Property svn:mergeinfo changed
/branches/multichoice (added) merged: 6249,6251,6317,6371 /trunk merged: 6352-6353,6355-6357,6359-6362,6365-6367,6370,6372,6376-6377,6379,6405-6407,6410,6412-6413
- Property svn:mergeinfo changed
-
branches/blt4_trunk/configure
r6252 r6414 10225 10225 10226 10226 10227 ac_config_files="$ac_config_files Makefile packages/Makefile src/Makefile src/core/Makefile src/core2/Makefile src/objects/Makefile src/objects/RpHash.h gui/Makefile gui/apps/Makefile gui/apps/about gui/apps/copy_rappture_examples gui/apps/encodedata gui/apps/rappture gui/apps/rappture-csh.env gui/apps/rappture.env gui/apps/rappture.use gui/apps/rerun gui/apps/simsim gui/apps/xmldiff gui/pkgIndex.tcl gui/scripts/Makefile gui/src/Makefile builder/Makefile builder/pkgIndex.tcl builder/scripts/Makefile tester/Makefile tester/pkgIndex.tcl tester/scripts/Makefile lang/Makefile lang/java/Makefile lang/java/rappture/Makefile lang/perl/Makefile lang/perl/Makefile.PL lang/python/Makefile lang/python/setup.py lang/matlab/Makefile lang/octave/Makefile lang/octave/octave2/Makefile lang/octave/octave3/Makefile lang/R/Makefile lang/ruby/Makefile lang/ruby/build.rb lang/tcl/Makefile lang/tcl/pkgIndex.tcl lang/tcl/scripts/Makefile lang/tcl/src/Makefile lang/tcl/tests/Makefile lib/Makefile examples/3D/Makefile examples/Makefile examples/app-fermi/2.0/Makefile examples/app-fermi/Makefile examples/app-fermi/cee/Makefile examples/app-fermi/fortran/Makefile examples/app-fermi/java/Makefile examples/app-fermi/matlab/Makefile examples/app-fermi/matlab/compiled/Makefile examples/app-fermi/matlab/uncompiled/Makefile examples/app-fermi/octave/octave2/Makefile examples/app-fermi/octave/octave3/Makefile examples/app-fermi/octave/Makefile examples/app-fermi/perl/Makefile examples/app-fermi/python/Makefile examples/app-fermi/ruby/Makefile examples/app-fermi/tcl/Makefile examples/app-fermi/wrapper/Makefile examples/app-fermi/wrapper/cee/Makefile examples/app-fermi/wrapper/perl/Makefile examples/app-fermi/wrapper/python/Makefile examples/app-fermi/wrapper/tcl/Makefile examples/app-fermi/R/Makefile examples/c-example/Makefile examples/canvas/Makefile examples/demo.bash examples/flow/Makefile examples/flow/demo1/Makefile examples/flow/demo2/Makefile examples/flow/demo3/Makefile examples/graph/Makefile examples/mapviewer/Makefile examples/mapviewer/camera/Makefile examples/mapviewer/colorramp/Makefile examples/mapviewer/common/Makefile examples/mapviewer/feature/Makefile examples/mapviewer/gdal/Makefile examples/mapviewer/layers/Makefile examples/mapviewer/ogr/Makefile examples/mapviewer/placard/Makefile examples/mapviewer/select/Makefile examples/mapviewer/tms/Makefile examples/mapviewer/wms/Makefile examples/mapviewer/xyz/Makefile examples/objects/Makefile examples/objects/axis/Makefile examples/objects/curve/Makefile examples/objects/dxWriter/Makefile examples/objects/floatBuffer/Makefile examples/objects/histogram/Makefile examples/objects/library/Makefile examples/objects/number/Makefile examples/objects/path/Makefile examples/objects/plot/Makefile examples/objects/scatter/Makefile examples/objects/string/Makefile examples/objects/tree/Makefile examples/objects/xmlparser/Makefile examples/zoo/Makefile examples/zoo/binary/Makefile examples/zoo/boolean/Makefile examples/zoo/choice/Makefile examples/zoo/curve/Makefile examples/zoo/drawing/Makefile examples/zoo/enable/Makefile examples/zoo/field/Makefile examples/zoo/group/Makefile examples/zoo/histogram/Makefile examples/zoo/image/Makefile examples/zoo/image/docs/Makefile examples/zoo/image/examples/Makefile examples/zoo/integer/Makefile examples/zoo/integer2/Makefile examples/zoo/loader/Makefile examples/zoo/loader/examples/Makefile examples/zoo/log/Makefile examples/zoo/mesh/Makefile examples/zoo/ note/Makefile examples/zoo/note/docs/Makefile examples/zoo/number/Makefile examples/zoo/number2/Makefile examples/zoo/parallelepiped/Makefile examples/zoo/periodicelement/Makefile examples/zoo/phase/Makefile examples/zoo/sequence/Makefile examples/zoo/sequence/examples/Makefile examples/zoo/string/Makefile examples/zoo/structure/Makefile examples/zoo/structure/examples/Makefile examples/zoo/table/Makefile video/Makefile video/pkgIndex.tcl oldtest/Makefile oldtest/src/Makefile puq/Makefile puq/puq.sh"10227 ac_config_files="$ac_config_files Makefile packages/Makefile src/Makefile src/core/Makefile src/core2/Makefile src/objects/Makefile src/objects/RpHash.h gui/Makefile gui/apps/Makefile gui/apps/about gui/apps/copy_rappture_examples gui/apps/encodedata gui/apps/rappture gui/apps/rappture-csh.env gui/apps/rappture.env gui/apps/rappture.use gui/apps/rerun gui/apps/simsim gui/apps/xmldiff gui/pkgIndex.tcl gui/scripts/Makefile gui/src/Makefile builder/Makefile builder/pkgIndex.tcl builder/scripts/Makefile tester/Makefile tester/pkgIndex.tcl tester/scripts/Makefile lang/Makefile lang/java/Makefile lang/java/rappture/Makefile lang/perl/Makefile lang/perl/Makefile.PL lang/python/Makefile lang/python/setup.py lang/matlab/Makefile lang/octave/Makefile lang/octave/octave2/Makefile lang/octave/octave3/Makefile lang/R/Makefile lang/ruby/Makefile lang/ruby/build.rb lang/tcl/Makefile lang/tcl/pkgIndex.tcl lang/tcl/scripts/Makefile lang/tcl/src/Makefile lang/tcl/tests/Makefile lib/Makefile examples/3D/Makefile examples/Makefile examples/app-fermi/2.0/Makefile examples/app-fermi/Makefile examples/app-fermi/cee/Makefile examples/app-fermi/fortran/Makefile examples/app-fermi/java/Makefile examples/app-fermi/matlab/Makefile examples/app-fermi/matlab/compiled/Makefile examples/app-fermi/matlab/uncompiled/Makefile examples/app-fermi/octave/octave2/Makefile examples/app-fermi/octave/octave3/Makefile examples/app-fermi/octave/Makefile examples/app-fermi/perl/Makefile examples/app-fermi/python/Makefile examples/app-fermi/ruby/Makefile examples/app-fermi/tcl/Makefile examples/app-fermi/wrapper/Makefile examples/app-fermi/wrapper/cee/Makefile examples/app-fermi/wrapper/perl/Makefile examples/app-fermi/wrapper/python/Makefile examples/app-fermi/wrapper/tcl/Makefile examples/app-fermi/R/Makefile examples/c-example/Makefile examples/canvas/Makefile examples/demo.bash examples/flow/Makefile examples/flow/demo1/Makefile examples/flow/demo2/Makefile examples/flow/demo3/Makefile examples/graph/Makefile examples/mapviewer/Makefile examples/mapviewer/camera/Makefile examples/mapviewer/colorramp/Makefile examples/mapviewer/common/Makefile examples/mapviewer/feature/Makefile examples/mapviewer/gdal/Makefile examples/mapviewer/layers/Makefile examples/mapviewer/ogr/Makefile examples/mapviewer/placard/Makefile examples/mapviewer/select/Makefile examples/mapviewer/tms/Makefile examples/mapviewer/wms/Makefile examples/mapviewer/xyz/Makefile examples/objects/Makefile examples/objects/axis/Makefile examples/objects/curve/Makefile examples/objects/dxWriter/Makefile examples/objects/floatBuffer/Makefile examples/objects/histogram/Makefile examples/objects/library/Makefile examples/objects/number/Makefile examples/objects/path/Makefile examples/objects/plot/Makefile examples/objects/scatter/Makefile examples/objects/string/Makefile examples/objects/tree/Makefile examples/objects/xmlparser/Makefile examples/zoo/Makefile examples/zoo/binary/Makefile examples/zoo/boolean/Makefile examples/zoo/choice/Makefile examples/zoo/curve/Makefile examples/zoo/drawing/Makefile examples/zoo/enable/Makefile examples/zoo/field/Makefile examples/zoo/group/Makefile examples/zoo/histogram/Makefile examples/zoo/image/Makefile examples/zoo/image/docs/Makefile examples/zoo/image/examples/Makefile examples/zoo/integer/Makefile examples/zoo/integer2/Makefile examples/zoo/loader/Makefile examples/zoo/loader/examples/Makefile examples/zoo/log/Makefile examples/zoo/mesh/Makefile examples/zoo/multichoice/Makefile examples/zoo/note/Makefile examples/zoo/note/docs/Makefile examples/zoo/number/Makefile examples/zoo/number2/Makefile examples/zoo/parallelepiped/Makefile examples/zoo/periodicelement/Makefile examples/zoo/phase/Makefile examples/zoo/sequence/Makefile examples/zoo/sequence/examples/Makefile examples/zoo/string/Makefile examples/zoo/structure/Makefile examples/zoo/structure/examples/Makefile examples/zoo/table/Makefile video/Makefile video/pkgIndex.tcl oldtest/Makefile oldtest/src/Makefile puq/Makefile puq/puq.sh" 10228 10228 10229 10229 cat >confcache <<\_ACEOF … … 11045 11045 "examples/zoo/log/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/log/Makefile" ;; 11046 11046 "examples/zoo/mesh/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/mesh/Makefile" ;; 11047 "examples/zoo/multichoice/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/multichoice/Makefile" ;; 11047 11048 "examples/zoo/note/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/note/Makefile" ;; 11048 11049 "examples/zoo/note/docs/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/note/docs/Makefile" ;; -
branches/blt4_trunk/configure.in
r6252 r6414 603 603 examples/zoo/log/Makefile 604 604 examples/zoo/mesh/Makefile 605 examples/zoo/multichoice/Makefile 605 606 examples/zoo/note/Makefile 606 607 examples/zoo/note/docs/Makefile -
branches/blt4_trunk/examples/mapviewer/feature/Makefile.in
r6210 r6414 16 16 destdir = $(prefix)/examples/mapviewer/feature 17 17 FILES = \ 18 $(srcdir)/afr_countries.dbf \ 19 $(srcdir)/afr_countries.prj \ 20 $(srcdir)/afr_countries.shp \ 21 $(srcdir)/afr_countries.shx \ 18 $(srcdir)/afr_elas.dbf \ 19 $(srcdir)/afr_elas.prj \ 20 $(srcdir)/afr_elas.shp \ 21 $(srcdir)/afr_elas.shx \ 22 $(srcdir)/feature_layer_26_colors.tcl \ 23 $(srcdir)/feature_multiple_selection_by_callback.tcl \ 24 $(srcdir)/feature_multiple_selection_by_new_layer.tcl \ 25 $(srcdir)/feature_multiple_selection_by_updated_layer.tcl \ 22 26 $(srcdir)/feature_selector_query.tcl 23 27 -
branches/blt4_trunk/examples/mapviewer/feature/feature_selector_query.tcl
r6286 r6414 28 28 # Parameters for feature layer 29 29 array set ogrParams { 30 url {local://afr_ countries.shp}30 url {local://afr_elas.shp} 31 31 } 32 32 array set countries { -
branches/blt4_trunk/examples/mapviewer/ogr/ogr_csv_icon_example.tcl
r6286 r6414 26 26 } 27 27 28 # create a n feature pointlayer from a csv file using the OGR driver28 # create a feature icon layer from a csv file using the OGR driver 29 29 # the longitude and latitude fields must be named "longitude" and 30 30 # "latitude" respectively -
branches/blt4_trunk/examples/zoo/Makefile.in
r3714 r6414 30 30 log \ 31 31 mesh \ 32 multichoice \ 32 33 note \ 33 34 number \ -
branches/blt4_trunk/gui/scripts/Makefile.in
r6021 r6414 78 78 $(srcdir)/mainwin.tcl \ 79 79 $(srcdir)/map.tcl \ 80 $(srcdir)/mapentry.tcl \ 80 81 $(srcdir)/mapviewer.tcl \ 81 82 $(srcdir)/mesh.tcl \ 82 83 $(srcdir)/meshresult.tcl \ 83 84 $(srcdir)/molvisviewer.tcl \ 85 $(srcdir)/multichoiceentry.tcl \ 84 86 $(srcdir)/nanovisviewer.tcl \ 85 87 $(srcdir)/note.tcl \ -
branches/blt4_trunk/gui/scripts/combobox.tcl
r5659 r6414 175 175 176 176 # ---------------------------------------------------------------------- 177 # USAGE: getValue <value> 178 # 179 # Clients use this to translate a value to a label. 177 # USAGE: current 178 # 179 # Clients use this to retrieve a label from the entry widget and return 180 # its value, if one exists. If no value exists for the label, then the 181 # label is returned. 180 182 # ---------------------------------------------------------------------- 181 183 itcl::body Rappture::Combobox::current {} { -
branches/blt4_trunk/gui/scripts/combochecks.tcl
r5659 r6414 19 19 option add *Combochecks.relief sunken widgetDefault 20 20 option add *Combochecks.width 10 widgetDefault 21 option add *Combochecks.editable yes widgetDefault 21 22 option add *Combochecks.textBackground white widgetDefault 22 23 option add *Combochecks.textForeground black widgetDefault … … 28 29 inherit itk::Widget 29 30 31 itk_option define -editable editable Editable "" 30 32 itk_option define -state state State "normal" 31 33 itk_option define -width width Width 0 32 34 itk_option define -disabledbackground disabledBackground DisabledBackground "" 33 35 itk_option define -disabledforeground disabledForeground DisabledForeground "" 36 itk_option define -interactcommand interactCommand InteractCommand "" 34 37 35 38 constructor {args} { # defined below } 36 39 37 40 public method value {args} 38 public method current {} 41 public method translate {value {defValue ""}} 42 public method label {value} 39 43 public method choices {option args} 40 44 41 45 protected method _entry {option} 42 protected method _ fixDisplay {}46 protected method _dropdown {option} 43 47 protected method _fixState {} 44 48 … … 57 61 keep -foreground -background 58 62 keep -textforeground -textbackground 63 keep -selectbackground -selectforeground -selectborderwidth 59 64 } 60 65 … … 95 100 96 101 itk_component add ddlist { 97 Rappture::Dropdownchecks $itk_component(button).ddlist 98 } 102 Rappture::Dropdownchecks $itk_component(button).ddlist \ 103 -postcommand [itcl::code $this _dropdown post] \ 104 -unpostcommand [itcl::code $this _dropdown unpost] \ 105 } 106 99 107 bind $itk_component(ddlist) <<DropdownchecksSelect>> \ 100 [itcl::code $this _ fixDisplay]108 [itcl::code $this _dropdown select] 101 109 102 110 $itk_component(button) configure -command \ … … 115 123 # ---------------------------------------------------------------------- 116 124 itcl::body Rappture::Combochecks::value {args} { 117 switch -- [llength $args] { 118 0 { 119 # return a list of checked optons 120 set max [$itk_component(ddlist) size] 121 set rlist "" 122 foreach val [$itk_component(ddlist) get -value] { 123 if {[$itk_component(ddlist) state $val]} { 124 lappend rlist $val 125 } 126 } 127 return $rlist 128 } 129 1 { 130 set newval [lindex $args 0] 131 132 $itk_component(ddlist) reset 133 foreach part $newval { 134 $itk_component(ddlist) state $part 1 135 } 136 _fixDisplay 137 138 after 10 [list catch \ 139 [list event generate $itk_component(hull) <<Value>>]] 140 141 } 142 default { 143 error "wrong # args: should be \"value ?newval?\"" 144 } 145 } 125 if {[llength $args] == 1} { 126 set newval [lindex $args 0] 127 128 # FIXME: not sure if I need to update the ddlist just in case 129 # user calls value() without manipulating the ddlist 130 $itk_component(ddlist) reset 131 foreach part $newval { 132 set part [translate $part] 133 $itk_component(ddlist) state $part 1 134 } 135 136 $itk_component(entry) configure -state normal 137 $itk_component(entry) delete 0 end 138 $itk_component(entry) insert end [join $newval {, }] 139 if {!$itk_option(-editable)} { 140 $itk_component(entry) configure -state disabled 141 } 142 143 after 10 [list catch \ 144 [list event generate $itk_component(hull) <<Value>>]] 145 } elseif {[llength $args] != 0} { 146 error "wrong # args: should be \"value ?newval?\"" 147 } 148 return [$itk_component(entry) get] 149 } 150 151 # ---------------------------------------------------------------------- 152 # USAGE: translate <value> 153 # 154 # Clients use this to translate a value from the entry part of the 155 # combobox to one of the underlying values in the combobox. If the 156 # <value> string matches one of the labels for the choices, this 157 # method returns the corresponding value. Otherwise, it returns "". 158 # ---------------------------------------------------------------------- 159 itcl::body Rappture::Combochecks::translate {value {defValue ""}} { 160 foreach {val label} [choices get -both] { 161 if {$label eq $value} { 162 return $val 163 } 164 } 165 return $defValue 166 } 167 168 # ---------------------------------------------------------------------- 169 # USAGE: label <value> 170 # 171 # Clients use this to translate a value to a label. 172 # ---------------------------------------------------------------------- 173 itcl::body Rappture::Combochecks::label { myValue } { 174 foreach {val label} [choices get -both] { 175 if {$myValue == $val} { 176 return $label 177 } 178 } 179 return "" 146 180 } 147 181 … … 167 201 # USAGE: _entry click 168 202 # 203 # Used internally to handle the entry widget for this combobox. The 204 # click option is invoked when the user click on the entry widget and 205 # performs a post operation on the dropdown list. The apply option 206 # is invoked when the user presses the Return key to set the value of 207 # the entry widget or selects a value. It generates a Value signal. 208 # ---------------------------------------------------------------------- 209 itcl::body Rappture::Combochecks::_entry {option} { 210 switch -- $option { 211 apply { 212 if {$itk_option(-editable) && $itk_option(-state) == "normal"} { 213 event generate $itk_component(hull) <<Value>> 214 if {[string length $itk_option(-interactcommand)] > 0} { 215 uplevel #0 $itk_option(-interactcommand) 216 } 217 } 218 } 219 click { 220 if {!$itk_option(-editable) && $itk_option(-state) == "normal"} { 221 $itk_component(button) configure -relief sunken 222 update idletasks; after 100 223 $itk_component(button) configure -relief raised 224 225 $itk_component(ddlist) post $itk_component(hull) left 226 } 227 } 228 default { 229 error "bad option \"$option\": should be apply, click" 230 } 231 } 232 } 233 234 # ---------------------------------------------------------------------- 235 # USAGE: _dropdown post 236 # USAGE: _dropdown unpost 237 # USAGE: _dropdown select 238 # 169 239 # Used internally to handle the dropdown list for this combobox. The 170 240 # post/unpost options are invoked when the list is posted or unposted 171 241 # to manage the relief of the controlling button. The select option 172 242 # is invoked whenever there is a selection from the list, to assign 173 # the value back to the gauge.174 # ---------------------------------------------------------------------- 175 itcl::body Rappture::Combochecks::_ entry{option} {243 # the value back to the entry. 244 # ---------------------------------------------------------------------- 245 itcl::body Rappture::Combochecks::_dropdown {option} { 176 246 switch -- $option { 177 apply { 178 if {$itk_option(-state) == "normal"} { 179 event generate $itk_component(hull) <<Value>> 180 } 181 } 182 click { 183 if {$itk_option(-state) == "normal"} { 184 $itk_component(button) configure -relief sunken 185 update idletasks; after 100 186 $itk_component(button) configure -relief raised 187 188 $itk_component(ddlist) post $itk_component(hull) left 247 post { 248 # set value [$itk_component(entry) get] 249 # set i [$itk_component(ddlist) index -label $value] 250 # if {$i >= 0} { 251 # $itk_component(ddlist) select clear 0 end 252 # $itk_component(ddlist) select set $i 253 # } 254 } 255 unpost { 256 if {$itk_option(-editable)} { 257 focus $itk_component(entry) 258 } 259 } 260 select { 261 set newval [$itk_component(ddlist) current -label] 262 set val [$itk_component(entry) get] 263 if {$newval ne "" && $newval ne $val} { 264 value $newval 265 if {[string length $itk_option(-interactcommand)] > 0} { 266 uplevel #0 $itk_option(-interactcommand) 267 } 268 } 269 if {$newval eq ""} { 270 value $val 189 271 } 190 272 } 191 273 default { 192 error "bad option \"$option\": should be apply, click" 193 } 194 } 195 } 196 197 # ---------------------------------------------------------------------- 198 # USAGE: _fixDisplay 199 # 200 # Used internally to handle the dropdown list for this combobox. 201 # Invoked whenever there is a selection from the list, to assign 202 # the value back to the entry. 203 # ---------------------------------------------------------------------- 204 itcl::body Rappture::Combochecks::_fixDisplay {} { 205 $itk_component(entry) configure -state normal 206 $itk_component(entry) delete 0 end 207 $itk_component(entry) insert end [join [value] {, }] 208 $itk_component(entry) configure -state disabled 274 error "bad option \"$option\": should be post, unpost, select" 275 } 276 } 209 277 } 210 278 … … 212 280 # USAGE: _fixState 213 281 # 214 # Used internally to fix the widget state when the - state option215 # changes.282 # Used internally to fix the widget state when the -editable/-state 283 # options change. 216 284 # ---------------------------------------------------------------------- 217 285 itcl::body Rappture::Combochecks::_fixState {} { … … 232 300 } 233 301 234 if {$itk_option(-state) != "normal"} { 302 if {$itk_option(-editable)} { 303 if {$itk_option(-state) == "normal"} { 304 $itk_component(entry) configure -state normal 305 } else { 306 $itk_component(entry) configure -state disabled 307 } 308 } else { 309 $itk_component(entry) configure -state disabled 310 } 311 312 if {!$itk_option(-editable) || $itk_option(-state) != "normal"} { 235 313 # can't keep focus here -- move it along to the next widget 236 314 if {[focus] == $itk_component(entry)} { … … 238 316 } 239 317 } 318 } 319 320 # ---------------------------------------------------------------------- 321 # CONFIGURATION OPTION: -editable 322 # ---------------------------------------------------------------------- 323 itcl::configbody Rappture::Combochecks::editable { 324 if {![string is boolean -strict $itk_option(-editable)]} { 325 error "bad value \"$itk_option(-editable)\": should be boolean" 326 } 327 _fixState 240 328 } 241 329 -
branches/blt4_trunk/gui/scripts/controlOwner.tcl
r5659 r6414 67 67 integer current 68 68 loader current 69 multichoice current 69 70 note contents 70 71 number current -
branches/blt4_trunk/gui/scripts/controls.tcl
r5659 r6414 156 156 bind $w <<Value>> [itcl::code $this _controlChanged $name] 157 157 } 158 multichoice { 159 Rappture::MultiChoiceEntry $w $_owner $path 160 bind $w <<Value>> [itcl::code $this _controlChanged $name] 161 } 158 162 number { 159 163 Rappture::NumberEntry $w $_owner $path … … 174 178 drawing { 175 179 Rappture::DrawingEntry $w $_owner $path 180 } 181 map { 182 Rappture::MapEntry $w $_owner $path 176 183 } 177 184 image { … … 276 283 $_owner widgetfor $path $w 277 284 278 if {[lsearch {control group drawing separator note} $type] < 0} {285 if {[lsearch {control group drawing map separator note} $type] < 0} { 279 286 # make a label for this control 280 287 set label [$w label] -
branches/blt4_trunk/gui/scripts/dropdownchecks.tcl
r5659 r6414 38 38 public method state {value {newval ""}} 39 39 public method reset {} 40 public method current {{what -value}} 40 41 41 42 private variable _dispatcher "" ;# dispatcher for !events … … 280 281 set _states($val) 0 281 282 } 283 } 284 285 # ---------------------------------------------------------------------- 286 # USAGE: current ?-value|-label|-both? 287 # 288 # Clients use this to query the current selections from the listbox/canvas. 289 # Returns a list of values, labels, or list of lists of both, according 290 # to the option. 291 # ---------------------------------------------------------------------- 292 itcl::body Rappture::Dropdownchecks::current {{what -value}} { 293 set rlist "" 294 set l [llength $_values] 295 for {set i 0} {$i < $l} {incr i} { 296 set val [lindex $_values $i] 297 if {$_states($val)} { 298 switch -- $what { 299 -value { lappend rlist [lindex $_values $i] } 300 -label { lappend rlist [lindex $_labels $i] } 301 -both { lappend rlist [list [lindex $_values $i] \ 302 [lindex $_labels $i]] } 303 default { 304 error "bad option \"$what\": should be -value, -label, -both" 305 } 306 } 307 } 308 } 309 return $rlist 282 310 } 283 311 -
branches/blt4_trunk/gui/scripts/field.tcl
r5763 r6414 882 882 continue; # Ignore this component 883 883 } 884 ReadVtkDataSet $cname $contents 884 if { ![ReadVtkDataSet $cname $contents] } { 885 puts stderr "WARNING: Invalid VTK file for \"$_path.$cname.vtk\"" 886 continue; # Ignore this component 887 } 885 888 set _comp2vtk($cname) $contents 886 889 set _comp2style($cname) [$_field get $cname.style] … … 918 921 # dimensions based on the bounds (sets _dim). We rely on this 919 922 # conversion for limits even if we send DX data to nanovis. 920 ReadVtkDataSet $cname $vtkdata 923 if { ![ReadVtkDataSet $cname $vtkdata] } { 924 puts stderr "WARNING: Could not parse generated VTK for \"$_path.$cname.$type\"" 925 continue; # Ignore this component 926 } 921 927 if 0 { 922 928 set f [open /tmp/$_path.$cname.vtk "w"] … … 952 958 } 953 959 set vtkdata [DicomToVtk $cname $contents] 960 if { $vtkdata == "" } { 961 puts stderr "WARNING: Could not parse generated VTK for \"$_path.$cname.$type\"" 962 continue; # Ignore this component 963 } 954 964 if { $_viewer == "" } { 955 965 set _viewer [expr {($_dim == 3) ? "vtkvolume" : "vtkimage"}] … … 964 974 } 965 975 set vtkdata [AvsToVtk $cname $contents] 966 ReadVtkDataSet $cname $vtkdata 976 if { ![ReadVtkDataSet $cname $vtkdata] } { 977 puts stderr "WARNING: Could not parse generated VTK for \"$_path.$cname.$type\"" 978 continue; # Ignore this component 979 } 967 980 set _comp2vtk($cname) $vtkdata 968 981 set _comp2style($cname) [$_field get $cname.style] … … 1181 1194 1182 1195 set dataset [$reader GetOutput] 1196 if { $dataset == "" } { 1197 puts stderr "Failed to parse VTK file" 1198 rename $reader "" 1199 return 0 1200 } 1183 1201 set limits {} 1184 1202 foreach {xmin xmax ymin ymax zmin zmax} [$dataset GetBounds] break 1203 if {$xmin > $xmax || $ymin > $ymax || $zmin > $zmax} { 1204 puts stderr "Invalid VTK file" 1205 rename $reader "" 1206 return 0 1207 } 1185 1208 # Figure out the dimension of the mesh from the bounds. 1186 1209 set _dim 0 … … 1293 1316 1294 1317 rename $reader "" 1318 return 1 1295 1319 } 1296 1320 … … 1652 1676 if { ![file exists $path] } { 1653 1677 puts stderr "path \"$path\" doesn't exist." 1654 return 01678 return "" 1655 1679 } 1656 1680 … … 1661 1685 if { [llength $files] == 0 } { 1662 1686 puts stderr "no dicom files found in \"$path\"" 1663 return 01687 return "" 1664 1688 } 1665 1689 } … … 1686 1710 } 1687 1711 1688 ReadVtkDataSet $cname $data(vtkdata) 1712 if { ![ReadVtkDataSet $cname $data(vtkdata)] } { 1713 return "" 1714 } 1689 1715 return $data(vtkdata) 1690 1716 } -
branches/blt4_trunk/gui/scripts/flowvisviewer.tcl
r6351 r6414 1095 1095 DoResize 1096 1096 } 1097 1097 if { $_reset } { 1098 InitSettings -background -axesvisible -gridvisible 1099 } 1098 1100 set _first "" 1099 1101 foreach dataobj [get -objects] { … … 1148 1150 1149 1151 if { $_reset } { 1150 InitSettings -axesvisible -gridvisible \ 1151 -opacity -light2side -isosurfaceshading \ 1152 InitSettings -opacity -light2side -isosurfaceshading \ 1152 1153 -ambient -diffuse -specularlevel -specularexponent 1153 1154 -
branches/blt4_trunk/gui/scripts/map.tcl
r6351 r6414 81 81 protected method parseXML { xmlobj path } 82 82 83 protected proc colorToHTML { color } 84 protected proc fixBoolean { val } 85 protected proc fixEnum { str } 86 protected proc fixQuotes { str } 87 protected proc isBooleanProp { prop } 88 protected proc isColorProp { prop } 83 89 protected proc isFileProp { prop } 84 90 protected proc parseStylesheet { stylesheet } 91 protected proc styleToCSS { layerType props {styleName "style"} } 92 protected proc translateProp { layerType styleProp styleValue } 85 93 86 94 private variable _tree ""; # Tree of information about the map. … … 1074 1082 } 1075 1083 1084 itcl::body Rappture::Map::styleToCSS { layerType props {styleName "style"} } { 1085 append output "$styleName { " 1086 foreach {name value} $props { 1087 if {[string range $name 0 0] eq "-"} { 1088 set name [string range $name 1 end] 1089 } 1090 # These aren't really style properties 1091 if {$name eq "minrange" || $name eq "maxrange" } { 1092 continue 1093 } 1094 foreach {name value} [translateProp $layerType $name $value] {} 1095 # TODO: Fix quoting 1096 if {$name ne ""} { 1097 append output "$name: $value; " 1098 } 1099 } 1100 append output "}" 1101 return $output 1102 } 1103 1104 itcl::body Rappture::Map::colorToHTML { color } { 1105 foreach {r g b} [winfo rgb . $color] break 1106 return [format "#%02X%02X%02X" [expr {$r/256}] [expr {$g/256}] [expr {$b/256}]] 1107 } 1108 1109 itcl::body Rappture::Map::isColorProp { prop } { 1110 foreach colorprop { fill stroke point-fill text-fill text-halo } { 1111 if { $prop eq $colorprop } { 1112 return 1 1113 } 1114 } 1115 return 0 1116 } 1117 1118 itcl::body Rappture::Map::isBooleanProp { prop } { 1119 foreach boolprop { 1120 extrusion-flatten 1121 skin-tiled 1122 icon-declutter 1123 render-depth-test 1124 render-lighting 1125 render-transparent 1126 render-depth-offset 1127 text-declutter 1128 } { 1129 if { $prop eq $boolprop } { 1130 return 1 1131 } 1132 } 1133 return 0 1134 } 1135 1076 1136 itcl::body Rappture::Map::isFileProp { prop } { 1077 1137 foreach fileprop { … … 1084 1144 } 1085 1145 return 0 1146 } 1147 1148 itcl::body Rappture::Map::fixQuotes { str } { 1149 return [string map {"\{" "\"" "\}" "\""} [list $str]] 1150 } 1151 1152 itcl::body Rappture::Map::fixEnum { str } { 1153 return [string map {"_" "-"} $str] 1154 } 1155 1156 itcl::body Rappture::Map::fixBoolean { val } { 1157 if { $val } { 1158 return "true" 1159 } else { 1160 return "false" 1161 } 1162 } 1163 1164 itcl::body Rappture::Map::translateProp { layerType styleProp styleValue } { 1165 switch -- $layerType { 1166 "icon" { 1167 array set trans { 1168 "align" "icon-align" 1169 "clamping" "altitude-clamping" 1170 "clamptechnique" "altitude-technique" 1171 "declutter" "icon-declutter" 1172 "library" "icon-library" 1173 "minbias" "render-depth-offset-min-bias" 1174 "maxbias" "render-depth-offset-max-bias" 1175 "scale" "icon-scale" 1176 "heading" "icon-heading" 1177 "placement" "icon-placement" 1178 "url" "icon" 1179 } 1180 } 1181 "label" { 1182 array set trans { 1183 "align" "text-align" 1184 "clamping" "altitude-clamping" 1185 "clamptechnique" "altitude-technique" 1186 "color" "text-fill" 1187 "content" "text-content" 1188 "declutter" "text-declutter" 1189 "font" "text-font" 1190 "fontsize" "text-size" 1191 "halocolor" "text-halo" 1192 "halowidth" "text-halo-offset" 1193 "layout" "text-layout" 1194 "minbias" "render-depth-offset-min-bias" 1195 "maxbias" "render-depth-offset-max-bias" 1196 "priority" "text-priority" 1197 "xoffset" "text-offset-x" 1198 "yoffset" "text-offset-y" 1199 } 1200 } 1201 "line" { 1202 array set trans { 1203 "cap" "stroke-linecap" 1204 "clamping" "altitude-clamping" 1205 "clamptechnique" "altitude-technique" 1206 "color" "stroke" 1207 "join" "stroke-linejoin" 1208 "minbias" "render-depth-offset-min-bias" 1209 "maxbias" "render-depth-offset-max-bias" 1210 "stipplepattern" "stroke-stipple-pattern" 1211 "stipplefactor" "stroke-stipple-factor" 1212 "width" "stroke-width" 1213 } 1214 } 1215 "point" { 1216 array set trans { 1217 "clamping" "altitude-clamping" 1218 "clamptechnique" "altitude-technique" 1219 "color" "point-fill" 1220 "minbias" "render-depth-offset-min-bias" 1221 "maxbias" "render-depth-offset-max-bias" 1222 "size" "point-size" 1223 } 1224 } 1225 "polygon" { 1226 array set trans { 1227 "clamping" "altitude-clamping" 1228 "clamptechnique" "altitude-technique" 1229 "color" "fill" 1230 "minbias" "render-depth-offset-min-bias" 1231 "maxbias" "render-depth-offset-max-bias" 1232 "strokecolor" "stroke" 1233 "strokewidth" "stroke-width" 1234 } 1235 } 1236 "image" - "elevation" - "feature" { 1237 } 1238 default { 1239 error "Unknown layer type: \"$layerType\"" 1240 } 1241 } 1242 if {[info exists trans($styleProp)]} { 1243 set styleProp $trans($styleProp) 1244 } 1245 if {[isColorProp $styleProp]} { 1246 set styleValue [colorToHTML $styleValue] 1247 } 1248 if {$styleProp eq "icon-scale" && $styleValue eq ""} { 1249 set styleProp "" 1250 } 1251 if {$styleProp eq "icon-heading" && $styleValue eq ""} { 1252 set styleProp "" 1253 } 1254 if {$styleProp eq "text-align" || $styleProp eq "icon-align"} { 1255 set styleValue [fixEnum $styleValue] 1256 } 1257 if {[isBooleanProp $styleProp]} { 1258 set styleValue [fixBoolean $styleValue] 1259 } 1260 set styleValue [fixQuotes $styleValue] 1261 return [list $styleProp $styleValue] 1086 1262 } 1087 1263 -
branches/blt4_trunk/gui/scripts/mapviewer.tcl
r6351 r6414 36 36 inherit Rappture::VisViewer 37 37 38 itk_option define -map map Map "" 38 39 itk_option define -plotforeground plotForeground Foreground "" 39 40 itk_option define -plotbackground plotBackground Background "" … … 61 62 public method parameters {title args} { # do nothing } 62 63 public method placard {option args} 63 public method refresh {} { Rebuild } 64 public method refresh {} { 65 Rebuild 66 # Temporary hack to fix one frame delay in update 67 SendCmd "imgflush" 68 SendCmd "renderer render" 69 } 64 70 public method scale {args} 65 71 public method select {option {args ""}} … … 1166 1172 lappend info "installdir" "$Rappture::installdir" 1167 1173 lappend info "hub" [exec hostname] 1174 lappend info "hub_url" [Rappture::Tool::resources -huburl] 1168 1175 lappend info "client" "mapviewer" 1169 1176 lappend info "user" $user … … 2808 2815 } 2809 2816 } 2810 set format ""2811 set wfsType ""2812 2817 SendStylesheetFiles $info(stylesheet) 2813 2818 set ssSize [string length $info(stylesheet)] 2814 2819 set scriptSize [string length $script] 2815 2820 set selectorsSize [string length $selectors] 2816 if { [info exists info(ogr.connection)] } { 2817 set cmd [list map layer add $tag feature db $format $info(ogr.layer) $info(ogr.connection) $info(cache) $ssSize $scriptSize $selectorsSize] 2818 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2819 lappend cmd $style(-minrange) $style(-maxrange) 2820 } 2821 } else { 2822 set cmd [list map layer add $tag feature $info(driver) $format $wfsType $info(ogr.url) $info(cache) $ssSize $scriptSize $selectorsSize] 2823 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2824 lappend cmd $style(-minrange) $style(-maxrange) 2825 } 2826 SendFiles $info(ogr.url) 2821 switch -- $info(driver) { 2822 "ogr" { 2823 if { [info exists info(ogr.connection)] } { 2824 set cmd [list map layer add $tag feature db {} $info(ogr.layer) $info(ogr.connection) $info(cache) $ssSize $scriptSize $selectorsSize] 2825 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2826 lappend cmd $style(-minrange) $style(-maxrange) 2827 } 2828 } else { 2829 set cmd [list map layer add $tag feature $info(driver) {} {} $info(ogr.url) $info(cache) $ssSize $scriptSize $selectorsSize] 2830 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2831 lappend cmd $style(-minrange) $style(-maxrange) 2832 } 2833 SendFiles $info(ogr.url) 2834 } 2835 } 2836 "tfs" { 2837 set format "json" 2838 if {[info exists info(tfs.format)]} { 2839 set format $info(tfs.format) 2840 } 2841 set cmd [list map layer add $tag feature $info(driver) $format {} $info(tfs.url) $info(cache) $ssSize $scriptSize $selectorsSize] 2842 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2843 lappend cmd $style(-minrange) $style(-maxrange) 2844 } 2845 } 2846 "wfs" { 2847 set format "json" 2848 if {[info exists info(wfs.format)]} { 2849 set format $info(wfs.format) 2850 } 2851 set wfsType "" 2852 if {[info exists info(wfs.typename)]} { 2853 set wfsType $info(wfs.typename) 2854 } 2855 set cmd [list map layer add $tag feature $info(driver) $format $wfsType $info(wfs.url) $info(cache) $ssSize $scriptSize $selectorsSize] 2856 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2857 lappend cmd $style(-minrange) $style(-maxrange) 2858 } 2859 } 2827 2860 } 2828 2861 SendCmd $cmd 2829 if { $ssSize > 0 } { SendData $info(stylesheet) }2830 if { $scriptSize > 0 } { SendData $script }2831 if { $selectorsSize > 0 } { SendData $selectors }2862 if { $ssSize > 0 } { SendData $info(stylesheet) } 2863 if { $scriptSize > 0 } { SendData $script } 2864 if { $selectorsSize > 0 } { SendData $selectors } 2832 2865 SendCmd "map layer opacity $style(-opacity) $tag" 2833 2866 } … … 3262 3295 } 3263 3296 } 3297 3298 # ---------------------------------------------------------------------- 3299 # OPTION: -map 3300 # ---------------------------------------------------------------------- 3301 itcl::configbody Rappture::MapViewer::map { 3302 if {$itk_option(-map) != "" } { 3303 if {[catch {$itk_option(-map) isa Rappture::Map} valid] != 0 || !$valid} { 3304 error "bad value \"$itk_option(-map)\": should be Rappture::Map object" 3305 } 3306 $this clear 3307 $this add $itk_option(-map) 3308 $this scale $itk_option(-map) 3309 } else { 3310 $this clear 3311 } 3312 3313 if { [isconnected] } { 3314 $_dispatcher event -idle !rebuild 3315 } 3316 } -
branches/blt4_trunk/gui/scripts/nanovisviewer.tcl
r6351 r6414 871 871 DoResize 872 872 } 873 873 if { $_reset } { 874 InitSettings -background -axesvisible -gridvisible 875 } 874 876 set _first "" 875 877 SendCmd "volume state 0" … … 926 928 927 929 if { $_reset } { 928 InitSettings -axesvisible -gridvisible \ 929 -opacity -light2side -isosurfaceshading \ 930 InitSettings -opacity -light2side -isosurfaceshading \ 930 931 -ambient -diffuse -specularlevel -specularexponent \ 931 932 -current -
branches/blt4_trunk/gui/scripts/page.tcl
r5659 r6414 176 176 set type [$obj element -as type] 177 177 switch -- $type { 178 number - integer - boolean - choice {178 number - integer - boolean - choice - multichoice { 179 179 Rappture::ResultViewer $w -width 0 -height 0 180 180 pack $w -fill x -padx 4 -pady 4 -
branches/blt4_trunk/gui/scripts/resultviewer.tcl
r6052 r6414 26 26 27 27 constructor {args} { 28 28 # defined below 29 29 } 30 30 destructor { … … 395 395 } 396 396 } 397 boolean - choice {397 boolean - choice - multichoice { 398 398 set mode "value" 399 399 if {![info exists _mode2widget($mode)]} { … … 549 549 set dobj [$xmlobj element -as object $path] 550 550 } 551 number - integer - boolean - choice {551 number - integer - boolean - choice - multichoice { 552 552 set dobj [$xmlobj element -as object $path] 553 553 } -
branches/blt4_trunk/gui/scripts/sequence.tcl
r6031 r6414 86 86 set obj [Rappture::Field ::\#auto $xmlobj $path.$name.$cname] 87 87 } 88 image { 89 set obj [Rappture::Image ::\#auto $xmlobj $path.$name.$cname] 90 } 88 91 map { 89 92 set obj [Rappture::Map ::\#auto $xmlobj $path.$name.$cname] 90 93 } 91 image{92 set obj [Rappture:: Image::\#auto $xmlobj $path.$name.$cname]94 mesh { 95 set obj [Rappture::Mesh ::\#auto $xmlobj $path.$name.$cname] 93 96 } 94 97 structure { -
branches/blt4_trunk/gui/scripts/sequencedial.tcl
r5659 r6414 56 56 itk_option define -interactcommand interactCommand InteractCommand "" 57 57 58 59 58 constructor {args} { # defined below } 60 59 destructor { # defined below } -
branches/blt4_trunk/gui/scripts/sequenceresult.tcl
r6052 r6414 498 498 pack $w -expand yes -fill both 499 499 } 500 ::Rappture::Mesh { 501 Rappture::VtkMeshViewer $w 502 pack $w -expand yes -fill both 503 } 500 504 ::Rappture::LibraryObj { 501 505 switch -- [$dataobj element -as type] { -
branches/blt4_trunk/gui/scripts/vtkglyphviewer.tcl
r6351 r6414 151 151 private variable _rotatePending 0 152 152 private variable _cutplanePending 0 153 private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar)154 153 private variable _fields 155 154 private variable _curFldName "" 156 155 private variable _curFldLabel "" 157 156 private variable _curFldComp 3 157 private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar) 158 158 private variable _mouseOver ""; # what called LegendRangeAction: 159 159 # vmin or vmax … … 626 626 set _dlist [lreplace $_dlist $pos $pos] 627 627 array unset _obj2ovride $dataobj-* 628 array unset _settings $dataobj-*629 628 set changed 1 630 629 } … … 1319 1318 itcl::body Rappture::VtkGlyphViewer::InitSettings { args } { 1320 1319 foreach spec $args { 1321 if { [info exists _settings($_first${spec})] } {1322 # Reset global setting with dataobj specific setting1323 set _settings($spec) $_settings($_first${spec})1324 }1325 1320 AdjustSetting $spec 1326 1321 } … … 1383 1378 } else { 1384 1379 if { !$_settings(-colormapvisible) } { 1385 SendCmd "glyphs colormode $_colorMode $_curFldName"1380 SendCmd [list glyphs colormode $_colorMode $_curFldName] 1386 1381 set _settings(-colormapvisible) 1 1387 1382 } … … 1464 1459 SetMinMaxGauges $vmin $vmax 1465 1460 } 1466 SendCmd "dataset maprange explicit $vmin $vmax $_curFldName point_data $_curFldComp"1467 } 1468 #SendCmd "cutplane colormode $_colorMode $_curFldName"1469 SendCmd "glyphs colormode $_colorMode $_curFldName"1461 SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName point_data $_curFldComp] 1462 } 1463 #SendCmd [list cutplane colormode $_colorMode $_curFldName] 1464 SendCmd [list glyphs colormode $_colorMode $_curFldName] 1470 1465 DrawLegend 1471 1466 } … … 1568 1563 foreach { vmin vmax } $_limits($_curFldName) break 1569 1564 } 1570 SendCmd "dataset maprange explicit $vmin $vmax $_curFldName point_data $_curFldComp"1565 SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName point_data $_curFldComp] 1571 1566 DrawLegend 1572 1567 } … … 1650 1645 set _colormaps($cmap) 1 1651 1646 } 1652 #SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0"1647 #SendCmd [list legend $cmap $_colorMode $_curFldName {} $w $h 0] 1653 1648 SendCmd "legend2 $cmap $w $h" 1654 1649 } … … 2432 2427 set _settings(-colormap) "none" 2433 2428 } else { 2434 SendCmd "glyphs colormode $style(-colormode) $_curFldName $tag"2429 SendCmd [list glyphs colormode $style(-colormode) $_curFldName $tag] 2435 2430 set _settings(-colormapvisible) 1 2436 2431 set _settings(-colormap) $style(-color) … … 3113 3108 $itk_component(field) value $_curFldLabel 3114 3109 if { $_settings(-customrange) } { 3115 set limits [list [$itk_component(min) value] [$itk_component(max) value]] 3116 SendCmd "dataset maprange explicit $limits $_curFldName point_data $_curFldComp" 3110 set vmin [$itk_component(min) value] 3111 set vmax [$itk_component(max) value] 3112 SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName point_data $_curFldComp] 3117 3113 } else { 3118 3114 if { ![info exists _limits($_curFldName)] } { 3119 3115 SendCmd "dataset maprange all" 3120 3116 } else { 3121 set limits $_limits($_curFldName)3122 SendCmd "dataset maprange explicit $limits $_curFldName point_data $_curFldComp"3123 } 3124 } 3125 } 3117 foreach { vmin vmax } $_limits($_curFldName) break 3118 SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName point_data $_curFldComp] 3119 } 3120 } 3121 } -
branches/blt4_trunk/gui/scripts/vtkheightmapviewer.tcl
r6351 r6414 103 103 private method Rotate {option x y} 104 104 private method SetCurrentColormap { color } 105 private method SetCurrentFieldName { dataobj } 105 106 private method SetLegendTip { x y } 106 107 private method SetObjectStyle { dataobj comp } … … 261 262 262 263 itk_component add fieldmenu { 263 menu $itk_component(plotarea).menu \ 264 -relief flat \ 265 -tearoff 0 264 menu $itk_component(plotarea).menu -relief flat -tearoff 0 266 265 } { 267 266 usual … … 292 291 } 293 292 pack $itk_component(reset) -side top -padx 2 -pady { 2 0 } 294 Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level" 293 Rappture::Tooltip::for $itk_component(reset) \ 294 "Reset the view to the default zoom level" 295 295 296 296 itk_component add zoomin { … … 526 526 set _dlist [lreplace $_dlist $pos $pos] 527 527 array unset _obj2ovride $dataobj-* 528 array unset _settings $dataobj-*529 528 set changed 1 530 529 } … … 923 922 # Reset the camera and other view parameters 924 923 # 925 InitSettings -isheightmap -background 924 InitSettings -isheightmap -background \ 925 -xgrid -ygrid -zgrid -axismode \ 926 -axesvisible -axislabels -axisminorticks 926 927 927 928 # Setting a custom exponent and label format for axes is causing … … 936 937 #SendCmd "axis exp 0 0 0 1" 937 938 939 SendCmd "axis tickpos outside" 938 940 SendCmd "axis lrot z 90" 939 941 $_arcball quaternion [ViewToQuaternion] … … 960 962 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 961 963 set _first $dataobj 964 SetCurrentFieldName $dataobj 962 965 } 963 966 foreach comp [$dataobj components] { … … 1001 1004 } 1002 1005 } 1003 if { $_first != "" } { 1004 $itk_component(field) choices delete 0 end 1005 $itk_component(fieldmenu) delete 0 end 1006 array unset _fields 1007 set _curFldName "" 1008 foreach cname [$_first components] { 1009 foreach fname [$_first fieldnames $cname] { 1010 if { [info exists _fields($fname)] } { 1011 continue 1012 } 1013 foreach { label units components } \ 1014 [$_first fieldinfo $fname] break 1015 $itk_component(field) choices insert end "$fname" "$label" 1016 $itk_component(fieldmenu) add radiobutton -label "$label" \ 1017 -value $label -variable [itcl::scope _curFldLabel] \ 1018 -selectcolor red \ 1019 -activebackground $itk_option(-plotbackground) \ 1020 -activeforeground $itk_option(-plotforeground) \ 1021 -font "Arial 8" \ 1022 -command [itcl::code $this LegendTitleAction save] 1023 set _fields($fname) [list $label $units $components] 1024 if { $_curFldName == "" } { 1025 set _curFldName $fname 1026 set _curFldLabel $label 1027 } 1028 } 1029 } 1030 $itk_component(field) value $_curFldLabel 1031 } 1006 1032 1007 InitSettings -stretchtofit -outline 1033 1034 1008 if { $_reset } { 1035 SendCmd "axis tickpos outside"1036 #SendCmd "axis lformat all %g"1037 1038 1009 foreach axis { x y z } { 1039 1010 set label "" … … 1092 1063 } 1093 1064 PanCamera 1094 InitSettings -xgrid -ygrid -zgrid \ 1095 -axesvisible -axislabels -heightmapscale -field -isheightmap \ 1096 -numisolines 1065 InitSettings -heightmapscale -field -isheightmap -numisolines 1097 1066 if { [array size _fields] < 2 } { 1098 1067 catch {blt::table forget $itk_component(field) $itk_component(field_l)} … … 1334 1303 itcl::body Rappture::VtkHeightmapViewer::InitSettings { args } { 1335 1304 foreach spec $args { 1336 if { [info exists _settings($_first${spec})] } {1337 # Reset global setting with dataobj specific setting1338 set _settings($spec) $_settings($_first${spec})1339 }1340 1305 AdjustSetting $spec 1341 1306 } … … 1486 1451 # Get the new limits because the field changed. 1487 1452 ResetAxes 1488 SendCmd "dataset scalar $_curFldName"1489 SendCmd "heightmap colormode $_colorMode $_curFldName"1453 SendCmd [list dataset scalar $_curFldName] 1454 SendCmd [list heightmap colormode $_colorMode $_curFldName] 1490 1455 UpdateContourList 1491 1456 SendCmd "heightmap contourlist [list $_contourList]" … … 1739 1704 set _colormaps($cmap) 1 1740 1705 } 1741 #SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"1706 #SendCmd [list legend $cmap scalar $_curFldName {} $w $h 0] 1742 1707 SendCmd "legend2 $cmap $w $h" 1743 1708 } … … 1782 1747 set bmax [expr $bmax - $bmin] 1783 1748 set bmin 0 1784 SendCmd "dataset maprange explicit $_limits($_curFldName) $_curFldName"1749 SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName] 1785 1750 SendCmd "axis bounds z $bmin $bmax" 1786 1751 SendCmd "axis range z $_limits($_curFldName)" … … 2277 2242 set tag $dataobj-$comp 2278 2243 array set style { 2279 -color BCGYR 2280 -colormapvisible 1 2281 -edgecolor black 2282 -edges 0 2283 -isolinecolor black 2284 -isolinesvisible 1 2285 -isolinewidth 1.0 2286 -levels 10 2287 -linewidth 1.0 2288 -opacity 1.0 2289 -outline 0 2290 -wireframe 0 2244 -color BCGYR 2245 -colormapdiscrete 0 2246 -colormapvisible 1 2247 -edgecolor black 2248 -edges 0 2249 -isolinecolor black 2250 -isolinesvisible 1 2251 -isolinewidth 1.0 2252 -levels 10 2253 -linewidth 1.0 2254 -opacity 1.0 2255 -outline 0 2256 -wireframe 0 2291 2257 } 2292 2258 set stylelist [$dataobj style $comp] … … 2326 2292 DrawLegend 2327 2293 } 2328 foreach setting {-edges -outline -wireframe \2294 foreach setting {-edges -outline -wireframe -colormapdiscrete \ 2329 2295 -colormapvisible -isolinecolor -isolinesvisible} { 2330 2296 if {$_changed($setting)} { … … 2349 2315 SendCmd "heightmap wireframe $style(-wireframe) $tag" 2350 2316 SetCurrentColormap $style(-color) 2317 if {$style(-colormapdiscrete)} { 2318 SendCmd "heightmap preinterp 1 $tag" 2319 set numColors [expr $style(-levels) + 1] 2320 SendCmd "colormap res $numColors $style(-color)" 2321 } 2351 2322 SendCmd "heightmap isolinecolor [Color2RGB $style(-isolinecolor)] $tag" 2352 2323 $itk_component(isolinecolor) value $style(-isolinecolor) … … 2679 2650 blt::vector destroy $v 2680 2651 } 2652 2653 itcl::body Rappture::VtkHeightmapViewer::SetCurrentFieldName { dataobj } { 2654 set _first $dataobj 2655 $itk_component(field) choices delete 0 end 2656 $itk_component(fieldmenu) delete 0 end 2657 array unset _fields 2658 set _curFldName "" 2659 foreach cname [$_first components] { 2660 foreach fname [$_first fieldnames $cname] { 2661 if { [info exists _fields($fname)] } { 2662 continue 2663 } 2664 foreach { label units components } \ 2665 [$_first fieldinfo $fname] break 2666 $itk_component(field) choices insert end "$fname" "$label" 2667 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2668 -value $label -variable [itcl::scope _curFldLabel] \ 2669 -selectcolor red \ 2670 -activebackground $itk_option(-plotbackground) \ 2671 -activeforeground $itk_option(-plotforeground) \ 2672 -font "Arial 8" \ 2673 -command [itcl::code $this LegendTitleAction save] 2674 set _fields($fname) [list $label $units $components] 2675 if { $_curFldName == "" } { 2676 set _curFldName $fname 2677 set _curFldLabel $label 2678 } 2679 } 2680 } 2681 $itk_component(field) value $_curFldLabel 2682 } -
branches/blt4_trunk/gui/scripts/vtkimageviewer.tcl
r6351 r6414 100 100 private method Rotate {option x y} 101 101 private method SetCurrentColormap { color } 102 private method SetCurrentFieldName { dataobj } 102 103 private method SetLegendTip { x y } 103 104 private method SetObjectStyle { dataobj comp } … … 243 244 244 245 itk_component add fieldmenu { 245 menu $itk_component(plotarea).menu \ 246 -relief flat \ 247 -tearoff 0 246 menu $itk_component(plotarea).menu -relief flat -tearoff 0 248 247 } { 249 248 usual … … 274 273 } 275 274 pack $itk_component(reset) -side top -padx 2 -pady { 2 0 } 276 Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level" 275 Rappture::Tooltip::for $itk_component(reset) \ 276 "Reset the view to the default zoom level" 277 277 278 278 itk_component add zoomin { … … 510 510 set _dlist [lreplace $_dlist $pos $pos] 511 511 array unset _obj2ovride $dataobj-* 512 array unset _settings $dataobj-*513 512 set changed 1 514 513 } … … 604 603 } 605 604 foreach axis { x y } { 605 set units [$dataobj hints ${axis}units] 606 set found($units) 1 606 607 set lim [$dataobj limits $axis] 607 608 if { ![info exists _limits($axis)] } { … … 618 619 } 619 620 set _limits($axis) [list $amin $amax] 620 set units [$dataobj hints ${axis}units]621 set found($units) 1622 621 } 623 622 foreach { fname lim } [$dataobj fieldlimits] { … … 900 899 DoResize 901 900 if { $_settings(-stretchtofit) } { 902 AdjustSetting -stretch ToFit901 AdjustSetting -stretchtofit 903 902 } 904 903 } … … 907 906 # Reset the camera and other view parameters 908 907 # 909 InitSettings -view3d -background 910 908 InitSettings -view3d -background \ 909 -xgrid -ygrid -zgrid -axismode \ 910 -axesvisible -axislabels -axisminorticks 911 912 SendCmd "axis tickpos outside" 911 913 SendCmd "axis lrot z 90" 912 914 $_arcball quaternion [ViewToQuaternion] … … 932 934 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 933 935 set _first $dataobj 936 SetCurrentFieldName $dataobj 934 937 } 935 938 foreach comp [$dataobj components] { … … 968 971 } 969 972 } 970 if { $_first != "" } { 971 $itk_component(field) choices delete 0 end 972 $itk_component(fieldmenu) delete 0 end 973 array unset _fields 974 set _curFldName "" 975 foreach cname [$_first components] { 976 foreach fname [$_first fieldnames $cname] { 977 if { [info exists _fields($fname)] } { 978 continue 979 } 980 foreach { label units components } \ 981 [$_first fieldinfo $fname] break 982 $itk_component(field) choices insert end "$fname" "$label" 983 $itk_component(fieldmenu) add radiobutton -label "$label" \ 984 -value $label -variable [itcl::scope _curFldLabel] \ 985 -selectcolor red \ 986 -activebackground $itk_option(-plotbackground) \ 987 -activeforeground $itk_option(-plotforeground) \ 988 -font "Arial 8" \ 989 -command [itcl::code $this LegendTitleAction save] 990 set _fields($fname) [list $label $units $components] 991 if { $_curFldName == "" } { 992 set _curFldName $fname 993 set _curFldLabel $label 994 } 995 } 996 } 997 $itk_component(field) value $_curFldLabel 998 } 973 999 974 InitSettings -stretchtofit -outline 1000 1001 975 if { $_reset } { 1002 SendCmd "axis tickpos outside"1003 #SendCmd "axis lformat all %g"1004 1005 976 foreach axis { x y z } { 1006 977 set label "" … … 1043 1014 } 1044 1015 PanCamera 1045 InitSettings -xgrid -ygrid -zgrid \ 1046 -axesvisible -axislabels -field -view3d 1016 InitSettings -field -view3d 1047 1017 if { [array size _fields] < 2 } { 1048 1018 catch {blt::table forget $itk_component(field) $itk_component(field_l)} … … 1275 1245 itcl::body Rappture::VtkImageViewer::InitSettings { args } { 1276 1246 foreach spec $args { 1277 if { [info exists _settings($_first${spec})] } {1278 # Reset global setting with dataobj specific setting1279 set _settings($spec) $_settings($_first${spec})1280 }1281 1247 AdjustSetting $spec 1282 1248 } … … 1389 1355 1390 1356 # Get the new limits because the field changed. 1391 SendCmd "dataset scalar $_curFldName"1392 #SendCmd "image colormode scalar $_curFldName"1357 SendCmd [list dataset scalar $_curFldName] 1358 #SendCmd [list image colormode scalar $_curFldName] 1393 1359 SendCmd "camera reset" 1394 1360 DrawLegend … … 1545 1511 set _colormaps($cmap) 1 1546 1512 } 1547 #SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"1513 #SendCmd [list legend $cmap scalar $_curFldName {} $w $h 0] 1548 1514 SendCmd "legend2 $cmap $w $h" 1549 1515 } … … 2046 2012 if { [info exists style(-stretchtofit)] } { 2047 2013 set _settings(-stretchtofit) $style(-stretchtofit) 2048 AdjustSetting -stretch ToFit2014 AdjustSetting -stretchtofit 2049 2015 } 2050 2016 SendCmd "outline add $tag" … … 2327 2293 set _view(-zoom) 1.0 2328 2294 } 2295 2296 itcl::body Rappture::VtkImageViewer::SetCurrentFieldName { dataobj } { 2297 set _first $dataobj 2298 $itk_component(field) choices delete 0 end 2299 $itk_component(fieldmenu) delete 0 end 2300 array unset _fields 2301 set _curFldName "" 2302 foreach cname [$_first components] { 2303 foreach fname [$_first fieldnames $cname] { 2304 if { [info exists _fields($fname)] } { 2305 continue 2306 } 2307 foreach { label units components } \ 2308 [$_first fieldinfo $fname] break 2309 $itk_component(field) choices insert end "$fname" "$label" 2310 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2311 -value $label -variable [itcl::scope _curFldLabel] \ 2312 -selectcolor red \ 2313 -activebackground $itk_option(-plotbackground) \ 2314 -activeforeground $itk_option(-plotforeground) \ 2315 -font "Arial 8" \ 2316 -command [itcl::code $this LegendTitleAction save] 2317 set _fields($fname) [list $label $units $components] 2318 if { $_curFldName == "" } { 2319 set _curFldName $fname 2320 set _curFldLabel $label 2321 } 2322 } 2323 } 2324 $itk_component(field) value $_curFldLabel 2325 } -
branches/blt4_trunk/gui/scripts/vtkisosurfaceviewer.tcl
r6351 r6414 160 160 private variable _rotatePending 0 161 161 private variable _cutplanePending 0 162 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar)163 162 private variable _fields 164 163 private variable _curFldName "" 165 164 private variable _curFldLabel "" 165 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 166 166 private variable _mouseOver ""; # what called LegendRangeAction: 167 167 # vmin or vmax … … 653 653 set _dlist [lreplace $_dlist $pos $pos] 654 654 array unset _obj2ovride $dataobj-* 655 array unset _settings $dataobj-*656 655 set changed 1 657 656 } … … 1346 1345 itcl::body Rappture::VtkIsosurfaceViewer::InitSettings { args } { 1347 1346 foreach spec $args { 1348 if { [info exists _settings($_first${spec})] } {1349 # Reset global setting with dataobj specific setting1350 set _settings($spec) $_settings($_first${spec})1351 }1352 1347 AdjustSetting $spec 1353 1348 } … … 1410 1405 } else { 1411 1406 if { !$_settings(-colormapvisible) } { 1412 SendCmd "contour3d colormode $_colorMode $_curFldName"1407 SendCmd [list contour3d colormode $_colorMode $_curFldName] 1413 1408 set _settings(-colormapvisible) 1 1414 1409 } … … 1477 1472 return 1478 1473 } 1479 SendCmd "dataset scalar $_curFldName"1474 SendCmd [list dataset scalar $_curFldName] 1480 1475 if { ![info exists _limits($_curFldName)] } { 1481 1476 SendCmd "dataset maprange all" … … 1491 1486 SetMinMaxGauges $vmin $vmax 1492 1487 } 1493 SendCmd "dataset maprange explicit $vmin $vmax $_curFldName"1494 } 1495 SendCmd "cutplane colormode $_colorMode $_curFldName"1496 SendCmd "contour3d colormode $_colorMode $_curFldName"1488 SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName] 1489 } 1490 SendCmd [list cutplane colormode $_colorMode $_curFldName] 1491 SendCmd [list contour3d colormode $_colorMode $_curFldName] 1497 1492 GenerateContourList 1498 1493 SendCmd [list contour3d contourlist $_contourList(values)] … … 1581 1576 GenerateContourList 1582 1577 SendCmd [list contour3d contourlist $_contourList(values)] 1583 SendCmd "dataset maprange explicit $vmin $vmax $_curFldName"1578 SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName] 1584 1579 DrawLegend 1585 1580 } … … 1664 1659 set _colormaps($cmap) 1 1665 1660 } 1666 #SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0"1661 #SendCmd [list legend $cmap $_colorMode $_curFldName {} $w $h 0] 1667 1662 SendCmd "legend2 $cmap $w $h" 1668 1663 } … … 3141 3136 $itk_component(field) value $_curFldLabel 3142 3137 if { $_settings(-customrange) } { 3143 set limits [list [$itk_component(min) value] [$itk_component(max) value]] 3144 SendCmd "dataset maprange explicit $limits $_curFldName" 3138 set vmin [$itk_component(min) value] 3139 set vmax [$itk_component(max) value] 3140 SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName] 3141 set limits [list $vmin $vmax] 3145 3142 if { $limits != $_currentLimits } { 3146 3143 set _currentLimits $limits … … 3151 3148 SendCmd "dataset maprange all" 3152 3149 } else { 3153 set limits $_limits($_curFldName) 3154 SendCmd "dataset maprange explicit $limits $_curFldName" 3150 foreach { vmin vmax } $_limits($_curFldName) break 3151 SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName] 3152 set limits [list $vmin $vmax] 3155 3153 if { $limits != $_currentLimits } { 3156 3154 set _currentLimits $limits -
branches/blt4_trunk/gui/scripts/vtkstreamlinesviewer.tcl
r6351 r6414 105 105 private method Rotate {option x y} 106 106 private method SetCurrentColormap { color } 107 private method SetCurrentFieldName { dataobj } 107 108 private method SetLegendTip { x y } 108 109 private method SetObjectStyle { dataobj comp } … … 145 146 private variable _curFldName "" 146 147 private variable _curFldLabel "" 148 private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar) 147 149 private variable _streamlinesLength 0 148 150 private variable _numSeeds 200 149 private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar)150 151 151 152 private common _downloadPopup; # download options from popup … … 300 301 } 301 302 pack $itk_component(reset) -side top -padx 2 -pady 2 302 Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level" 303 Rappture::Tooltip::for $itk_component(reset) \ 304 "Reset the view to the default zoom level" 303 305 304 306 itk_component add zoomin { … … 588 590 set _dlist [lreplace $_dlist $pos $pos] 589 591 array unset _obj2ovride $dataobj-* 590 array unset _settings $dataobj-*591 592 set changed 1 592 593 } … … 978 979 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 979 980 set _first $dataobj 981 SetCurrentFieldName $dataobj 980 982 } 981 983 foreach comp [$dataobj components] { … … 1023 1025 } 1024 1026 } 1025 $itk_component(field) choices delete 0 end1026 $itk_component(fieldmenu) delete 0 end1027 array unset _fields1028 set _curFldName ""1029 set _curFldLabel ""1030 foreach cname [$_first components] {1031 foreach fname [$_first fieldnames $cname] {1032 if { [info exists _fields($fname)] } {1033 continue1034 }1035 foreach { label units components } \1036 [$_first fieldinfo $fname] break1037 $itk_component(field) choices insert end "$fname" "$label"1038 $itk_component(fieldmenu) add radiobutton -label "$label" \1039 -value $label -variable [itcl::scope _curFldLabel] \1040 -selectcolor red \1041 -activebackground $itk_option(-plotbackground) \1042 -activeforeground $itk_option(-plotforeground) \1043 -font "Arial 8" \1044 -command [itcl::code $this LegendTitleAction save]1045 set _fields($fname) [list $label $units $components]1046 if { $_curFldName == "" && $components == 3 } {1047 set _curFldName $fname1048 set _curFldLabel $label1049 }1050 }1051 }1052 $itk_component(field) value $_curFldLabel1053 1027 } 1054 1028 … … 1295 1269 itcl::body Rappture::VtkStreamlinesViewer::InitSettings { args } { 1296 1270 foreach spec $args { 1297 if { [info exists _settings($_first${spec})] } {1298 # Reset global setting with dataobj specific setting1299 set _settings($spec) $_settings($_first${spec})1300 }1301 1271 AdjustSetting $spec 1302 1272 } … … 1382 1352 SendCmd "dataset maprange all" 1383 1353 } else { 1384 SendCmd "dataset maprange explicit $_limits($_curFldName) $_curFldName" 1385 } 1386 SendCmd "streamlines colormode $_colorMode $_curFldName" 1387 SendCmd "cutplane colormode $_colorMode $_curFldName" 1354 foreach { vmin vmax } $_limits($_curFldName) break 1355 SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName] 1356 } 1357 SendCmd [list streamlines colormode $_colorMode $_curFldName] 1358 SendCmd [list cutplane colormode $_colorMode $_curFldName] 1388 1359 DrawLegend 1389 1360 } … … 1526 1497 set _colormaps($cmap) 1 1527 1498 } 1528 #SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0"1499 #SendCmd [list legend $cmap $_colorMode $_curFldName {} $w $h 0] 1529 1500 SendCmd "legend2 $cmap $w $h" 1530 1501 } … … 2434 2405 set _view(-zoom) 1.0 2435 2406 } 2407 2408 itcl::body Rappture::VtkStreamlinesViewer::SetCurrentFieldName { dataobj } { 2409 set _first $dataobj 2410 $itk_component(field) choices delete 0 end 2411 $itk_component(fieldmenu) delete 0 end 2412 array unset _fields 2413 set _curFldName "" 2414 set _curFldLabel "" 2415 foreach cname [$_first components] { 2416 foreach fname [$_first fieldnames $cname] { 2417 if { [info exists _fields($fname)] } { 2418 continue 2419 } 2420 foreach { label units components } \ 2421 [$_first fieldinfo $fname] break 2422 $itk_component(field) choices insert end "$fname" "$label" 2423 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2424 -value $label -variable [itcl::scope _curFldLabel] \ 2425 -selectcolor red \ 2426 -activebackground $itk_option(-plotbackground) \ 2427 -activeforeground $itk_option(-plotforeground) \ 2428 -font "Arial 8" \ 2429 -command [itcl::code $this LegendTitleAction save] 2430 set _fields($fname) [list $label $units $components] 2431 if { $_curFldName == "" && $components == 3 } { 2432 set _curFldName $fname 2433 set _curFldLabel $label 2434 } 2435 } 2436 } 2437 $itk_component(field) value $_curFldLabel 2438 } -
branches/blt4_trunk/gui/scripts/vtksurfaceviewer.tcl
r6351 r6414 139 139 private variable _legendPending 0 140 140 private variable _rotatePending 0 141 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar)142 141 private variable _fields 143 142 private variable _curFldName "" 144 143 private variable _curFldLabel "" 144 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 145 145 146 146 private common _downloadPopup; # download options from popup … … 509 509 set _dlist [lreplace $_dlist $pos $pos] 510 510 array unset _obj2ovride $dataobj-* 511 array unset _settings $dataobj-*512 511 set changed 1 513 512 } … … 1190 1189 itcl::body Rappture::VtkSurfaceViewer::InitSettings { args } { 1191 1190 foreach spec $args { 1192 if { [info exists _settings($_first${spec})] } {1193 # Reset global setting with dataobj specific setting1194 set _settings($spec) $_settings($_first${spec})1195 }1196 1191 AdjustSetting $spec 1197 1192 } … … 1253 1248 } else { 1254 1249 if { !$_settings(-colormapvisible) } { 1255 #SendCmd "contour2d colormode $_colorMode $_curFldName"1256 SendCmd "polydata colormode $_colorMode $_curFldName"1250 #SendCmd [list contour2d colormode $_colorMode $_curFldName] 1251 SendCmd [list polydata colormode $_colorMode $_curFldName] 1257 1252 set _settings(-colormapvisible) 1 1258 1253 } … … 1299 1294 return 1300 1295 } 1301 SendCmd "dataset scalar $_curFldName"1296 SendCmd [list dataset scalar $_curFldName] 1302 1297 if { ![info exists _limits($_curFldName)] } { 1303 1298 SendCmd "dataset maprange all" 1304 1299 } else { 1305 SendCmd "dataset maprange explicit $_limits($_curFldName) $_curFldName" 1306 } 1307 #SendCmd "contour2d colormode $_colorMode $_curFldName" 1308 SendCmd "polydata colormode $_colorMode $_curFldName" 1300 foreach { vmin vmax } $_limits($_curFldName) break 1301 SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName] 1302 } 1303 #SendCmd [list contour2d colormode $_colorMode $_curFldName] 1304 SendCmd [list polydata colormode $_colorMode $_curFldName] 1309 1305 UpdateContourList 1310 1306 SendCmd "contour2d contourlist [list $_contourList]" … … 1477 1473 set _colormaps($cmap) 1 1478 1474 } 1479 #SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"1475 #SendCmd [list legend $cmap scalar $_curFldName {} $w $h 0] 1480 1476 SendCmd "legend2 $cmap $w $h" 1481 1477 } … … 1955 1951 SendCmd "polydata add $tag" 1956 1952 if { $_curFldName != "" } { 1957 SendCmd "polydata colormode $_colorMode $_curFldName $tag"1953 SendCmd [list polydata colormode $_colorMode $_curFldName $tag] 1958 1954 } 1959 1955 SendCmd "polydata edges $style(-edges) $tag" -
branches/blt4_trunk/gui/scripts/vtkviewer.tcl
r6351 r6414 134 134 private variable _click; # info used for rotate operations 135 135 private variable _limits; # autoscale min/max for all axes 136 private variable _fieldlimits; # maps dataobj-comp to field limits 137 private variable _fieldComponents; # maps dataobj-comp-fname to number of 138 # components 136 139 private variable _view; # view params for 3D view 137 140 private variable _settings … … 241 244 set _arcball [blt::arcball create 100 100] 242 245 $_arcball quaternion [ViewToQuaternion] 243 244 set _limits(zmin) 0.0245 set _limits(zmax) 1.0246 246 247 247 array set _axis [subst { … … 263 263 }] 264 264 array set _settings [subst { 265 glyphs-edges 0 266 glyphs-lighting 1 267 glyphs-opacity 100 268 glyphs-outline 0 269 glyphs-palette BCGYR 270 glyphs-visible 1 271 glyphs-wireframe 0 272 legend 1 273 molecule-atoms-visible 1 274 molecule-atomscale 0.3 275 molecule-bonds-visible 1 276 molecule-bondscale 0.075 277 molecule-bondstyle "cylinder" 278 molecule-edges 0 279 molecule-labels 0 280 molecule-lighting 1 281 molecule-opacity 100 282 molecule-outline 0 283 molecule-palette elementDefault 284 molecule-quality 1.0 285 molecule-representation "Ball and Stick" 286 molecule-rscale "covalent" 287 molecule-visible 1 288 molecule-wireframe 0 289 polydata-edges 0 290 polydata-lighting 1 291 polydata-opacity 100 292 polydata-outline 0 293 polydata-palette BCGYR 294 polydata-visible 1 295 polydata-wireframe 0 265 glyphs-edges 0 266 glyphs-lighting 1 267 glyphs-opacity 100 268 glyphs-outline 0 269 glyphs-colormap BCGYR 270 glyphs-visible 1 271 glyphs-wireframe 0 272 legend 1 273 molecule-atoms-visible 1 274 molecule-atomscale 0.3 275 molecule-bonds-visible 1 276 molecule-bondscale 0.075 277 molecule-bondstyle "cylinder" 278 molecule-colorfield "element" 279 molecule-colormode "by_elements" 280 molecule-edges 0 281 molecule-labels 0 282 molecule-lighting 1 283 molecule-opacity 100 284 molecule-outline 0 285 molecule-colormap elementDefault 286 molecule-quality 1.0 287 molecule-representation "Ball and Stick" 288 molecule-rscale "covalent" 289 molecule-visible 1 290 molecule-wireframe 0 291 polydata-edges 0 292 polydata-lighting 1 293 polydata-opacity 100 294 polydata-outline 0 295 polydata-colormap BCGYR 296 polydata-visible 1 297 polydata-wireframe 0 296 298 }] 297 299 itk_component add view { … … 631 633 set _dlist [lreplace $_dlist $pos $pos] 632 634 array unset _obj2ovride $dataobj-* 633 array unset _settings $dataobj-*634 635 set changed 1 635 636 } … … 761 762 if { ![$itk_component(main) exists "Glyphs Settings"] } { 762 763 if { [catch { BuildGlyphsTab } errs ] != 0 } { 763 puts stderr "errs=$errs" 764 global errorInfo 765 puts stderr "errs=$errs\nerrorInfo=$errorInfo" 764 766 } 765 767 } … … 768 770 if { ![$itk_component(main) exists "Mesh Settings"] } { 769 771 if { [catch { BuildPolydataTab } errs ] != 0 } { 770 puts stderr "errs=$errs" 772 global errorInfo 773 puts stderr "errs=$errs\nerrorInfo=$errorInfo" 771 774 } 772 775 } … … 1032 1035 } 1033 1036 1034 set _limits(zmin) ""1035 set _limits(zmax) ""1036 1037 set _first "" 1037 1038 SendCmd "dataset visible 0" 1038 1039 set count 0 1040 eval scale $_dlist 1039 1041 foreach dataobj [get -objects] { 1040 1042 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { … … 1426 1428 } 1427 1429 } 1428 "glyphs- palette" {1429 set palette [$itk_component(glyphspalette) value]1430 set _settings($what) $ palette1430 "glyphs-colormap" { 1431 set colormap [$itk_component(glyphscolormap) value] 1432 set _settings($what) $colormap 1431 1433 foreach dataset [CurrentDatasets -visible $_first] { 1432 1434 foreach {dataobj comp} [split $dataset -] break 1433 1435 set type [$dataobj type $comp] 1434 1436 if { $type == "glyphs" } { 1435 ChangeColormap $dataobj $comp $ palette1437 ChangeColormap $dataobj $comp $colormap 1436 1438 # FIXME: fill in current selected fieldname 1437 1439 #SendCmd "glyphs colormode scalar {} $dataset" … … 1498 1500 } 1499 1501 } 1500 "polydata- palette" {1501 set palette [$itk_component(meshpalette) value]1502 set _settings($what) $ palette1502 "polydata-colormap" { 1503 set colormap [$itk_component(meshcolormap) value] 1504 set _settings($what) $colormap 1503 1505 foreach dataset [CurrentDatasets -visible $_first] { 1504 1506 foreach {dataobj comp} [split $dataset -] break 1505 1507 set type [$dataobj type $comp] 1506 1508 if { $type == "polydata" } { 1507 ChangeColormap $dataobj $comp $ palette1509 ChangeColormap $dataobj $comp $colormap 1508 1510 # FIXME: fill in current selected fieldname 1509 1511 #SendCmd "polydata colormode scalar {} $dataset" … … 1570 1572 } 1571 1573 } 1572 "molecule- palette" {1573 set palette [$itk_component(moleculepalette) value]1574 set _settings($what) $ palette1574 "molecule-colormap" { 1575 set colormap [$itk_component(moleculecolormap) value] 1576 set _settings($what) $colormap 1575 1577 foreach dataset [CurrentDatasets -visible $_first] { 1576 1578 foreach {dataobj comp} [split $dataset -] break 1577 1579 set type [$dataobj type $comp] 1578 1580 if { $type == "molecule" } { 1579 ChangeColormap $dataobj $comp $ palette1580 if { $ palette== "elementDefault" } {1581 SendCmd "molecule colormode by_elements element $dataset"1581 ChangeColormap $dataobj $comp $colormap 1582 if { $colormap == "elementDefault" } { 1583 SendCmd [list molecule colormode by_elements element $dataset] 1582 1584 } else { 1583 1585 # FIXME: Set the chosen scalar field name here 1584 SendCmd "molecule colormode scalar {} $dataset" 1586 set _settings(molecule-colormode) scalar 1587 set _settings(molecule-colorfield) "" 1588 SendCmd [list molecule colormode $_settings(molecule-colormode) $_settings(molecule-colorfield) $dataset] 1585 1589 } 1586 1590 } … … 1871 1875 1872 1876 itcl::body Rappture::VtkViewer::limits { dataobj } { 1873 foreach c omp[$dataobj components] {1874 set tag $dataobj-$c omp1877 foreach cname [$dataobj components] { 1878 set tag $dataobj-$cname 1875 1879 if { ![info exists _limits($tag)] } { 1876 set data [$dataobj data $c omp]1880 set data [$dataobj data $cname] 1877 1881 if { $data == "" } { 1878 1882 continue … … 1885 1889 set reader [vtkDataSetReader $tag-xvtkDataSetReader] 1886 1890 $reader SetFileName $tmpfile 1887 set debug 0 1888 if {$debug} { 1889 # Only needed for debug output below 1890 $reader ReadAllNormalsOn 1891 $reader ReadAllTCoordsOn 1892 $reader ReadAllScalarsOn 1893 $reader ReadAllColorScalarsOn 1894 $reader ReadAllVectorsOn 1895 $reader ReadAllTensorsOn 1896 $reader ReadAllFieldsOn 1897 } 1891 $reader ReadAllNormalsOn 1892 $reader ReadAllTCoordsOn 1893 $reader ReadAllScalarsOn 1894 $reader ReadAllColorScalarsOn 1895 $reader ReadAllVectorsOn 1896 $reader ReadAllTensorsOn 1897 $reader ReadAllFieldsOn 1898 1898 $reader Update 1899 1899 file delete $tmpfile 1900 set output [$reader GetOutput]1901 if { $ output == "" } {1900 set dataset [$reader GetOutput] 1901 if { $dataset == "" } { 1902 1902 # Invalid VTK file -- loader failed to parse 1903 1903 continue 1904 1904 } 1905 set _limits($tag) [$output GetBounds] 1906 if {$debug} { 1907 puts stderr "\#scalars=[$reader GetNumberOfScalarsInFile]" 1908 puts stderr "\#vectors=[$reader GetNumberOfVectorsInFile]" 1909 puts stderr "\#tensors=[$reader GetNumberOfTensorsInFile]" 1910 puts stderr "\#normals=[$reader GetNumberOfNormalsInFile]" 1911 puts stderr "\#tcoords=[$reader GetNumberOfTCoordsInFile]" 1912 puts stderr "\#fielddata=[$reader GetNumberOfFieldDataInFile]" 1913 puts stderr "fielddataname=[$reader GetFieldDataNameInFile 0]" 1914 set pointData [$output GetPointData] 1915 if { $pointData != ""} { 1916 puts stderr "point \#arrays=[$pointData GetNumberOfArrays]" 1917 puts stderr "point \#components=[$pointData GetNumberOfComponents]" 1918 puts stderr "point \#tuples=[$pointData GetNumberOfTuples]" 1919 puts stderr "point scalars=[$pointData GetScalars]" 1920 puts stderr "point vectors=[$pointData GetVectors]" 1921 } 1922 set cellData [$output GetCellData] 1923 if { $cellData != ""} { 1924 puts stderr "cell \#arrays=[$cellData GetNumberOfArrays]" 1925 puts stderr "cell \#components=[$cellData GetNumberOfComponents]" 1926 puts stderr "cell \#tuples=[$cellData GetNumberOfTuples]" 1927 puts stderr "cell scalars=[$cellData GetScalars]" 1928 puts stderr "cell vectors=[$cellData GetVectors]" 1929 } 1930 set fieldData [$output GetFieldData] 1931 if { $fieldData != ""} { 1932 puts stderr "field \#arrays=[$fieldData GetNumberOfArrays]" 1933 puts stderr "field \#components=[$fieldData GetNumberOfComponents]" 1934 puts stderr "field \#tuples=[$fieldData GetNumberOfTuples]" 1935 } 1936 } 1937 rename $output "" 1905 set _limits($tag) [$dataset GetBounds] 1906 set dataAttrs [$dataset GetPointData] 1907 if { $dataAttrs != ""} { 1908 set numArrays [$dataAttrs GetNumberOfArrays] 1909 for {set i 0} {$i < $numArrays} {incr i} { 1910 set array [$dataAttrs GetArray $i] 1911 set fname [$dataAttrs GetArrayName $i] 1912 foreach {min max} [$array GetRange -1] break 1913 lappend _fieldlimits($tag) $fname [list $min $max] 1914 set _fieldComponents($tag-$fname) [$array GetNumberOfComponents] 1915 } 1916 } 1917 set dataAttrs [$dataset GetCellData] 1918 if { $dataAttrs != ""} { 1919 set numArrays [$dataAttrs GetNumberOfArrays] 1920 for {set i 0} {$i < $numArrays} {incr i} { 1921 set array [$dataAttrs GetArray $i] 1922 set fname [$dataAttrs GetArrayName $i] 1923 foreach {min max} [$array GetRange -1] break 1924 lappend _fieldlimits($tag) $fname [list $min $max] 1925 set _fieldComponents($tag-$fname) [$array GetNumberOfComponents] 1926 } 1927 } 1928 set dataAttrs [$dataset GetFieldData] 1929 if { $dataAttrs != ""} { 1930 set numArrays [$dataAttrs GetNumberOfArrays] 1931 for {set i 0} {$i < $numArrays} {incr i} { 1932 set array [$dataAttrs GetArray $i] 1933 set fname [$dataAttrs GetArrayName $i] 1934 foreach {min max} [$array GetRange -1] break 1935 lappend _fieldlimits($tag) $fname [list $min $max] 1936 set _fieldComponents($tag-$fname) [$array GetNumberOfComponents] 1937 } 1938 } 1939 rename $dataset "" 1938 1940 rename $reader "" 1939 1941 } 1940 foreach { 1942 foreach {xMin xMax yMin yMax zMin zMax} $_limits($tag) break 1941 1943 if {![info exists limits(xmin)] || $limits(xmin) > $xMin} { 1942 1944 set limits(xmin) $xMin … … 2001 2003 -font "Arial 9" -anchor w 2002 2004 2003 label $inner. palette_l -text "Palette" -font "Arial 9" -anchor w2004 itk_component add glyphs palette{2005 Rappture::Combobox $inner. palette-width 10 -editable 02006 } 2007 $inner. palettechoices insert end [GetColormapList]2008 $itk_component(glyphs palette) value "BCGYR"2009 bind $inner. palette<<Value>> \2010 [itcl::code $this AdjustSetting glyphs- palette]2005 label $inner.colormap_l -text "Colormap" -font "Arial 9" -anchor w 2006 itk_component add glyphscolormap { 2007 Rappture::Combobox $inner.colormap -width 10 -editable 0 2008 } 2009 $inner.colormap choices insert end [GetColormapList] 2010 $itk_component(glyphscolormap) value "BCGYR" 2011 bind $inner.colormap <<Value>> \ 2012 [itcl::code $this AdjustSetting glyphs-colormap] 2011 2013 2012 2014 label $inner.opacity_l -text "Opacity" -font "Arial 9" -anchor w … … 2019 2021 2020 2022 blt::table $inner \ 2021 0,0 $inner.glyphs -cspan 2 -anchor w -pady 2 \2022 1,0 $inner.outline -cspan 2 -anchor w -pady 2 \2023 2,0 $inner.wireframe -cspan 2 -anchor w -pady 2 \2024 3,0 $inner.lighting -cspan 2 -anchor w -pady 2 \2025 4,0 $inner.edges -cspan 2 -anchor w -pady 2 \2026 5,0 $inner.opacity_l -anchor w -pady 2 \2027 5,1 $inner.opacity -fill x -pady 2 \2028 6,0 $inner. palette_l -anchor w -pady 2 \2029 6,1 $inner. palette-fill x -pady 22023 0,0 $inner.glyphs -cspan 2 -anchor w -pady 2 \ 2024 1,0 $inner.outline -cspan 2 -anchor w -pady 2 \ 2025 2,0 $inner.wireframe -cspan 2 -anchor w -pady 2 \ 2026 3,0 $inner.lighting -cspan 2 -anchor w -pady 2 \ 2027 4,0 $inner.edges -cspan 2 -anchor w -pady 2 \ 2028 5,0 $inner.opacity_l -anchor w -pady 2 \ 2029 5,1 $inner.opacity -fill x -pady 2 \ 2030 6,0 $inner.colormap_l -anchor w -pady 2 \ 2031 6,1 $inner.colormap -fill x -pady 2 2030 2032 2031 2033 blt::table configure $inner r* c* -resize none … … 2073 2075 -font "Arial 9" -anchor w 2074 2076 2075 label $inner. palette_l -text "Palette" -font "Arial 9" -anchor w2076 itk_component add mesh palette{2077 Rappture::Combobox $inner. palette-width 10 -editable 02078 } 2079 $inner. palettechoices insert end [GetColormapList]2080 $itk_component(mesh palette) value "BCGYR"2081 bind $inner. palette<<Value>> \2082 [itcl::code $this AdjustSetting polydata- palette]2077 label $inner.colormap_l -text "Colormap" -font "Arial 9" -anchor w 2078 itk_component add meshcolormap { 2079 Rappture::Combobox $inner.colormap -width 10 -editable 0 2080 } 2081 $inner.colormap choices insert end [GetColormapList] 2082 $itk_component(meshcolormap) value "BCGYR" 2083 bind $inner.colormap <<Value>> \ 2084 [itcl::code $this AdjustSetting polydata-colormap] 2083 2085 2084 2086 label $inner.opacity_l -text "Opacity" -font "Arial 9" -anchor w … … 2091 2093 2092 2094 blt::table $inner \ 2093 0,0 $inner.mesh -cspan 2 -anchor w -pady 2 \2094 1,0 $inner.outline -cspan 2 -anchor w -pady 2 \2095 2,0 $inner.wireframe -cspan 2 -anchor w -pady 2 \2096 3,0 $inner.lighting -cspan 2 -anchor w -pady 2 \2097 4,0 $inner.edges -cspan 2 -anchor w -pady 2 \2098 5,0 $inner.opacity_l -anchor w -pady 2 \2099 5,1 $inner.opacity -fill x -pady 2 \2100 6,0 $inner. palette_l -anchor w -pady 2 \2101 6,1 $inner. palette-fill x -pady 22095 0,0 $inner.mesh -cspan 2 -anchor w -pady 2 \ 2096 1,0 $inner.outline -cspan 2 -anchor w -pady 2 \ 2097 2,0 $inner.wireframe -cspan 2 -anchor w -pady 2 \ 2098 3,0 $inner.lighting -cspan 2 -anchor w -pady 2 \ 2099 4,0 $inner.edges -cspan 2 -anchor w -pady 2 \ 2100 5,0 $inner.opacity_l -anchor w -pady 2 \ 2101 5,1 $inner.opacity -fill x -pady 2 \ 2102 6,0 $inner.colormap_l -anchor w -pady 2 \ 2103 6,1 $inner.colormap -fill x -pady 2 2102 2104 2103 2105 blt::table configure $inner r* c* -resize none … … 2447 2449 $inner.rscale value "Covalent" 2448 2450 2449 label $inner. palette_l -text "Palette" -font "Arial 9"2450 itk_component add molecule palette{2451 Rappture::Combobox $inner. palette-width 10 -editable 02452 } 2453 $inner. palettechoices insert end [GetColormapList -includeElementDefault]2454 $itk_component(molecule palette) value "elementDefault"2455 bind $inner. palette<<Value>> \2456 [itcl::code $this AdjustSetting molecule- palette]2451 label $inner.colormap_l -text "Colormap" -font "Arial 9" 2452 itk_component add moleculecolormap { 2453 Rappture::Combobox $inner.colormap -width 10 -editable 0 2454 } 2455 $inner.colormap choices insert end [GetColormapList -includeElementDefault] 2456 $itk_component(moleculecolormap) value "elementDefault" 2457 bind $inner.colormap <<Value>> \ 2458 [itcl::code $this AdjustSetting molecule-colormap] 2457 2459 2458 2460 label $inner.atomscale_l -text "Atom Scale" -font "Arial 9" … … 2502 2504 6,0 $inner.rscale_l -anchor w -pady { 2 0 } \ 2503 2505 7,0 $inner.rscale -fill x -pady 2 \ 2504 8,0 $inner. palette_l -anchor w -pady 0 \2505 9,0 $inner. palette-fill x -padx 2 \2506 8,0 $inner.colormap_l -anchor w -pady 0 \ 2507 9,0 $inner.colormap -fill x -padx 2 \ 2506 2508 10,0 $inner.atomscale_l -anchor w -pady {3 0} \ 2507 2509 11,0 $inner.atomscale -fill x -padx 2 \ … … 2689 2691 -atomscale 0.3 2690 2692 -atomsvisible 1 2693 -bondconstcolor white 2694 -bondcolormode "by_elements" 2691 2695 -bondscale 0.075 2692 2696 -bondstyle "cylinder" 2693 2697 -bondsvisible 1 2694 2698 -color "elementDefault" 2699 -colormode "by_elements" 2700 -colorfield "element" 2701 -constcolor white 2695 2702 -edgecolor black 2696 2703 -edges 0 … … 2800 2807 SendCmd "molecule labels $settings(-labels) $tag" 2801 2808 set _settings(molecule-labels) $settings(-labels) 2809 SendCmd "molecule color [Color2RGB $settings(-constcolor)] $tag" 2810 SendCmd "molecule bcmode $settings(-bondcolormode) $tag" 2811 SendCmd "molecule bcolor [Color2RGB $settings(-bondconstcolor)] $tag" 2812 SendCmd "molecule colormap $settings(-color) $tag" 2813 set _settings(molecule-colormap) $settings(-color) 2814 $itk_component(moleculecolormap) value $settings(-color) 2815 SendCmd [list molecule colormode $settings(-colormode) $settings(-colorfield) $tag] 2816 set _settings(molecule-colormode) $settings(-colormode) 2817 set _settings(molecule-colorfield) $settings(-colorfield) 2802 2818 SendCmd "molecule linecolor [Color2RGB $settings(-edgecolor)] $tag" 2803 2819 SendCmd "molecule linewidth $settings(-linewidth) $tag" -
branches/blt4_trunk/gui/scripts/vtkvolumeviewer.tcl
r6351 r6414 115 115 private method Rotate {option x y} 116 116 private method SendTransferFunctions {} 117 private method SetCurrentFieldName { dataobj } 117 118 private method SetInitialTransferFunction { dataobj cname } 118 119 private method SetLegendTip { x y } … … 574 575 set _dlist [lreplace $_dlist $pos $pos] 575 576 array unset _obj2ovride $dataobj-* 576 array unset _settings $dataobj-*577 577 set changed 1 578 578 } … … 1017 1017 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 1018 1018 set _first $dataobj 1019 SetCurrentFieldName $dataobj 1019 1020 } 1020 1021 foreach cname [$dataobj components] { … … 1063 1064 } 1064 1065 } 1065 $itk_component(field) choices delete 0 end1066 $itk_component(fieldmenu) delete 0 end1067 array unset _fields1068 set _curFldName ""1069 foreach cname [$_first components] {1070 foreach fname [$_first fieldnames $cname] {1071 if { [info exists _fields($fname)] } {1072 continue1073 }1074 foreach { label units components } \1075 [$_first fieldinfo $fname] break1076 # Only scalar fields are valid1077 if {$_allowMultiComponent || $components == 1} {1078 $itk_component(field) choices insert end "$fname" "$label"1079 $itk_component(fieldmenu) add radiobutton -label "$label" \1080 -value $label -variable [itcl::scope _curFldLabel] \1081 -selectcolor red \1082 -activebackground $itk_option(-plotbackground) \1083 -activeforeground $itk_option(-plotforeground) \1084 -font "Arial 8" \1085 -command [itcl::code $this LegendTitleAction save]1086 set _fields($fname) [list $label $units $components]1087 if { $_curFldName == "" } {1088 set _curFldName $fname1089 set _curFldLabel $label1090 }1091 }1092 }1093 }1094 $itk_component(field) value $_curFldLabel1095 1066 } 1096 1067 … … 1328 1299 itcl::body Rappture::VtkVolumeViewer::InitSettings { args } { 1329 1300 foreach spec $args { 1330 if { [info exists _settings($_first${spec})] } {1331 # Reset global setting with dataobj specific setting1332 set _settings($spec) $_settings($_first${spec})1333 }1334 1301 AdjustSetting $spec 1335 1302 } … … 1442 1409 } 1443 1410 foreach dataset [CurrentDatasets -visible $_first] { 1444 #SendCmd "$_cutplaneCmd colormode $_colorMode $_curFldName $dataset"1445 SendCmd "dataset scalar $_curFldName $dataset"1411 #SendCmd [list $_cutplaneCmd colormode $_colorMode $_curFldName $dataset] 1412 SendCmd [list dataset scalar $_curFldName $dataset] 1446 1413 } 1447 1414 SendCmd "camera reset" … … 1607 1574 foreach {dataobj comp} [split $dataset -] break 1608 1575 if { [info exists _dataset2style($dataset)] } { 1609 #SendCmd "legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0"1576 #SendCmd [list legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0] 1610 1577 SendCmd "legend2 $_dataset2style($dataset) $w $h" 1611 1578 break; … … 2864 2831 return [ColorsToColormap $color] 2865 2832 } 2833 2834 itcl::body Rappture::VtkVolumeViewer::SetCurrentFieldName { dataobj } { 2835 set _first $dataobj 2836 $itk_component(field) choices delete 0 end 2837 $itk_component(fieldmenu) delete 0 end 2838 array unset _fields 2839 set _curFldName "" 2840 foreach cname [$_first components] { 2841 foreach fname [$_first fieldnames $cname] { 2842 if { [info exists _fields($fname)] } { 2843 continue 2844 } 2845 foreach { label units components } \ 2846 [$_first fieldinfo $fname] break 2847 # Only scalar fields are valid 2848 if {$_allowMultiComponent || $components == 1} { 2849 $itk_component(field) choices insert end "$fname" "$label" 2850 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2851 -value $label -variable [itcl::scope _curFldLabel] \ 2852 -selectcolor red \ 2853 -activebackground $itk_option(-plotbackground) \ 2854 -activeforeground $itk_option(-plotforeground) \ 2855 -font "Arial 8" \ 2856 -command [itcl::code $this LegendTitleAction save] 2857 set _fields($fname) [list $label $units $components] 2858 if { $_curFldName == "" } { 2859 set _curFldName $fname 2860 set _curFldLabel $label 2861 } 2862 } 2863 } 2864 } 2865 $itk_component(field) value $_curFldLabel 2866 } -
branches/blt4_trunk/lang/tcl/scripts/Makefile.in
r4209 r6414 57 57 image \ 58 58 integer \ 59 multichoice \ 59 60 note \ 60 61 number \ -
branches/blt4_trunk/tester/scripts/main.tcl
r4127 r6414 148 148 wm title . "Rappture Regression Tester" 149 149 wm geometry . 800x500 150 Rappture::Panes .pw -orientation horizontal -sashcursor sb_h_double_arrow150 Rappture::Panes .pw -orientation horizontal 151 151 pack .pw -expand yes -fill both 152 152 … … 262 262 263 263 # viewer for value diffs where we have a special object viewer 264 Rappture::Panes .testdiffs.body.val2objs -orientation horizontal -sashcursor sb_h_double_arrow264 Rappture::Panes .testdiffs.body.val2objs -orientation horizontal 265 265 266 266 # empty area for the object value viewer
Note: See TracChangeset
for help on using the changeset viewer.