;------------------------------------------------------------- ;+ ; NAME: ; IMGLINE ; PURPOSE: ; Interactive line on the screen. ; CATEGORY: ; CALLING SEQUENCE: ; imgline ; INPUTS: ; KEYWORD PARAMETERS: ; Keywords: ; P1=p1 Returned screen x,y of endpoint 1. ; P2=p2 Returned screen x,y of endpoint 2. ; LENGTH=len Returned line length. ; FACTOR=f Length conversion factor (def=1). ; COLOR=col Plot color. ; /INITIALIZE Initialize. ; /QUIET suppresses messages. ; OUTPUTS: ; COMMON BLOCKS: ; imgline_com ; NOTES: ; Notes: length is listed and returned in pixels unless ; over-ridden by FACTOR. ; MODIFICATION HISTORY: ; R. Sterner, 18 Mar, 1993 ; R. Sterner, 1998 Jan 15 --- Dropped use of !d.n_colors. ; ; Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory ; This software may be used, copied, or redistributed as long as it is not ; sold and this copyright notice is reproduced on each copy made. This ; routine is provided as is without any express or implied warranties ; whatsoever. Other limitations apply as described in the file disclaimer.txt. ;- ;------------------------------------------------------------- pro imgline, p1=p1, p2=p2, color=color, quiet=quiet, $ factor=fctr, help=hlp, length=length, initialize=init common imgline_com, xa, ya, xb, yb if keyword_set(hlp) then begin print,' Interactive line on the screen.' print,' imgline' print,' All args are keywords.' print,' Keywords:' print,' P1=p1 Returned screen x,y of endpoint 1.' print,' P2=p2 Returned screen x,y of endpoint 2.' print,' LENGTH=len Returned line length.' print,' FACTOR=f Length conversion factor (def=1).' print,' COLOR=col Plot color.' print,' /INITIALIZE Initialize.' print,' /QUIET suppresses messages.' print,' Notes: length is listed and returned in pixels unless' print,' over-ridden by FACTOR.' return endif for i=0,23 do print,' ' scrn = tvrd() ; Read screen image. if n_elements(color) eq 0 then color = !p.color if n_elements(fctr) eq 0 then fctr = 1. cflag = 1 ; Change flag. Start with yes. flag = 1 ; Active point flag (1=A, 2=B). ;-------------------------------- ; line has 2 points: A and B ;-------------------------------- ;--------- Initialize common ----------- if (n_elements(xa) eq 0) or keyword_set(init) then begin xsz = !d.x_size ; Screen size in x and y. ysz = !d.y_size xc = xsz/2 ; Center of screen. yc = ysz/2 r = .3*(xsz