- Timestamp:
- Dec 17, 2013, 12:20:28 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkvolumeviewer.tcl
r4075 r4083 167 167 private variable _curFldName "" 168 168 private variable _curFldLabel "" 169 private variable _c olorMode "scalar";# Mode of colormap (vmag or scalar)169 private variable _cutplaneCmd "imgcutplane" 170 170 } 171 171 … … 1456 1456 set bool $_settings($what) 1457 1457 foreach dataset [CurrentDatasets -visible] { 1458 SendCmd "cutplane edges $bool $dataset" 1458 if {$_cutplaneCmd != "imgcutplane"} { 1459 SendCmd "$_cutplaneCmd edges $bool $dataset" 1460 } 1461 } 1462 } 1463 "cutplaneWireframe" { 1464 set bool $_settings($what) 1465 foreach dataset [CurrentDatasets -visible] { 1466 if {$_cutplaneCmd != "imgcutplane"} { 1467 SendCmd "$_cutplaneCmd wireframe $bool $dataset" 1468 } 1459 1469 } 1460 1470 } … … 1462 1472 set bool $_settings($what) 1463 1473 foreach dataset [CurrentDatasets -visible] { 1464 SendCmd "cutplane visible $bool $dataset" 1465 } 1466 } 1467 "cutplaneWireframe" { 1468 set bool $_settings($what) 1469 foreach dataset [CurrentDatasets -visible] { 1470 SendCmd "cutplane wireframe $bool $dataset" 1474 SendCmd "$_cutplaneCmd visible $bool $dataset" 1471 1475 } 1472 1476 } … … 1474 1478 set bool $_settings($what) 1475 1479 foreach dataset [CurrentDatasets -visible] { 1476 SendCmd "cutplane lighting $bool $dataset" 1480 if {$_cutplaneCmd != "imgcutplane"} { 1481 SendCmd "$_cutplaneCmd lighting $bool $dataset" 1482 } else { 1483 if {$bool} { 1484 set ambient 0.0 1485 set diffuse 1.0 1486 } else { 1487 set ambient 1.0 1488 set diffuse 0.0 1489 } 1490 SendCmd "imgcutplane material $ambient $diffuse $dataset" 1491 } 1477 1492 } 1478 1493 } … … 1481 1496 set sval [expr { 0.01 * double($val) }] 1482 1497 foreach dataset [CurrentDatasets -visible] { 1483 SendCmd " cutplaneopacity $sval $dataset"1498 SendCmd "$_cutplaneCmd opacity $sval $dataset" 1484 1499 } 1485 1500 } … … 1495 1510 } 1496 1511 foreach dataset [CurrentDatasets -visible] { 1497 SendCmd " cutplaneaxis $axis $bool $dataset"1512 SendCmd "$_cutplaneCmd axis $axis $bool $dataset" 1498 1513 } 1499 1514 } … … 1502 1517 set pos [expr $_settings($what) * 0.01] 1503 1518 foreach dataset [CurrentDatasets -visible] { 1504 SendCmd " cutplaneslice ${axis} ${pos} $dataset"1519 SendCmd "$_cutplaneCmd slice ${axis} ${pos} $dataset" 1505 1520 } 1506 1521 set _cutplanePending 0 … … 1526 1541 puts stderr "Can't use a vector field in a volume" 1527 1542 return 1528 } else {1529 set _colorMode scalar1530 1543 } 1531 1544 set _curFldName $fname … … 1536 1549 } 1537 1550 foreach dataset [CurrentDatasets -visible $_first] { 1538 #SendCmd "volume colormode $_colorMode ${fname} $dataset" 1539 SendCmd "cutplane colormode $_colorMode ${fname} $dataset" 1551 SendCmd "dataset scalar $_curFldName $dataset" 1540 1552 } 1541 1553 SendCmd "camera reset" … … 1568 1580 if { [info exists _dataset2style($dataset)] } { 1569 1581 SendCmdNoWait \ 1570 "legend $_dataset2style($dataset) $_colorMode$_curFldName {} $w $h 0"1582 "legend $_dataset2style($dataset) scalar $_curFldName {} $w $h 0" 1571 1583 break; 1572 1584 } … … 2138 2150 array set settings $style 2139 2151 SendCmd "volume add $tag" 2140 SendCmd " cutplaneadd $tag"2141 SendCmd " cutplanevisible 0 $tag"2152 SendCmd "$_cutplaneCmd add $tag" 2153 SendCmd "$_cutplaneCmd visible 0 $tag" 2142 2154 SendCmd "volume lighting $settings(-lighting) $tag" 2143 2155 set _settings(volumeLighting) $settings(-lighting) 2144 2156 SetInitialTransferFunction $dataobj $cname 2145 2157 SendCmd "volume colormap $cname $tag" 2146 SendCmd " cutplanecolormap $cname-opaque $tag"2158 SendCmd "$_cutplaneCmd colormap $cname-opaque $tag" 2147 2159 } 2148 2160
Note: See TracChangeset
for help on using the changeset viewer.