Changeset 1141 for trunk/gui/scripts/nanovisviewer.tcl
- Timestamp:
- Sep 4, 2008 5:23:26 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/nanovisviewer.tcl
r1081 r1141 57 57 public method delete {args} 58 58 public method scale {args} 59 public method GetLimits { ivol } { 60 if { [info exists _id2style($ivol)] } { 61 set tf $_id2style($ivol) 62 set _limits(min) "" 63 set _limits(max) "" 64 foreach ivol $_style2ids($tf) { 65 if { ![info exists _limits($ivol-min)] } { 66 puts stderr "In GetLimits $ivol" 67 parray _limits 68 error "can't find $ivol limits" 69 } 70 if { $_limits(min) == "" || 71 $_limits(min) > $_limits($ivol-min) } { 72 set _limits(min) $_limits($ivol-min) 73 } 74 if { $_limits(max) == "" || 75 $_limits(max) < $_limits($ivol-max) } { 76 set _limits(max) $_limits($ivol-max) 77 } 78 } 79 } 80 return [array get _limits] 81 } 59 public method GetLimits { ivol } 82 60 public method download {option args} 83 61 public method parameters {title args} { … … 609 587 # USAGE: delete ?<dataobj1> <dataobj2> ...? 610 588 # 611 # Clients use this to delete a dataobj from the plot. If no dataobjs 612 # are specified, then all dataobjs are deleted. 589 # Clients use this to delete a dataobj from the plot. If no dataobjs 590 # are specified, then all dataobjs are deleted. No data objects are 591 # deleted. They are only removed from the display list. 592 # 613 593 # ---------------------------------------------------------------------- 614 594 itcl::body Rappture::NanovisViewer::delete {args} { … … 616 596 set args $_dlist 617 597 } 618 # delete all specified dataobjs598 # Delete all specified dataobjs 619 599 set changed 0 620 600 foreach dataobj $args { 621 601 set pos [lsearch -exact $_dlist $dataobj] 622 if { $pos >= 0} {602 if { $pos >= 0 } { 623 603 set _dlist [lreplace $_dlist $pos $pos] 624 604 foreach key [array names _obj2ovride $dataobj-*] { … … 628 608 } 629 609 } 630 # if anything changed, then rebuild the plot610 # If anything changed, then rebuild the plot 631 611 if {$changed} { 632 612 $_dispatcher event -idle !rebuild … … 717 697 } 718 698 set result [VisViewer::Connect $_hosts] 699 if { $result } { 700 set w [winfo width $itk_component(3dview)] 701 set h [winfo height $itk_component(3dview)] 702 _send "screen $w $h" 703 } 719 704 return $result 720 705 } … … 826 811 827 812 if 0 { 813 # Add this when we fix grid for volumes 828 814 _send "volume axis label x \"\"" 829 815 _send "volume axis label y \"\"" … … 1035 1021 } 1036 1022 } 1023 set w [winfo width $itk_component(3dview)] 1024 set h [winfo height $itk_component(3dview)] 1025 _send "screen $w $h" 1026 1027 # 1028 # Reset the camera and other view parameters 1029 # 1030 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)] 1031 _send "camera angle $xyz" 1032 _send "camera zoom $_view(zoom)" 1033 1034 _fixSettings light 1035 _fixSettings transp 1036 _fixSettings isosurface 1037 _fixSettings grid 1038 _fixSettings axes 1039 _fixSettings outline 1040 1037 1041 if {[llength $_sendobjs] > 0} { 1038 1042 # send off new data objects … … 1040 1044 return 1041 1045 } 1042 1043 set w [winfo width $itk_component(3dview)]1044 set h [winfo height $itk_component(3dview)]1045 _send "screen $w $h"1046 1046 1047 1047 # nothing to send -- activate the proper ivol … … 1082 1082 _send "volume data state [_state volume] $vols" 1083 1083 $_dispatcher event -idle !legend 1084 1085 #1086 # Reset the camera and other view parameters1087 #1088 _send "camera angle [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]"1089 _send "camera zoom $_view(zoom)"1090 1091 _fixSettings light1092 _fixSettings transp1093 _fixSettings isosurface1094 _fixSettings grid1095 _fixSettings axes1096 _fixSettings outline1097 1084 } 1098 1085 … … 1577 1564 } 1578 1565 SendBytes "transfunc define $tf { $cmap } { $wmap }\n" 1579 #puts stdout "transfunc define $tf { $cmap } { $wmap }\n"1580 1566 return [SendBytes "volume shading transfunc $tf $_style2ids($tf)\n"] 1581 1567 } … … 1745 1731 return "" 1746 1732 } 1733 1734 itcl::body Rappture::NanovisViewer::GetLimits { ivol } { 1735 if { ![info exists _id2style($ivol)] } { 1736 return 1737 } 1738 set tf $_id2style($ivol) 1739 set _limits(min) "" 1740 set _limits(max) "" 1741 foreach ivol $_style2ids($tf) { 1742 if { ![info exists _limits($ivol-min)] } { 1743 error "can't find $ivol limits" 1744 } 1745 if { $_limits(min) == "" || $_limits(min) > $_limits($ivol-min) } { 1746 set _limits(min) $_limits($ivol-min) 1747 } 1748 if { $_limits(max) == "" || $_limits(max) < $_limits($ivol-max) } { 1749 set _limits(max) $_limits($ivol-max) 1750 } 1751 } 1752 return [array get _limits] 1753 }
Note: See TracChangeset
for help on using the changeset viewer.