Drawtool with distributed command interpreter
comdraw [-port n] [-import n] ['X-params'] [file]
comdraw is a drawing editor with integrated command interpreter the user can interact with via stdin and stdout (or via telnet if ACE is built in). The command syntax is a semi-colon separated list of commands with arbitrary number of parameters enclosed in parenthesis, with support for optional parameters and keyword arguments, i.e:
command1(arg1 arg2 arg3 :key1 val1 :key2 val2); command2(arg1 arg2 arg3 :key1 val1 :key2 val2)
The literals and operators of C are all supported except for the syntax of the conditional operator "?:". See the comterp documentation for more details.
All arguments to commands documented below are integers unless indicated by a suffix of str (which are strings embedded in quotes) or flt (which are conventional floating point numbers). "compview" is a graphical object assigned to an interpreter variable.
compview=rect(x0,y0,x1,y1) -- create a rectangle compview=rectangle(x0,y0,x1,y1) -- same as rect compview=line(x0,y0,x1,y1) -- create a line compview=arrowline(x0,y0,x1,y1) -- create line with arrows compview=ellipse(x0,y0,r1,r2) -- create a rectangle compview=text(x0,y0 textstr) -- create a text string compview=multiline(x0,y0[,x1,y1,...]) --
create a multiline
compview=arrowmultiline(x0,y0[,x1,y1,...]) --
create a multiline with arrows
compview=openspline(x0,y0[,x1,y1,...]) --
create an open spline
compview=arrowspline(x0,y0[,x1,y1,...]) --
create an open spline with arrows
compview=polygon(x0,y0[,x1,y1,...]) --
create a polygon
compview=closedspline(x0,y0[,x1,y1,...]) --
create a closed spline
compview=raster(x0,y0,x1,y1) --
create an empty raster
xylist=center(compview :xy :yx :x :y :scrn) -- center of compview (dflt :xy) rectlist=mbr(compview :lbrt :lrbt :scrn) -- minimum bounding rectangle of compview (dflt :lbrt) ptlist=points(compview) -- return point list from compview graphic
font(fontnum) -- set current font from menu brush(brushnum) -- set current brush from menu pattern(patternnum) --
set current pattern from menu
colors(fgcolornum bgcolornum) --
set current colors from menu
colorsrgb(fgcolornum bgcolornum) -- set current colors by RGB name. The colorname format is "#RGB" for 4 bits, "#RRGGBB" for 8 bits, #RRRGGGBBB for 12 bits, #RRRRGGGGBBBB for 16 bits
nfonts() -- return size of font menu nbrushes() -- return size of brush menu npatterns() -- return size of pattern menu ncolors() -- return size of color menus
select([compview ...] :all :clear) --
make these graphics the current selection
delete(compview [compview ...]) -- delete graphic(s) move(dx dy) -- move current selection scale(xflt yflt) -- scale current selection rotate(degflt) -- rotate current selection fliph() -- horizontally flip current selection flipv() -- vertically flip current selection
newgroup=growgroup(groupview compview) -- add graphic to existing group graphic newgroup=trimgroup(groupview compview) -- remove graphic from existing group graphic
compview=setattr(compview [:keyword value [:keyword value [...]]]) -- set attributes of a graphic component attrlist(compview) -- return attribute list of component compview=frame([index]) -- return composite component for a frame, defaults to current val=at(list|attrlist|compview n :set val :ins val) -- return (or set or insert after) the nth item in a list. num=size(list|attrlist|compview) -- return size of a list. compview=parent(compview) -- get parent of graphic
update() -- update viewer
error=save([pathstr]) -- command to save document (to pathname) compview=import(pathstr :popen :next) -- import graphic file from pathname or URL, or from a command if :popen (:next imports next in numeric series) export(compview[,compview[,...compview]] [path] :host host_str :port port_int :socket :string|:str :eps :idraw) -- remote in drawtool (or other) format compview=paste(compview [xscale yscale xoff yoff | a00,a01,a10,a11,a20,a21]) -- paste graphic into the viewer val=pastemode([val] :get) -- toggle or set paste mode, default is 0, always paste new graphics
ncols() -- onscreen horizontal extent in pixels nrows() -- onscreen vertical extent in pixels
dx,dy=stod(sx,sy) -- convert from screen to drawing coordinates sx,sy=dtos(dx,dy) -- convert from drawing to screen coordinates dx,dy=gtod(compview gx,gy) -- convert from graphic to drawing coordinates gx,gy=dtog(compview dx,dy) -- convert from drawing to graphic coordinates
handles(flag) --
enable/disable current selection tic marks and/or highlighting
highlight(compview compviewgs) -- set the highlight graphic state for a graphic
zoom(zoomflt) -- zoom by factor zoomin() -- zoom-in by 2 zoomout() -- zoom-out by 2
pan(px py) -- pan viewer smallpanup() -- small pan up smallpandown() -- small pan down smallpanleft() -- small pan left smallpanright() - small pan right largepanup() -- large pan up largepandown() -- large pan down largepanleft() -- large pan left largepanright() -- large pan right
gravity([flag]) -- set/get drawing editor gravity gridspacing([xsize ysize]) -- set/get drawing editor grid spacing
hide(compview) -- hide graphic component show(compview) -- show graphic component desensitize(compview) -- desensitize graphic component sensitize(compview) -- desensitize graphic component
tilefile(inpath outpath [xsize] [ysiz]) -- tile pgm or ppm image file val=peek(compview x y) -- peek pixel value into raster poke(compview x y val) -- poke pixel value into raster pokeline(compview x y vallist) -- poke list of values into a raster line. pcols(compview) -- number of columns in a raster pcols(compview) -- number of rows in a raster pflush(compview) -- flush pixels poked into a raster pclip(compview x1,y1,x2,y2,x3,y3[,...,xn,yn]) -- clip raster with polygon alpha(compview [alphaval]) -- set/get alpha transparency
-- requires plotmtv and pstoedit -- barplot([var_str value_float] [...] :title title_str :xtitle xtitle_str :ytitle ytitle_str :valtitle valtitle_str :newview) -- display a barplot
acknowledgebox(msgstr) -- popup an acknowledge dialog box confirmbox(msgstr) -- popup a confirmation dialog box, and return 1, 0, or -1 if cancelled
run(filename) -- run commands from file quit() -- quit this interpreter exit() -- exit entire application pause([msgstr] :usec num) -- pause script execution until C/R
-port n, specifies the port number to accept command interpreter connections on.
-import n, specifies the port number run the import service on. The import service accepts connections over the net and reads drawtool format data.
-stripped n, brings up a comdraw without any menubar, toolbar, panner, slider, or zoomer. It can be controlled via stdin or telnet if built with ACE.
-rampsize n, selects the rampsize used for gray-level image processing.
-theight n, (or "-th n") selects the automatic raster tiling height.
-twidth n, (or "-tw n") selects the automatic raster tiling width.
-tile, enables the automatic raster tiling.
Also see the -help message and the drawtool and idraw man pages for further options.
comterp, drawtool, idraw
http://www.ivtools.org/ivtools/comdraw.html