program da3drotate(da3dp, da3drotatep, output); (* da3drotate: rotate the da3dp scene Tom Schneider NCI/FCRDC Bldg 469. Room 144 P.O. Box B Frederick, MD 21702-1201 (301) 846-5581 (-5532 for messages) toms@ncifcrf.gov http://www-lmmb.ncifcrf.gov/~toms/ National Cancer Institute Laboratory of Mathematical Biology *) label 1; (* end of program *) const (* begin module version *) version = 1.03; (* of da3drotate.p 1996 October 3 origin 1995 November 14 *) (* end module version *) (* begin module describe.da3drotate *) (* name da3drotate: da3drotate the da3dp scene synopsis da3drotate(da3dp: inout, da3drotatep: out, output: out) files da3dp: parameter file for program da3d. da3drotatep: parameters to control this file first line: angle of rotation (positive or negative degrees) output: messages to the user description The program reads da3dp and rewrites it according to the da3drotatep. examples documentation see also da3d.p author Thomas Dana Schneider bugs technical notes The program is to be called repeatedly by a shell script so that the scene is rebuilt continuously. *) (* end module describe.da3drotate *) (* begin module da3drotate.const *) pi = 3.14159265354; (* circumference divided by diameter of circle *) picfield = 20; (* width of numbers printed to the file *) picwidth = 5; (* number of decimal places for numbers *) (* end module da3drotate (@ taken from dops.p 2.63 1991 November 2 *) var da3dp, (* file used by this program *) da3drotatep: text; (* file used by this program *) (* begin module halt *) procedure halt; (* stop the program. the procedure performs a goto to the end of the program. you must have a label: label 1; declared, and also the end of the program must have this label: 1: end. examples are in the module libraries. this is the only goto in the delila system. *) begin writeln(output,' program halt.'); goto 1 end; (* end module halt version = 'delmod 6.16 84 mar 12 tds/gds'; *) (* begin module da3drotate.themain *) procedure themain(var da3dp, da3drotatep: text); (* the main procedure of the program *) var currentangle: real; (* current angle of x,y from origin *) deltaangle: real; (* change in angle to rotate *) distance: real; (* distance of x,y from origin *) {zzz} dd: char; (* character for reading value for setting dodiagonal *) dodiagonal: boolean; (* do the diagonal in the graph *) { fromrange, torange: integer; (* range of the data *) } magnify: real; (* factor by which to magnify the scene *) xmagnify: real; (* factor by which to magnify zscale *) ymagnify: real; (* factor by which to magnify zscale *) zmagnify: real; (* factor by which to magnify zscale *) xlocation: real; (* x location *) ylocation: real; (* y location *) zlocation: real; (* z location *) datacolumn: integer; (* column of da to use *) horizontal: real; (* zero coordinate of screen in cm *) vertical: real; (* zero coordinate of screen in cm *) { cmperinch: real; (* conversion factor from cm to inches *) } procedure readda3d(var f: text); begin (* obtain parameters *) readln(f,horizontal); readln(f,vertical); readln(f,xlocation); readln(f,ylocation); readln(f,zlocation); readln(f,magnify); readln(f,xmagnify); readln(f,ymagnify); readln(f,zmagnify); readln(f,datacolumn); if (datacolumn <= 4) or (datacolumn > 15) then begin writeln(output,'data column must be >4 and < 16'); halt end; readln(f,dd); dodiagonal := (dd = 't'); end; procedure writeda3d(var f: text); begin (* obtain parameters *) writeln(f,horizontal:picfield:picwidth,' horizontal adjust (cm)'); writeln(f,vertical:picfield:picwidth,' vertical adjust (cm)'); writeln(f,xlocation:picfield:picwidth,' xlocation (bases)'); writeln(f,ylocation:picfield:picwidth,' ylocation (bases)'); writeln(f,zlocation:picfield:picwidth,' zlocation (bases)'); writeln(f,magnify:picfield:picwidth,' magnify'); writeln(f,xmagnify:picfield:picwidth,' xmagnify'); writeln(f,ymagnify:picfield:picwidth,' ymagnify'); writeln(f,zmagnify:picfield:picwidth,' zmagnify'); writeln(f,datacolumn:picfield,' data column'); if (datacolumn <= 4) or (datacolumn > 15) then begin writeln(output,'data column must be >4 and < 16'); halt end; writeln(f,dd, ' dodiagonal'); end; begin writeln(output,'da3drotate ',version:4:2); reset(da3drotatep); readln(da3drotatep,deltaangle); (* convert deltaangle to radians from degrees *) deltaangle := deltaangle * (pi / 180); (* read in the da3dp *) reset(da3dp); readda3d(da3dp); distance := sqrt(xlocation*xlocation + ylocation*ylocation); if xlocation <> 0 then currentangle := arctan(ylocation/xlocation) else currentangle := pi/2.0; currentangle := deltaangle + currentangle; xlocation := distance * cos(currentangle); ylocation := distance * sin(currentangle); rewrite(da3dp); writeda3d(da3dp); end; (* end module da3drotate.themain *) begin themain(da3dp, da3drotatep); 1: end.