Changeset 6261 for trunk/gui/scripts
- Timestamp:
- Apr 12, 2016, 1:23:45 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/mapviewer.tcl
r6257 r6261 52 52 public method add {dataobj {settings ""}} 53 53 public method camera {option args} 54 public method delete {args} 54 public method clear {args} 55 public method delete {args} { eval hide $args } 55 56 public method disconnect {} 56 57 public method download {option args} 58 public method hide {args} 57 59 public method placard {option args} 58 60 public method get {args} … … 690 692 691 693 # ---------------------------------------------------------------------- 692 # USAGE: delete ?<dataobj1> <dataobj2> ...? 693 # 694 # Clients use this to delete a dataobj from the plot. If no dataobjs 695 # are specified, then all dataobjs are deleted. No data objects are 696 # deleted. They are only removed from the display list. 697 # ---------------------------------------------------------------------- 698 itcl::body Rappture::MapViewer::delete {args} { 694 # USAGE: hide ?<dataobj1> <dataobj2> ...? 695 # 696 # Clients use this to hide a dataobj from the plot. If no dataobjs are 697 # specified, then all dataobjs are hidden. 698 # ---------------------------------------------------------------------- 699 itcl::body Rappture::MapViewer::hide {args} { 699 700 DebugTrace "Enter" 700 701 if { [llength $args] == 0} { 701 702 set args $_dlist 702 703 } 703 # Delete all specified dataobjs704 # Mark all specified dataobjs as hidden 704 705 set changed 0 705 706 foreach dataobj $args { … … 716 717 } 717 718 array unset _obj2ovride $dataobj-* 719 set changed 1 720 } 721 # If anything changed, then rebuild the plot 722 if { $changed } { 723 $_dispatcher event -idle !rebuild 724 } 725 } 726 727 # ---------------------------------------------------------------------- 728 # USAGE: clear ?<dataobj1> <dataobj2> ...? 729 # 730 # Clients use this to permanently clear a dataobj from the plot and the 731 # render server. If no dataobjs are specified, then all dataobjs are 732 # cleared. 733 # ---------------------------------------------------------------------- 734 itcl::body Rappture::MapViewer::clear {args} { 735 DebugTrace "Enter" 736 if { [llength $args] == 0} { 737 set args [concat $_dlist $_hidden] 738 } 739 # Delete all specified dataobjs 740 set changed 0 741 foreach dataobj $args { 742 set found 0 743 set dpos [lsearch -exact $_dlist $dataobj] 744 if { $dpos >= 0 } { 745 set found 1 746 } 747 set hpos [lsearch -exact $_hidden $dataobj] 748 if { $hpos >= 0 } { 749 set found 1 750 } 751 if { !$found } { 752 continue 753 } 754 foreach tag [array names _layers -glob $dataobj-*] { 755 SendCmd "map layer delete $tag" 756 } 757 if { [info commands $dataobj] == $dataobj } { 758 # Remove the layers from the client and server. 759 foreach layer [$dataobj layers] { 760 if { ![$dataobj layer $layer shared] } { 761 # Remove shared layer if no other objects have it? 762 } 763 } 764 } 765 if { $dpos >= 0 } { 766 # Remove it from the dataobj list. 767 set _dlist [lreplace $_dlist $dpos $dpos] 768 } 769 if { $hpos >= 0 } { 770 # Remove it from the hidden list. 771 set _hidden [lreplace $_hidden $hpos $hpos] 772 } 773 array unset _obj2ovride $dataobj-* 774 array unset _layers $dataobj-* 775 array unset _opacity $dataobj-* 776 array unset _visibility $dataobj-* 718 777 set changed 1 719 778 }
Note: See TracChangeset
for help on using the changeset viewer.