- Timestamp:
- May 1, 2015, 10:57:35 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/flowvisviewer.tcl
r5376 r5377 226 226 -ambient 60 227 227 -arrows 0 228 -axes 228 -axesvisible 0 229 229 -colormap BCGYR 230 230 -currenttime 0 231 -cutplanes Visible 0231 -cutplanesvisible 0 232 232 -diffuse 40 233 233 -duration 1:00 234 -grid 235 -isosurface 236 -legend 234 -gridvisible 0 235 -isosurfaceshading 0 236 -legendvisible 1 237 237 -lic 1 238 238 -light2side 1 239 239 -loop 0 240 240 -opacity 50 241 -outline 241 -outlinevisible 1 242 242 -particles 1 243 243 -play 0 … … 246 246 -qy $_view(-qy) 247 247 -qz $_view(-qz) 248 -specular Level 30249 -specular Exponent 90248 -specularexponent 90 249 -specularlevel 30 250 250 -speed 500 251 251 -step 0 … … 253 253 -thickness 350 254 254 -volume 1 255 -xcutplane 1256 -xcutp osition 0255 -xcutplaneposition 50 256 -xcutplanevisible 1 257 257 -xpan $_view(-xpan) 258 -ycutplane 1259 -ycutp osition 0258 -ycutplaneposition 50 259 -ycutplanevisible 1 260 260 -ypan $_view(-ypan) 261 -zcutplane 1262 -zcutp osition 0261 -zcutplaneposition 50 262 -zcutplanevisible 1 263 263 -zoom $_view(-zoom) 264 264 }] … … 327 327 -onimage [Rappture::icon cutbutton] \ 328 328 -offimage [Rappture::icon cutbutton] \ 329 -variable [itcl::scope _settings(-cutplanes Visible)] \330 -command [itcl::code $this AdjustSetting -cutplanes Visible]329 -variable [itcl::scope _settings(-cutplanesvisible)] \ 330 -command [itcl::code $this AdjustSetting -cutplanesvisible] 331 331 } 332 332 Rappture::Tooltip::for $itk_component(cutplane) \ … … 365 365 1,0 $itk_component(legend) -fill x 366 366 blt::table configure $itk_component(plotarea) r1 -resize none 367 367 368 # Create flow controls... 368 369 369 itk_component add flowcontrols { 370 370 frame $itk_interior.flowcontrols … … 1092 1092 return 1093 1093 } 1094 1094 1095 # Arguments from server are name value pairs. Stuff them in an array. 1095 1096 array set info $args … … 1198 1199 1199 1200 # Reset the camera and other view parameters 1200 InitSettings -light2side \ 1201 -ambient -diffuse -specularLevel -specularExponent \ 1202 -opacity -isosurface -grid -axes -volume -outline \ 1203 -cutplanesVisible -xcutplane -ycutplane -zcutplane 1201 InitSettings -axesvisible -gridvisible \ 1202 -opacity -light2side -isosurfaceshading \ 1203 -ambient -diffuse -specularlevel -specularexponent \ 1204 -volume -outlinevisible -cutplanesvisible \ 1205 -xcutplanevisible -ycutplanevisible -zcutplanevisible \ 1206 -xcutplaneposition -ycutplaneposition -zcutplaneposition 1204 1207 1205 1208 # nothing to send -- activate the proper volume … … 1484 1487 } 1485 1488 } 1486 "-axes " {1489 "-axesvisible" { 1487 1490 SendCmd "axis visible $_settings($what)" 1488 1491 } … … 1491 1494 set _settings($what) $color 1492 1495 #ResetColormap $color 1496 } 1497 "-cutplanesvisible" { 1498 set bool $_settings($what) 1499 set datasets [CurrentDatasets -cutplanes] 1500 set tag [lindex $datasets 0] 1501 SendCmd "cutplane visible $bool $tag" 1493 1502 } 1494 1503 "-diffuse" { … … 1501 1510 } 1502 1511 } 1503 "-specularLevel" { 1512 "-gridvisible" { 1513 SendCmd "grid visible $_settings($what)" 1514 } 1515 "-isosurfaceshading" { 1516 if { $_first != "" } { 1517 set comp [lindex [$_first components] 0] 1518 set tag $_first-$comp 1519 set val $_settings($what) 1520 SendCmd "volume shading isosurface $val $tag" 1521 #SendCmd "$tag configure -isosurface $val" 1522 } 1523 } 1524 "-legendvisible" { 1525 if { $_settings($what) } { 1526 blt::table $itk_component(plotarea) \ 1527 0,0 $itk_component(3dview) -fill both \ 1528 1,0 $itk_component(legend) -fill x 1529 blt::table configure $itk_component(plotarea) r1 -resize none 1530 } else { 1531 blt::table forget $itk_component(legend) 1532 } 1533 } 1534 "-light2side" { 1535 if { $_first != "" } { 1536 set comp [lindex [$_first components] 0] 1537 set tag $_first-$comp 1538 set val $_settings($what) 1539 SendCmd "$tag configure -light2side $val" 1540 } 1541 } 1542 "-opacity" { 1543 if { $_first != "" } { 1544 set comp [lindex [$_first components] 0] 1545 set tag $_first-$comp 1546 set opacity [expr { 0.01 * double($_settings($what)) }] 1547 SendCmd "$tag configure -opacity $opacity" 1548 } 1549 } 1550 "-outlinevisible" { 1551 if { $_first != "" } { 1552 set comp [lindex [$_first components] 0] 1553 set tag $_first-$comp 1554 SendCmd "$tag configure -outline $_settings($what)" 1555 } 1556 } 1557 "-specularlevel" { 1504 1558 if { $_first != "" } { 1505 1559 set comp [lindex [$_first components] 0] … … 1510 1564 } 1511 1565 } 1512 "-specular Exponent" {1566 "-specularexponent" { 1513 1567 if { $_first != "" } { 1514 1568 set comp [lindex [$_first components] 0] … … 1516 1570 set val $_settings($what) 1517 1571 SendCmd "$tag configure -specularExp $val" 1518 }1519 }1520 "-light2side" {1521 if { $_first != "" } {1522 set comp [lindex [$_first components] 0]1523 set tag $_first-$comp1524 set val $_settings($what)1525 SendCmd "$tag configure -light2side $val"1526 }1527 }1528 "-opacity" {1529 if { $_first != "" } {1530 set comp [lindex [$_first components] 0]1531 set tag $_first-$comp1532 set opacity [expr { 0.01 * double($_settings($what)) }]1533 SendCmd "$tag configure -opacity $opacity"1534 1572 } 1535 1573 } … … 1544 1582 } 1545 1583 } 1546 "-outline" {1547 if { $_first != "" } {1548 set comp [lindex [$_first components] 0]1549 set tag $_first-$comp1550 SendCmd "$tag configure -outline $_settings($what)"1551 }1552 }1553 "-isosurface" {1554 SendCmd "volume shading isosurface $_settings($what)"1555 }1556 "-grid" {1557 SendCmd "grid visible $_settings($what)"1558 }1559 "-legend" {1560 if { $_settings($what) } {1561 blt::table $itk_component(plotarea) \1562 0,0 $itk_component(3dview) -fill both \1563 1,0 $itk_component(legend) -fill x1564 blt::table configure $itk_component(plotarea) r1 -resize none1565 } else {1566 blt::table forget $itk_component(legend)1567 }1568 }1569 1584 "-volume" { 1570 1585 if { $_first != "" } { … … 1574 1589 } 1575 1590 } 1576 "-cutplanesVisible" { 1577 set bool $_settings($what) 1591 "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" { 1592 set axis [string range $what 1 1] 1593 set pos [expr $_settings($what) * 0.01] 1594 # We only set cutplanes on the first dataset. 1578 1595 set datasets [CurrentDatasets -cutplanes] 1579 1596 set tag [lindex $datasets 0] 1580 SendCmd "cutplane visible $bool$tag"1581 } 1582 "-xcutplane " - "-ycutplane" - "-zcutplane" {1597 SendCmd "cutplane position $pos $axis $tag" 1598 } 1599 "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" { 1583 1600 set axis [string range $what 1 1] 1584 1601 set bool $_settings($what) 1585 if { [isconnected] } {1586 set vols [CurrentDatasets -cutplanes]1587 SendCmd "cutplane state $bool $axis $vols"1588 }1602 # We only set cutplanes on the first dataset. 1603 set datasets [CurrentDatasets -cutplanes] 1604 set tag [lindex $datasets 0] 1605 SendCmd "cutplane state $bool $axis $tag" 1589 1606 if { $bool } { 1590 1607 $itk_component(${axis}CutScale) configure -state normal \ … … 1966 1983 checkbutton $inner.axes \ 1967 1984 -text "Axes" \ 1968 -variable [itcl::scope _settings(-axes )] \1969 -command [itcl::code $this AdjustSetting -axes ] \1985 -variable [itcl::scope _settings(-axesvisible)] \ 1986 -command [itcl::code $this AdjustSetting -axesvisible] \ 1970 1987 -font "Arial 9" 1971 1988 1972 1989 checkbutton $inner.grid \ 1973 1990 -text "Grid" \ 1974 -variable [itcl::scope _settings(-grid )] \1975 -command [itcl::code $this AdjustSetting -grid ] \1991 -variable [itcl::scope _settings(-gridvisible)] \ 1992 -command [itcl::code $this AdjustSetting -gridvisible] \ 1976 1993 -font "Arial 9" 1977 1994 1978 1995 checkbutton $inner.outline \ 1979 1996 -text "Outline" \ 1980 -variable [itcl::scope _settings(-outline )] \1981 -command [itcl::code $this AdjustSetting -outline ] \1997 -variable [itcl::scope _settings(-outlinevisible)] \ 1998 -command [itcl::code $this AdjustSetting -outlinevisible] \ 1982 1999 -font "Arial 9" 1983 2000 1984 2001 checkbutton $inner.legend \ 1985 2002 -text "Legend" \ 1986 -variable [itcl::scope _settings(-legend )] \1987 -command [itcl::code $this AdjustSetting -legend ] \2003 -variable [itcl::scope _settings(-legendvisible)] \ 2004 -command [itcl::code $this AdjustSetting -legendvisible] \ 1988 2005 -font "Arial 9" 1989 2006 … … 2041 2058 2042 2059 checkbutton $inner.isosurface -text "Isosurface shading" -font $fg \ 2043 -variable [itcl::scope _settings(-isosurface )] \2044 -command [itcl::code $this AdjustSetting -isosurface ]2060 -variable [itcl::scope _settings(-isosurfaceshading)] \ 2061 -command [itcl::code $this AdjustSetting -isosurfaceshading] 2045 2062 2046 2063 checkbutton $inner.light2side -text "Two-sided lighting" -font $fg \ … … 2062 2079 label $inner.specularLevel_l -text "Specular" -font $fg 2063 2080 ::scale $inner.specularLevel -from 0 -to 100 -orient horizontal \ 2064 -variable [itcl::scope _settings(-specular Level)] \2081 -variable [itcl::scope _settings(-specularlevel)] \ 2065 2082 -width 10 \ 2066 -showvalue off -command [itcl::code $this AdjustSetting -specular Level]2083 -showvalue off -command [itcl::code $this AdjustSetting -specularlevel] 2067 2084 2068 2085 label $inner.specularExponent_l -text "Shininess" -font $fg 2069 2086 ::scale $inner.specularExponent -from 10 -to 128 -orient horizontal \ 2070 -variable [itcl::scope _settings(-specular Exponent)] \2087 -variable [itcl::scope _settings(-specularexponent)] \ 2071 2088 -width 10 \ 2072 -showvalue off -command [itcl::code $this AdjustSetting -specular Exponent]2089 -showvalue off -command [itcl::code $this AdjustSetting -specularexponent] 2073 2090 2074 2091 # Opacity … … 2131 2148 checkbutton $inner.visible \ 2132 2149 -text "Show Cutplanes" \ 2133 -variable [itcl::scope _settings(-cutplanes Visible)] \2134 -command [itcl::code $this AdjustSetting -cutplanes Visible] \2150 -variable [itcl::scope _settings(-cutplanesvisible)] \ 2151 -command [itcl::code $this AdjustSetting -cutplanesvisible] \ 2135 2152 -font "Arial 9" 2136 2153 … … 2140 2157 -onimage [Rappture::icon x-cutplane] \ 2141 2158 -offimage [Rappture::icon x-cutplane] \ 2142 -command [itcl::code $this AdjustSetting -xcutplane ] \2143 -variable [itcl::scope _settings(-xcutplane )]2159 -command [itcl::code $this AdjustSetting -xcutplanevisible] \ 2160 -variable [itcl::scope _settings(-xcutplanevisible)] 2144 2161 } 2145 2162 Rappture::Tooltip::for $itk_component(xCutButton) \ … … 2152 2169 -borderwidth 1 -highlightthickness 0 \ 2153 2170 -command [itcl::code $this Slice move x] \ 2154 -variable [itcl::scope _settings(-xcutp osition)]2171 -variable [itcl::scope _settings(-xcutplaneposition)] 2155 2172 } { 2156 2173 usual … … 2168 2185 -onimage [Rappture::icon y-cutplane] \ 2169 2186 -offimage [Rappture::icon y-cutplane] \ 2170 -command [itcl::code $this AdjustSetting -ycutplane ] \2171 -variable [itcl::scope _settings(-ycutplane )]2187 -command [itcl::code $this AdjustSetting -ycutplanevisible] \ 2188 -variable [itcl::scope _settings(-ycutplanevisible)] 2172 2189 } 2173 2190 Rappture::Tooltip::for $itk_component(yCutButton) \ … … 2180 2197 -borderwidth 1 -highlightthickness 0 \ 2181 2198 -command [itcl::code $this Slice move y] \ 2182 -variable [itcl::scope _settings(-ycutp osition)]2199 -variable [itcl::scope _settings(-ycutplaneposition)] 2183 2200 } { 2184 2201 usual … … 2196 2213 -onimage [Rappture::icon z-cutplane] \ 2197 2214 -offimage [Rappture::icon z-cutplane] \ 2198 -command [itcl::code $this AdjustSetting -zcutplane ] \2199 -variable [itcl::scope _settings(-zcutplane )]2215 -command [itcl::code $this AdjustSetting -zcutplanevisible] \ 2216 -variable [itcl::scope _settings(-zcutplanevisible)] 2200 2217 } 2201 2218 Rappture::Tooltip::for $itk_component(zCutButton) \ … … 2208 2225 -borderwidth 1 -highlightthickness 0 \ 2209 2226 -command [itcl::code $this Slice move z] \ 2210 -variable [itcl::scope _settings(-zcutp osition)]2227 -variable [itcl::scope _settings(-zcutplaneposition)] 2211 2228 } { 2212 2229 usual … … 2506 2523 array set info [$flowobj hints] 2507 2524 set _settings(-volume) $info(volume) 2508 set _settings(-outline ) $info(outline)2525 set _settings(-outlinevisible) $info(outline) 2509 2526 set _settings(-arrows) $info(arrows) 2510 2527 set _settings(-duration) $info(duration)
Note: See TracChangeset
for help on using the changeset viewer.