testviz.tcl

来自「算断裂的」· TCL 代码 · 共 68 行

TCL
68
字号
# QMG: test of visualization.if {[llength [info commands .testviz_continue]] > 0} {    destroy .testviz_continue}if {[lsearch -exact [font names] testviz_buttonfont] < 0} {    font create testviz_buttonfont -family Times -size 30}toplevel .testviz_continuebutton .testviz_continue.b \	-text "Continue" \	-font testviz_buttonfont \	-background green \	-command {incr testviz_buttonpresscount}pack .testviz_continue.bset testviz_buttonpresscount 0proc testviz_waitforbuttonpress {} {    global testviz_buttonpresscount    puts "Click on green 'Continue' button on your screen to proceed..."    tkwait variable testviz_buttonpresscount    puts "  ... proceeding"}puts "This file tests graphics capabilities of QMG 2.0 under Tcl."puts "First, here is a test of 2D graphics."gmset g [gm_read $qmg_data/logo2.geo]gmviz $g blue 1puts "A plot the letter Q outlined in blue should have appeared"puts "in a new graphics window.  It will appear very distorted"puts "if the Bezier subdivision option is a small number."testviz_waitforbuttonpressif {[llength [info commands .gmvizgui]] > 0} {    puts "There is already a visualization control panel on your screen."} else {    gmvizgui    puts "The visualization control panel should have just appeared on"    puts "your screen."}puts "In the visualization control panel, increase the number of"puts "Bezier subdivisions using the slider."testviz_waitforbuttonpressgmviz $g red 1puts "A plot the letter Q outlined in red should have appeared"puts "in a new graphics window.  With the increased number"puts "of Bezier subdivisions, it should appear more like a curved object."testviz_waitforbuttonpressputs "Please start your browser.  Your browser should have a VRML"puts "plug-in.  For more information about VRML plug-ins, see"puts "http://www.web3d.org."testviz_waitforbuttonpressputs  "Click the checkbutton to enable puts notification of your browser."testviz_waitforbuttonpressgmset b [gmrndcolor [gmoffread $qmg_data/dodec.off]]gmviz $bputs "A dodecahedron with each facet a different color should have"puts "appeared in the VRML window of your browser."puts "This is the end of the test."destroy .testviz_continuefont delete testviz_buttonfont

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?