Graphics.EDGECanvasPluginReference - lordmundi/wikidoctest GitHub Wiki
EDGE Canvas Plugin Reference
« Adding a simple 3D overlay | EDGE User’s Guide | EDGE Info Plugin Reference »
Since we don't have any formal documentation for the canvas plugin, here are some references and examples that show the various things you can do with the canvas plugin in a tcl script.
dsp_canvas create .can1 -background NONE -foreground #00ff00 -font arial_bold -nrows 40 -ncols 80 -col_lock 1
set dispname [dsp.view WINDOW1 get -display]
set channame [dsp.view WINDOW1 get -channel]
dsp_canvas place canvas_name -in_display $dispname:$channame
dsp_canvas copy canvas_name_src canvas_name_des
dsp_canvas create canvas_name -nrows rows -ncols cols -background RGB -foregrond default_RGB -font default_font
dsp_canvas place canvas_name (defaults to channel1 of local display-process, covering the whole channel of the display)
dsp_canvas place canvas_name -x xval -y yval -col_vec "dx dy" -row_vec "dx dy" (DEFAULTS TO LOCAL DISPLAY-PROCESS CHANNEL, 0-1 range for width,height)
dsp_canvas place canvas_name -in_scene -x xval -y yval -z zval -col_vec "dx dy dz" -row_vec "dx dy dz"
dsp_canvas place canvas_name -in_node node_name -x xval -y yval -z zval -col_vec "dx dy dz" -row_vec "dx dy dz" -width 15 -height 10
dsp_canvas place canvas_name -in_display display_name[[:channel#].view] -x xval -y yval -col_vec "dx dy" -row_vec "dx dy"
dsp_canvas pack canvas_name -in_display display_name[[:channel#].view] -side top -anchor n -scale y -col_vec "dx dy" -row_vec "dx dy"
dsp_canvas forget canvas_name
dsp_canvas exist canvas_name
dsp_canvas delete canvas_name
set id [canvas_name create text col row -anchor w -text "This is it" -justify center -foreground $ffff00]
set id [canvas_name create line col1 row1 col2 row2 -foreground #000000]
set id [canvas_name create polygon col1 row1 ... coln rown -foreground #00ff00]
dsp_canvas place canvas_name -in_display [dsp.view WINDOW1 get -display]:[dsp.view WINDOW1 get -channel]
EXAMPLE USAGE
if { [dsp_canvas exist .mycanvas] == "" } {
dsp_canvas create .mycanvas -nrows 80 -ncols 40 -background #0000ff -foreground #00ff00 -font arial.glf
.mycanvas create text 1 0 -anchor w -text "This is it" -foreground #ffff00 -tag safer_text
.mycanvas create text 1 1 -anchor w -textvar mytextvar -background #ff0000 -tag safer_text2
} else {
.mycanvas itemconfigure safer_text2 -textvar mytextvar
}
dsp_canvas place .mycanvas -in_node WRR1 -x 0 -y -7.5 -z 7.5 -col_vec "0 1 0" -row_vec "0 0 -1" -width 15 -height 10
canvas_name create text col row -textscale col row -anchor w -text "This is it" -justify center -col $ffff00]
canvas_name itemconfigure $mytex -text "New text" -flags HIDE -offset xoff yoff -scale .5 1
canvas_name configure -nrows num_rows
canvas_name coords $mytex [new_col new_row]
canvas_name get -mousecol -mouserow -bbox id/tag -id tag -type id -viewpnts camname aspect -viewcoord viewname row col
canvas_name addtag tag enclosed x1 y1 x2 y2
canvas_name addtag tag overlapping x1 y1 x2 y2
canvas_name addtag tag all
canvas_name addtag tag withtag tag/id
canvas_name addtag tag closest x y
canvas_name create text x y -tag MyText [options]
canvas_name create line x1 y1 ... xn yn [options]
canvas_name create arc x1 y1 x2 y2 start_deg end_deg
canvas_name create rectangle x1 y1 x2 y2 [options]
canvas_name create circle x y radius [options]
canvas_name create polygon x1 y1 ... xn yn [options]
canvas_name create node node_name [options]
canvas_name create image filename x1 y1 x2 y2 [options]
canvas_name hastag id/tag [tags_to_find]
canvas_name delete id/tag
canvas_name deltag id/tag [tags_to_delete]
# For canvases placed in the 3d scene, the following commands can add or remove views where the canvas will show up.
canvas_name addview viewname
canvas_name delview viewname
« Adding a simple 3D overlay | EDGE User’s Guide | EDGE Info Plugin Reference »