Changeset 5086 for branches/1.3
- Timestamp:
- Mar 5, 2015, 7:56:34 AM (10 years ago)
- Location:
- branches/1.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
- Property svn:mergeinfo changed
/branches/uiuc_vtk_viewers merged: 5084 /trunk merged: 5071,5077-5078,5085
- Property svn:mergeinfo changed
-
branches/1.3/gui/scripts/gauge.tcl
r5055 r5086 100 100 -borderwidth 1 -relief flat -textvariable [itcl::scope _value] 101 101 } { 102 keep -font 102 103 rename -background -textbackground textBackground Background 103 104 } -
branches/1.3/gui/scripts/vtkisosurfaceviewer.tcl
r5055 r5086 87 87 private method GetImage { args } 88 88 private method GetVtkData { args } 89 private method InitSettings { args 89 private method InitSettings { args } 90 90 private method IsValidObject { dataobj } 91 91 private method LeaveLegend {} … … 293 293 array set _changed { 294 294 -colormap 0 295 -cutplaneedges 0 296 -cutplanelighting 0 297 -cutplaneopacity 0 298 -cutplanepreinterp 0 299 -cutplanesvisible 0 300 -cutplanewireframe 0 301 -isosurfaceedges 0 302 -isosurfacelighting 0 295 303 -isosurfaceopacity 0 296 -cutplaneopacity 0 304 -isosurfacevisible 0 305 -isosurfacewireframe 0 297 306 -numcontours 0 307 -outline 0 308 -xcutplaneposition 0 309 -xcutplanevisible 0 310 -ycutplaneposition 0 311 -ycutplanevisible 0 312 -zcutplaneposition 0 313 -zcutplanevisible 0 298 314 } 299 315 array set _widget { … … 1416 1432 } 1417 1433 "-cutplaneedges" { 1434 set _changed($what) 1 1418 1435 set bool $_settings($what) 1419 1436 SendCmd "cutplane edges $bool" 1420 1437 } 1421 1438 "-cutplanelighting" { 1439 set _changed($what) 1 1422 1440 set bool $_settings($what) 1423 1441 SendCmd "cutplane lighting $bool" 1424 1442 } 1425 1443 "-cutplaneopacity" { 1444 set _changed($what) 1 1426 1445 set _settings($what) [expr $_widget($what) * 0.01] 1427 1446 SendCmd "cutplane opacity $_settings($what)" 1428 1447 } 1429 1448 "-cutplanepreinterp" { 1449 set _changed($what) 1 1430 1450 set bool $_settings($what) 1431 1451 SendCmd "cutplane preinterp $bool" 1432 1452 } 1433 1453 "-cutplanesvisible" { 1454 set _changed($what) 1 1434 1455 set bool $_settings($what) 1435 1456 SendCmd "cutplane visible 0" … … 1448 1469 } 1449 1470 "-cutplanewireframe" { 1471 set _changed($what) 1 1450 1472 set bool $_settings($what) 1451 1473 SendCmd "cutplane wireframe $bool" … … 1516 1538 } 1517 1539 "-isosurfaceedges" { 1540 set _changed($what) 1 1518 1541 set bool $_settings($what) 1519 1542 SendCmd "contour3d edges $bool" 1520 1543 } 1521 1544 "-isosurfacelighting" { 1545 set _changed($what) 1 1522 1546 set bool $_settings($what) 1523 1547 SendCmd "contour3d lighting $bool" 1524 1548 } 1525 1549 "-isosurfaceopacity" { 1550 set _changed($what) 1 1526 1551 set _settings($what) [expr $_widget($what) * 0.01] 1527 1552 SendCmd "contour3d opacity $_settings($what)" 1528 1553 } 1529 1554 "-isosurfacevisible" { 1555 set _changed($what) 1 1530 1556 set bool $_settings($what) 1531 1557 SendCmd "contour3d visible 0" … … 1544 1570 } 1545 1571 "-isosurfacewireframe" { 1572 set _changed($what) 1 1546 1573 set bool $_settings($what) 1547 1574 SendCmd "contour3d wireframe $bool" … … 1554 1581 } 1555 1582 "-numcontours" { 1583 set _changed($what) 1 1556 1584 set _settings($what) [$itk_component(numcontours) value] 1557 1585 if { $_contourList(numLevels) != $_settings($what) } { … … 1569 1597 } 1570 1598 "-outline" { 1599 set _changed($what) 1 1571 1600 set bool $_settings($what) 1572 1601 SendCmd "outline visible 0" … … 1590 1619 } 1591 1620 "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" { 1621 set _changed($what) 1 1592 1622 set axis [string tolower [string range $what 1 1]] 1593 1623 set bool $_settings($what) … … 1602 1632 } 1603 1633 "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" { 1634 set _changed($what) 1 1604 1635 set axis [string tolower [string range $what 1 1]] 1605 1636 set pos [expr $_settings($what) * 0.01] … … 1821 1852 } 1822 1853 itk_component add min { 1823 Rappture::Gauge $inner.min \1854 Rappture::Gauge $inner.min -font "Arial 9" \ 1824 1855 -validatecommand [itcl::code $this LegendRangeValidate "" vmin] 1825 1856 } … … 1831 1862 } 1832 1863 itk_component add max { 1833 Rappture::Gauge $inner.max \1864 Rappture::Gauge $inner.max -font "Arial 9" \ 1834 1865 -validatecommand [itcl::code $this LegendRangeValidate "" vmax] 1835 1866 } … … 2257 2288 array set style { 2258 2289 -color BCGYR 2290 -cutplaneedges 0 2291 -cutplanelighting 1 2292 -cutplaneopacity 1.0 2293 -cutplanepreinterp 1 2259 2294 -cutplanesvisible 0 2295 -cutplanewireframe 0 2260 2296 -edgecolor black 2261 2297 -edges 0 … … 2288 2324 # the code to handle aberrant cases. 2289 2325 2326 if { $_changed(-isosurfaceedges) } { 2327 set style(-edges) $_settings(-isosurfaceedges) 2328 } 2329 if { $_changed(-isosurfacelighting) } { 2330 set style(-lighting) $_settings(-isosurfacelighting) 2331 } 2290 2332 if { $_changed(-isosurfaceopacity) } { 2291 2333 set style(-opacity) $_settings(-isosurfaceopacity) 2334 } 2335 if { $_changed(-isosurfacewireframe) } { 2336 set style(-wireframe) $_settings(-isosurfacewireframe) 2292 2337 } 2293 2338 if { $_changed(-numcontours) } { … … 2311 2356 EventuallyChangeContourLevels 2312 2357 } 2313 set _settings(-isosurfacevisible) $style(-isosurfacevisible) 2314 set _settings(-cutplanesvisible) $style(-cutplanesvisible) 2315 set _settings(-xcutplanevisible) $style(-xcutplanevisible) 2316 set _settings(-ycutplanevisible) $style(-ycutplanevisible) 2317 set _settings(-zcutplanevisible) $style(-zcutplanevisible) 2318 set _settings(-xcutplaneposition) $style(-xcutplaneposition) 2319 set _settings(-ycutplaneposition) $style(-ycutplaneposition) 2320 set _settings(-zcutplaneposition) $style(-zcutplaneposition) 2358 foreach setting {-outline -isosurfacevisible -cutplanesvisible \ 2359 -xcutplanevisible -ycutplanevisible -zcutplanevisible \ 2360 -xcutplaneposition -ycutplaneposition -zcutplaneposition \ 2361 -cutplaneedges -cutplanelighting -cutplaneopacity \ 2362 -cutplanepreinterp -cutplanewireframe} { 2363 if {$_changed($setting)} { 2364 # User-modified UI setting overrides style 2365 set style($setting) $_settings($setting) 2366 } else { 2367 # Set UI control to style setting (tool provided or default) 2368 set _settings($setting) $style($setting) 2369 } 2370 } 2321 2371 2322 2372 SendCmd "cutplane add $tag" 2323 2373 SendCmd "cutplane color [Color2RGB $itk_option(-plotforeground)] $tag" 2324 2374 foreach axis {x y z} { 2325 set pos [expr $ _settings(-${axis}cutplaneposition) * 0.01]2326 set visible $ _settings(-${axis}cutplanevisible)2375 set pos [expr $style(-${axis}cutplaneposition) * 0.01] 2376 set visible $style(-${axis}cutplanevisible) 2327 2377 SendCmd "cutplane slice $axis $pos $tag" 2328 2378 SendCmd "cutplane axis $axis $visible $tag" 2329 2379 } 2380 SendCmd "cutplane edges $style(-cutplaneedges) $tag" 2381 SendCmd "cutplane lighting $style(-cutplanelighting) $tag" 2382 SendCmd "cutplane opacity $style(-cutplaneopacity) $tag" 2383 SendCmd "cutplane preinterp $style(-cutplanepreinterp) $tag" 2384 SendCmd "cutplane wireframe $style(-cutplanewireframe) $tag" 2330 2385 SendCmd "cutplane visible $style(-cutplanesvisible) $tag" 2331 2386 … … 2333 2388 SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag" 2334 2389 SendCmd "outline visible $style(-outline) $tag" 2335 set _settings(-outline) $style(-outline)2336 2390 2337 2391 GenerateContourList … … 2340 2394 SendCmd "contour3d edges $style(-edges) $tag" 2341 2395 set _settings(-isosurfaceedges) $style(-edges) 2342 #SendCmd "contour3d color [Color2RGB $s ettings(-color)] $tag"2396 #SendCmd "contour3d color [Color2RGB $style(-color)] $tag" 2343 2397 SendCmd "contour3d lighting $style(-lighting) $tag" 2344 2398 set _settings(-isosurfacelighting) $style(-lighting) … … 2417 2471 } 2418 2472 2419 2420 2473 # ---------------------------------------------------------------------- 2421 2474 # USAGE: LegendPointToValue <x> <y> … … 2449 2502 } 2450 2503 2451 2452 2504 # ---------------------------------------------------------------------- 2453 2505 # USAGE: LegendProbeSingleContour <x> <y> … … 2461 2513 SendCmd [list contour3d contourlist $value] 2462 2514 } 2463 2464 2515 2465 2516 # … … 2819 2870 } 2820 2871 2821 2822 2872 itcl::body Rappture::VtkIsosurfaceViewer::MouseOver2Which {} { 2823 2873 switch -- $_mouseOver { … … 2834 2884 return $which 2835 2885 } 2836 2837 2886 2838 2887 # ---------------------------------------------------------------------- … … 2926 2975 } 2927 2976 2928 2929 2977 # ---------------------------------------------------------------------- 2930 2978 # USAGE: ToggleCustomRange … … 2983 3031 AdjustSetting -range 2984 3032 } 2985 2986 3033 2987 3034 # ---------------------------------------------------------------------- … … 3019 3066 } 3020 3067 3021 3022 3068 # 3023 3069 # SetCurrentColormap -- … … 3082 3128 set values $_contourList(reqValues) 3083 3129 } else { 3084 # use the field limits to calculate the contour list values 3085 foreach { vmin vmax } $_limits($_curFldName) break 3086 3087 # if custom range has been set and are within the field's 3088 # range, use the custom min and max to generate contour list values 3130 # if custom range has been set, use the custom min and max 3131 # to generate contour list values 3089 3132 if { $_settings(-customrange) } { 3090 if { [$itk_component(min) value] > $vmin } { 3091 set vmin [$itk_component(min) value] 3092 } 3093 if { [$itk_component(max) value] < $vmax } { 3094 set vmax [$itk_component(max) value] 3095 } 3133 set vmin [$itk_component(min) value] 3134 set vmax [$itk_component(max) value] 3135 } else { 3136 # use the field limits to calculate the contour list values 3137 foreach { vmin vmax } $_limits($_curFldName) break 3096 3138 } 3097 3139 … … 3134 3176 } 3135 3177 $itk_component(field) value $_curFldLabel 3136 if { ![info exists _limits($_curFldName)] } { 3137 SendCmd "dataset maprange all" 3138 } else { 3139 set limits $_limits($_curFldName) 3178 if { $_settings(-customrange) } { 3179 set limits [list [$itk_component(min) value] [$itk_component(max) value]] 3140 3180 SendCmd "dataset maprange explicit $limits $_curFldName" 3141 3181 if { $limits != $_currentLimits } { … … 3143 3183 EventuallyChangeContourLevels 3144 3184 } 3145 } 3146 } 3185 } else { 3186 if { ![info exists _limits($_curFldName)] } { 3187 SendCmd "dataset maprange all" 3188 } else { 3189 set limits $_limits($_curFldName) 3190 SendCmd "dataset maprange explicit $limits $_curFldName" 3191 if { $limits != $_currentLimits } { 3192 set _currentLimits $limits 3193 EventuallyChangeContourLevels 3194 } 3195 } 3196 } 3197 }
Note: See TracChangeset
for help on using the changeset viewer.