Changeset 5157
- Timestamp:
- Mar 21, 2015, 2:27:41 AM (10 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkisosurfaceviewer.tcl
r5156 r5157 1555 1555 SendCmd "contour3d visible $bool $tag" 1556 1556 } 1557 }1558 if { $bool } {1559 1557 Rappture::Tooltip::for $itk_component(contour) \ 1560 1558 "Hide the isosurface" -
trunk/gui/scripts/vtksurfaceviewer.tcl
r5156 r5157 216 216 -legendvisible 1 217 217 -numcontours 10 218 -outline 0 218 219 -surfaceedges 0 219 220 -surfacelighting 1 220 221 -surfaceopacity 100 221 -outline 0222 222 -surfacevisible 1 223 223 -surfacewireframe 0 … … 228 228 array set _changed { 229 229 -colormap 0 230 -isolinecolor 0 231 -isolinesvisible 0 230 232 -numcontours 0 233 -outline 0 234 -surfaceedges 0 235 -surfacelighting 0 231 236 -surfaceopacity 0 237 -surfacevisible 0 238 -surfacewireframe 0 232 239 } 233 240 … … 952 959 lappend _obj2datasets($dataobj) $tag 953 960 if { [info exists _obj2ovride($dataobj-raise)] } { 954 # Setting dataset visible enables outline 955 # and contour2d 956 SendCmd "dataset visible 1 $tag" 961 SendCmd "polydata visible 1 $tag" 957 962 } 958 963 } … … 1356 1361 } 1357 1362 "-isolinecolor" { 1363 set _changed($what) 1 1358 1364 set color [$itk_component(isolineColor) value] 1359 1365 set _settings($what) $color … … 1362 1368 } 1363 1369 "-isolinesvisible" { 1370 set _changed($what) 1 1364 1371 set bool $_settings($what) 1365 SendCmd "contour2d visible $bool" 1372 SendCmd "contour2d visible 0" 1373 if { $bool } { 1374 foreach tag [CurrentDatasets -visible] { 1375 SendCmd "contour2d visible $bool $tag" 1376 } 1377 } 1366 1378 DrawLegend 1367 1379 } … … 1387 1399 } 1388 1400 "-outline" { 1401 set _changed($what) 1 1389 1402 set bool $_settings($what) 1390 SendCmd "outline visible $bool" 1403 SendCmd "outline visible 0" 1404 if { $bool } { 1405 foreach tag [CurrentDatasets -visible] { 1406 SendCmd "outline visible $bool $tag" 1407 } 1408 } 1391 1409 } 1392 1410 "-surfaceedges" { 1411 set _changed($what) 1 1393 1412 set bool $_settings($what) 1394 1413 SendCmd "polydata edges $bool" 1395 1414 } 1396 1415 "-surfacelighting" { 1416 set _changed($what) 1 1397 1417 set bool $_settings($what) 1398 1418 SendCmd "polydata lighting $bool" 1399 1419 } 1400 1420 "-surfaceopacity" { 1421 set _changed($what) 1 1401 1422 set val $_settings($what) 1402 1423 set sval [expr { 0.01 * double($val) }] … … 1404 1425 } 1405 1426 "-surfacevisible" { 1427 set _changed($what) 1 1406 1428 set bool $_settings($what) 1407 SendCmd "polydata visible $bool"1429 SendCmd "polydata visible 0" 1408 1430 if { $bool } { 1431 foreach tag [CurrentDatasets -visible] { 1432 SendCmd "polydata visible $bool $tag" 1433 } 1409 1434 Rappture::Tooltip::for $itk_component(surface) \ 1410 1435 "Hide the surface" … … 1416 1441 } 1417 1442 "-surfacewireframe" { 1443 set _changed($what) 1 1418 1444 set bool $_settings($what) 1419 1445 SendCmd "polydata wireframe $bool" … … 1915 1941 # the code to handle aberrant cases. 1916 1942 1943 if { $_changed(-surfaceedges) } { 1944 set style(-edges) $_settings(-surfaceedges) 1945 } 1946 if { $_changed(-surfacelighting) } { 1947 set style(-lighting) $_settings(-surfacelighting) 1948 } 1917 1949 if { $_changed(-surfaceopacity) } { 1918 1950 set style(-opacity) [expr $_settings(-surfaceopacity) * 0.01] 1951 } 1952 if { $_changed(-surfacewireframe) } { 1953 set style(-wireframe) $_settings(-surfacewireframe) 1919 1954 } 1920 1955 if { $_changed(-numcontours) } { … … 1935 1970 DrawLegend 1936 1971 } 1937 set _settings(-isolinesvisible) $style(-isolinesvisible) 1938 set _settings(-surfacevisible) $style(-surfacevisible) 1972 foreach setting {-outline -isolinesvisible -surfacevisible -isolinecolor} { 1973 if {$_changed($setting)} { 1974 # User-modified UI setting overrides style 1975 set style($setting) $_settings($setting) 1976 } else { 1977 # Set UI control to style setting (tool provided or default) 1978 set _settings($setting) $style($setting) 1979 } 1980 } 1939 1981 1940 1982 SendCmd "outline add $tag" 1941 1983 SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag" 1942 1984 SendCmd "outline visible $style(-outline) $tag" 1943 set _settings(-outline) $style(-outline)1944 1985 1945 1986 SendCmd "polydata add $tag"
Note: See TracChangeset
for help on using the changeset viewer.