home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / PLOT / SURFUTI3.ZIP / SURFFILE.INC < prev    next >
Encoding:
Text File  |  1991-09-29  |  1.8 KB  |  56 lines

  1. procedure SURFFILE;
  2.  { read an old SURFMODL data file }
  3.  
  4. var
  5.    Firstnode, Lastnode:   integer;       { first, last node # in the solid }
  6.    Num:                   integer;       { #inputted vals on line }
  7.    Comment:               text80;        { comment at end of line }
  8.    Realvar:               vartype;       { genl. input array }
  9.    Scale:                 vector;        { scale factors }
  10.    Shift:                 vector;        { shift distances }
  11.    Rotate:                vector;        { rotation angles }
  12.    Filename:              text80;        { name of SURFMODL data file }
  13.  
  14. begin
  15.   Line_num := Line_num + 1;
  16.   readln (Infile, Filename);
  17.   if (In_version > 1) then begin
  18.     Line_num := Line_num + 1;
  19.     Num := inreal (Infile, Realvar, Comment, Line_num, FALSE);
  20.     if (Num <> 6) then begin
  21.       writeln ('Bad input for shifting or scaling (line ', Line_num, ')');
  22.       writeln ('Expecting 6 numeric entries');
  23.       close (Infile);
  24.       halt;
  25.     end;
  26.     Scale[1] := Realvar[1];
  27.     Scale[2] := Realvar[2];
  28.     Scale[3] := Realvar[3];
  29.     Shift[1] := Realvar[4];
  30.     Shift[2] := Realvar[5];
  31.     Shift[3] := Realvar[6];
  32.  
  33.     Line_num := Line_num + 1;
  34.     Num := inreal (Infile, Realvar, Comment, Line_num, FALSE);
  35.     if (Num <> 3) then begin
  36.       writeln ('Bad input for rotations (line ', Line_num, ')');
  37.       writeln ('Expecting 3 numeric entries');
  38.       close (Infile);
  39.       halt;
  40.     end;
  41.     Rotate[1] := Realvar[1];
  42.     Rotate[2] := Realvar[2];
  43.     Rotate[3] := Realvar[3];
  44.   end;
  45.  
  46.   Firstnode := Nnodes + 1;
  47.   readfile (Filename);
  48.   Lastnode := Nnodes;
  49.  
  50.   if (In_version > 1) then begin
  51.     rotatenodes (Firstnode, Lastnode, Rotate);
  52.     shiftnodes (Firstnode, Lastnode, Shift);
  53.     scalenodes (Firstnode, Lastnode, Scale);
  54.   end;
  55. end; { procedure SURFFILE }
  56.