-+-+-+-+-+-+-+-+ START OF PART 228 -+-+-+-+-+-+-+-+ X Pint err_num, func_num; X Pchar err_file`5B32`5D; X X err_num = readinteger("error number ? "); X func_num = readinteger("function number ? "); X readstring(err_file, "error file name ? "); X perrorhand(err_num, func_num, err_file); X`7D /* do_perrorhand */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_perrorlog() X`7B X Pint err_num, func_num; X Pchar err_file`5B32`5D; X X err_num = readinteger("error number ? "); X func_num = readinteger("function number ? "); X readstring(err_file, "error file name ? "); X perrorlog(err_num, func_num, err_file); X`7D /* do_perrorlog */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pescape() X`7B X phintererror(3, (Pchar *)NULL, INFORM); X`7D /* do_pescape */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pevalviewmappingmatrix() X`7B X Pviewmapping mapping; X Pint err; X X mapping.window = readlimit("window limits"); X mapping.viewport = readlimit("viewport limits"); X pevalviewmappingmatrix(&mapping, &err, vmm); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "view mapping matrix:\n"); X writematrix(PTKEINFORM, vmm); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_pevalviewmappingmatrix */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pevalviewmappingmatrix3() X`7B X Pviewmapping3 mapping; X Pint err; X X mapping.window = readlimit("window limits"); X mapping.viewport = readlimit3("viewport limits"); X mapping.proj = readphigsenum(PTKEPROJTYPE, "projection type ? "); X mapping.prp = readpoint3("projection reference point"); X mapping.view_plane = readreal("view plane distance ? "); X mapping.back_plane = readreal("back plane distance ? "); X mapping.front_plane = readreal("front plane distance ? "); X pevalviewmappingmatrix3(&mapping, &err, vmm3); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "view mapping matrix:\n"); X writematrix3(PTKEINFORM, vmm3); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_pevalviewmappingmatrix3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pevalvieworientationmatrix() X`7B X Ppoint vrp; X Pvector vup; X Pint err; X X vrp = readpoint("view reference point"); X vup = readvector("view up vector"); X pevalvieworientationmatrix(&vrp, &vup, &err, vom); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "view orientation matrix:\n"); X writematrix(PTKEINFORM, vom); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_pevalvieworientationmatrix */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pevalvieworientationmatrix3() X`7B X Ppoint3 vrp; X Pvector3 vup, vpn; X Pint err; X X vrp = readpoint3("view reference point"); X vpn = readvector3("view plane normal"); X vup = readvector3("view up vector"); X pevalvieworientationmatrix3(&vrp, &vpn, &vup, &err, vom3); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "view orientation matrix:\n"); X writematrix3(PTKEINFORM, vom3); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_pevalvieworientationmatrix3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pexecutestruct() X`7B X pexecutestruct(readintvalue("structure identifier ? ", PTKESTRUCTID)); X`7D /* do_pexecutestruct */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pfillarea() X`7B X Pint numpts; X Ppoint *pts; X X numpts = readinteger("number of points ? "); X pts = (Ppoint *)calloc(numpts, sizeof(Ppoint)); X readpointarray(numpts, pts); X pfillarea(numpts, pts); X free(pts); X`7D /* do_pfillarea */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pfillarea3() X`7B X Pint numpts; X Ppoint3 *pts; X X numpts = readinteger("number of points ? "); X pts = (Ppoint3 *)calloc(numpts, sizeof(Ppoint3)); X readpoint3array(numpts, pts); X pfillarea3(numpts, pts); X free(pts); X`7D /* do_pfillarea3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pfillareaset() X`7B X Pint nb; X Pint i, totalpts; X Ppointlst *sets; X X nb = readinteger("number of sets? "); X sets = (Ppointlst *)calloc(nb, sizeof(Ppointlst)); `20 X for (i = 0; i < nb; i++) X `7B X readpointlst(&sets`5Bi`5D); X `7D X ptk_fillareaset(nb, sets); X for (i = 0; i < nb; i++) X `7B X free(sets`5Bi`5D.points); X `7D X free(sets); X`7D /* do_pfillareaset */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pfillareaset3() X`7B X Pint nb; X Pint i, totalpts; X Ppointlst3 *sets; X X nb = readinteger("number of sets? "); X sets = (Ppointlst3 *)calloc(nb, sizeof(Ppointlst3)); `20 X for (i = 0; i < nb; i++) X `7B X readpointlst3(&sets`5Bi`5D); X `7D X ptk_fillareaset3(nb, sets); X for (i = 0; i < nb; i++) X `7B X free(sets`5Bi`5D.points); X `7D X free(sets); X`7D /* do_pfillareaset3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pflushevents() X`7B X Pint ws, dev; X Pfclass class; X X ws = readinteger("workstation identifier ? "); X class = readphigsenum(PTKEFCLASS, "device class ? "); X dev = readinteger("input device number ? "); X pflushevents(ws, class, dev); X`7D /* do_pflushevents */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pgdp() X`7B X#ifdef SUN X Pint numpts, gdpid, i; X Ppoint pts`5B255`5D; X Pgdprec gdprec; X X numpts = readinteger("number of points ? "); X readpointarray(numpts, pts); X gdpid = readinteger("gdp function identifier ? "); X switch (gdpid) X `7B X case -1: X gdprec.ugdp1_datarec.n_sets = readinteger("number of sets ? "); X gdprec.ugdp1_datarec.sets =`20 X (Ppointlst *)calloc(gdprec.ugdp1_datarec.n_sets, sizeof(Ppointlst)); X for (i = 0; i < gdprec.ugdp1_datarec.n_sets; i++) X readpointlst(&gdprec.ugdp1_datarec.sets`5Bi`5D); X break; X X case -2: X gdprec.ugdp2_datarec.center = readpoint("circle centre"); X gdprec.ugdp2_datarec.radius = readreal("circle radius ? "); X break; X X case -3: X gdprec.ugdp3_datarec.center = readpoint("circle centre"); X gdprec.ugdp3_datarec.radius = readreal("circle radius ? "); X gdprec.ugdp3_datarec.st_ang = readreal("start angle ? "); X gdprec.ugdp3_datarec.end_ang = readreal("end angle ? "); X break; X X case -4: X gdprec.ugdp4_datarec.center = readpoint("circle centre"); X gdprec.ugdp4_datarec.radius = readreal("circle radius ? "); X gdprec.ugdp4_datarec.st_ang = readreal("start angle ? "); X gdprec.ugdp4_datarec.end_ang = readreal("end angle ? "); X gdprec.ugdp4_datarec.cls_type = readinteger("close type ? "); X break; X X case -5: X gdprec.ugdp5_datarec.center = readpoint("circle centre"); X gdprec.ugdp5_datarec.radius = readreal("circle radius ? "); X break; X X case -6: X gdprec.ugdp6_datarec.center = readpoint("circle centre"); X gdprec.ugdp6_datarec.radius = readreal("circle radius ? "); X gdprec.ugdp6_datarec.st_ang = readreal("start angle ? "); X gdprec.ugdp6_datarec.end_ang = readreal("end angle ? "); X break; X X case -7: X gdprec.ugdp7_datarec.center = readpoint("circle centre"); X gdprec.ugdp7_datarec.radius = readreal("circle radius ? "); X gdprec.ugdp7_datarec.st_ang = readreal("start angle ? "); X gdprec.ugdp7_datarec.end_ang = readreal("end angle ? "); X gdprec.ugdp7_datarec.cls_type = readinteger("close type ? "); X break; X X case -8: X gdprec.ugdp8_datarec.center = readpoint("ellipse centre"); X gdprec.ugdp8_datarec.major = readvector("major axis"); X gdprec.ugdp8_datarec.minor = readvector("minor axis"); X break; X X case -9: X gdprec.ugdp9_datarec.center = readpoint("ellipse centre"); X gdprec.ugdp9_datarec.major = readvector("major axis"); X gdprec.ugdp9_datarec.minor = readvector("minor axis"); X gdprec.ugdp9_datarec.st_ang = readreal("start angle ? "); X gdprec.ugdp9_datarec.end_ang = readreal("end angle ? "); X break; X X case -10: X gdprec.ugdp10_datarec.center = readpoint("ellipse centre"); X gdprec.ugdp10_datarec.major = readvector("major axis"); X gdprec.ugdp10_datarec.minor = readvector("minor axis"); X gdprec.ugdp10_datarec.st_ang = readreal("start angle ? "); X gdprec.ugdp10_datarec.end_ang = readreal("end angle ? "); X gdprec.ugdp10_datarec.cls_type = readinteger("close type ? "); X break; X X case -11: X gdprec.ugdp11_datarec.center = readpoint("ellipse centre"); X gdprec.ugdp11_datarec.major = readvector("major axis"); X gdprec.ugdp11_datarec.minor = readvector("minor axis"); X break; X X case -12: X gdprec.ugdp12_datarec.center = readpoint("ellipse centre"); X gdprec.ugdp12_datarec.major = readvector("major axis"); X gdprec.ugdp12_datarec.minor = readvector("minor axis"); X gdprec.ugdp12_datarec.st_ang = readreal("start angle ? "); X gdprec.ugdp12_datarec.end_ang = readreal("end angle ? "); X break; X X case -13: X gdprec.ugdp13_datarec.center = readpoint("ellipse centre"); X gdprec.ugdp13_datarec.major = readvector("major axis"); X gdprec.ugdp13_datarec.minor = readvector("minor axis"); X gdprec.ugdp13_datarec.st_ang = readreal("start angle ? "); X gdprec.ugdp13_datarec.end_ang = readreal("end angle ? "); X gdprec.ugdp13_datarec.cls_type = readinteger("close type ? "); X break; X X case -14: X break; X X `7D X pgdp(numpts, pts, gdpid, &gdprec); X#endif X#ifdef VMS X phintererror(1, (Pchar *)NULL, INFORM); X#endif X`7D /* do_pgdp */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pgdp3() X`7B X#ifdef SUN X phintererror(3, (Pchar *)NULL, INFORM); X#endif X#ifdef VMS X phintererror(1, (Pchar *)NULL, INFORM); X#endif X`7D /* do_pgdp3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pgse() X`7B X#ifdef SUN X phintererror(3, (Pchar *)NULL, INFORM); X#endif X#ifdef VMS X phintererror(1, (Pchar *)NULL, INFORM); X#endif X`7D /* do_pgse */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pgetchoice() X`7B X Pchoice choice; X X pgetchoice(&choice); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X phinprintf(PTKEINFORM, "status of request = "); X writephigsenum(PTKEINFORM, PTKECHOICESTATUS, choice.status); X if (choice.status == PCH_OK) X `7B X phinprintf(PTKEINFORM, "choice = "); X writeinteger(PTKEINFORM, choice.choice); X `7D X `7D X`7D /* do_pgetchoice */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pgettypemf() X`7B X phintererror(1, (Pchar *)NULL, INFORM); X`7D /* do_pgettypemf */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pgetloc() X`7B X Ploc loc; X X pgetloc(&loc); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X phinprintf(PTKEINFORM, "view index = "); X writeintvalue(PTKEINFORM, loc.view_index, PTKEVIEWIND); X phinprintf(PTKEINFORM, "point:\n"); X writepoint(PTKEINFORM, &loc.position); X `7D X`7D /* do_pgetloc */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pgetloc3() X`7B X Ploc3 loc; X X pgetloc3(&loc); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X phinprintf(PTKEINFORM, "view index = "); X writeintvalue(PTKEINFORM, loc.view_index, PTKEVIEWIND); X phinprintf(PTKEINFORM, "point:\n"); X writepoint3(PTKEINFORM, &loc.position); X `7D X`7D /* do_pgetloc3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pgetpick() X`7B X Pint depth; X Ppick pick; X X depth = readinteger("depth of pick path ? "); X pick.pick_path.pick_path = (Ppickpathel *)calloc(depth,`20 X sizeof(Ppickpathel)); X pick.pick_path.depth = depth; X pgetpick(depth, &pick); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X phinprintf(PTKEINFORM, "status of request"); X writephigsenum(PTKEINFORM, PTKEPICKSTATUS, pick.status); X if (pick.status == PP_OK) X `7B X phinprintf(PTKEINFORM, "pick path:\n"); X writepickpath(PTKEINFORM, &pick.pick_path);`20 X `7D X `7D X free(pick.pick_path.pick_path); X`7D /* do_pgetpick */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pgetstring() X`7B X Pint size; X Pchar *string; X X size = readinteger("size of string buffer ? "); X string = (Pchar *)malloc(size); X pgetstring(string); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X phinprintf(PTKEINFORM, "string = \"%s\"\n", string);`20 X `7D X free(string); `20 X`7D /* do_pgetstring */ X +-+-+-+-+-+-+-+- END OF PART 228 +-+-+-+-+-+-+-+-