- Timestamp:
- Dec 17, 2012 8:57:04 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Rappture 1.2/gui/scripts/vtkheightmapviewer.tcl
r3204 r3209 85 85 private method BuildAxisTab {} 86 86 private method BuildCameraTab {} 87 private method BuildViewTab {}88 87 private method BuildColormap { name colors } 88 private method BuildContourTab {} 89 89 private method BuildCutplaneTab {} 90 90 private method BuildDownloadPopup { widget command } 91 private method BuildContourTab {} 91 private method BuildViewTab {} 92 private method ChangeColormap { dataobj comp color } 93 private method ColorsToColormap { color } 94 private method Combo { option } 92 95 private method ConvertToVtkData { dataobj comp } 93 96 private method DrawLegend { title } 94 private method Combo { option }95 97 private method EnterLegend { x y } 98 private method EventuallyContour { numContours } 96 99 private method EventuallyResize { w h } 97 private method EventuallyContour { numContours }98 100 private method EventuallyRotate { q } 99 101 private method EventuallySetCutplane { axis args } … … 106 108 private method RequestLegend {} 107 109 private method SetColormap { dataobj comp } 108 private method ChangeColormap { dataobj comp color }109 private method ColorsToColormap { color }110 110 private method SetLegendTip { x y } 111 111 private method SetObjectStyle { dataobj comp } 112 112 private method Slice {option args} 113 114 private method DebugConsole {} 115 private method BuildConsole {} 116 private method TraceComm { channel {data {}} } 117 private method SendDebugCommand {} 113 118 114 119 private variable _arcball "" … … 238 243 239 244 array set _settings [subst { 245 debug-console 0 240 246 axis-labels 1 241 247 axis-visible 1 … … 2011 2017 -font "Arial 9" 2012 2018 2019 checkbutton $inner.debug \ 2020 -text "Debug " \ 2021 -variable [itcl::scope _settings(debug-console)] \ 2022 -command [itcl::code $this DebugConsole] \ 2023 -font "Arial 9" 2024 2013 2025 blt::table $inner \ 2014 2026 0,0 $inner.view -anchor w -pady 2 \ … … 2018 2030 5,0 $inner.contour -anchor w -pady 2 \ 2019 2031 6,0 $inner.heightmap -anchor w -pady 2 \ 2032 8,0 $inner.debug -anchor w -pady 2 \ 2020 2033 2021 2034 blt::table configure $inner r* c* -resize none 2022 blt::table configure $inner r 8c1 -resize expand2023 blt::table configure $inner r4 -height 0.25i2035 blt::table configure $inner r9 c1 -resize expand 2036 blt::table configure $inner r4 r7 -height 0.25i 2024 2037 } 2025 2038 … … 2775 2788 } 2776 2789 } 2790 2791 # ---------------------------------------------------------------------- 2792 # USAGE: show_comm <channel> <data> 2793 # 2794 # Invoked automatically whenever there is communication between 2795 # the rendering widget and the server. Eavesdrops on the communication 2796 # and posts the commands in a text viewer. 2797 # ---------------------------------------------------------------------- 2798 itcl::body Rappture::VtkHeightmapViewer::TraceComm {channel {data ""}} { 2799 $itk_component(trace) configure -state normal 2800 switch -- $channel { 2801 closed { 2802 $itk_component(trace) insert end "--CLOSED--\n" error 2803 } 2804 <<line { 2805 $itk_component(trace) insert end $data incoming "\n" incoming 2806 } 2807 >>line { 2808 $itk_component(trace) insert end $data outgoing "\n" outgoing 2809 } 2810 error { 2811 $itk_component(trace) insert end $data error "\n" error 2812 } 2813 default { 2814 $itk_component(trace) insert end "$data\n" 2815 } 2816 } 2817 $itk_component(trace) configure -state disabled 2818 $itk_component(trace) see end 2819 } 2820 2821 # ---------------------------------------------------------------------- 2822 # USAGE: send_command 2823 # 2824 # Invoked automatically whenever the user enters a command and 2825 # presses <Return>. Sends the command along to the rendering 2826 # widget. 2827 # ---------------------------------------------------------------------- 2828 itcl::body Rappture::VtkHeightmapViewer::SendDebugCommand {} { 2829 set cmd [$itk_component(command) get] 2830 SendBytes "$cmd\n" 2831 $itk_component(command) delete 0 end 2832 } 2833 2834 itcl::body Rappture::VtkHeightmapViewer::BuildConsole {} { 2835 toplevel .vtkconsole 2836 2837 set f .vtkconsole 2838 frame $f.send 2839 pack $f.send -side bottom -fill x 2840 label $f.send.l -text "Send:" 2841 pack $f.send.l -side left 2842 itk_component add command { 2843 entry $f.send.e -background white 2844 } { 2845 ignore -background 2846 } 2847 pack $f.send.e -side left -expand yes -fill x 2848 bind $f.send.e <KeyPress-Return> [itcl::code $this SendDebugCommand] 2849 2850 scrollbar $f.sb -orient vertical -command "$f.comm yview" 2851 pack $f.sb -side right -fill y 2852 itk_component add trace { 2853 text $f.comm -wrap char -yscrollcommand "$f.sb set" -background white 2854 } { 2855 ignore -background 2856 } 2857 pack $f.comm -expand yes -fill both 2858 2859 $itk_component(trace) tag configure error -foreground red \ 2860 -font -*-courier-medium-o-normal-*-*-120-* 2861 $itk_component(trace) tag configure incoming -foreground blue 2862 } 2863 2864 itcl::body Rappture::VtkHeightmapViewer::DebugConsole {} { 2865 if { ![winfo exists .vtkconsole] } { 2866 BuildConsole 2867 } 2868 if { $_settings(debug-console) } { 2869 $this configure -sendcommand [itcl::code $this TraceComm] 2870 $this configure -receivecommand [itcl::code $this TraceComm] 2871 wm deiconify .vtkconsole 2872 } else { 2873 $this configure -sendcommand "" 2874 $this configure -receivecommand "" 2875 wm withdraw .vtkconsole 2876 } 2877 } 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895
Note: See TracChangeset
for help on using the changeset viewer.