- Timestamp:
- Jan 24, 2013 11:12:29 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Rappture 1.2/gui/scripts/vtkheightmapviewer.tcl
r3259 r3261 245 245 x-scale 1.0 246 246 y-scale 1.0 247 z-scale 1.0 247 248 }] 248 249 … … 717 718 global readyForNextFrame 718 719 set readyForNextFrame 1 720 set _reset 1 719 721 set _hosts [GetServerList "vtkvis"] 720 722 if { "" == $_hosts } { … … 917 919 $_arcball resize $w $h 918 920 DoResize 921 if { $_settings(stretch-to-fit) } { 922 Adjustsetting stretch-to-fit 923 } 919 924 } 920 925 if { $_reset } { 921 InitSettings heightmap-mode 926 puts stderr "initial settings" 927 InitSettings heightmap-mode background 922 928 # 923 929 # Reset the camera and other view parameters … … 925 931 SendCmd "axis color all [Color2RGB $itk_option(-plotforeground)]" 926 932 SendCmd "axis lrot z 90" 927 SendCmd "dataset maprange all"933 SendCmd "dataset maprange explicit $_limits(zmin) $_limits(zmax)" 928 934 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 929 935 $_arcball quaternion $q … … 1400 1406 "background" { 1401 1407 set bgcolor [$itk_component(background) value] 1408 puts stderr "set background to $bgcolor" 1402 1409 array set fgcolors { 1403 1410 "black" "white" … … 1487 1494 "stretch-to-fit" { 1488 1495 set bool $_settings(stretch-to-fit) 1496 set _settings(x-scale) 1.0 1497 set _settings(y-scale) 1.0 1498 set _settings(z-scale) 1.0 1489 1499 if { $bool } { 1490 1500 set w $_width … … 1492 1502 set xr [expr $_limits(xmax) - $_limits(xmin)] 1493 1503 set yr [expr $_limits(ymax) - $_limits(ymin)] 1494 if { $yr < $xr } { 1495 set s [expr (double($h)*$xr) / (double($w)*$yr)] 1496 SendCmd "heightmap scale 1 $s 1" 1497 set _settings(y-scale) $s 1498 set _settings(x-scale) 1.0 1504 if { $h < $w } { 1505 set xs [expr (double($w)*$yr) / (double($h)*$xr)] 1506 set _settings(x-scale) $xs 1499 1507 } else { 1500 set s [expr (double($w)*$yr) / (double($h)*$xr)] 1501 SendCmd "heightmap scale $s 1 1" 1502 set _settings(x-scale) $s 1503 set _settings(y-scale) 1.0 1508 set ys [expr (double($h)*$xr) / (double($w)*$yr)] 1509 set _settings(y-scale) $ys 1510 set _settings(z-scale) $ys 1504 1511 } 1505 } else {1506 set _settings(x-scale) 1.01507 set _settings(y-scale) 1.01508 SendCmd "heightmap scale 1 1 1"1509 1512 } 1513 SendCmd "heightmap scale $_settings(x-scale) $_settings(y-scale) $_settings(z-scale)" 1514 # It kind of makes sense that I need to reset the camera 1515 # whenever the scale changes. 1516 Zoom reset 1510 1517 } 1511 1518 "heightmap-mode" { … … 1843 1850 append cmap "$x [Color2RGB $color] " 1844 1851 } 1852 puts stderr "colormap $colors = ($cmap)" 1845 1853 return $cmap 1846 1854 }
Note: See TracChangeset
for help on using the changeset viewer.