-+-+-+-+-+-+-+-+ START OF PART 232 -+-+-+-+-+-+-+-+ X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_protatex() X`7B X Pfloat angle; X Pint err; X X angle = readreal("angle ? "); X protatex(angle, &err, tm3); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "transformation matrix:\n"); X writematrix3(PTKEINFORM, tm3); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_protatex */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_protatey() X`7B X Pfloat angle; X Pint err; X X angle = readreal("angle ? "); X protatey(angle, &err, tm3); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "transformation matrix:\n"); X writematrix3(PTKEINFORM, tm3); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_protatey */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_protatez() X`7B X Pfloat angle; X Pint err; X X angle = readreal("angle ? "); X protatez(angle, &err, tm3); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "transformation matrix:\n"); X writematrix3(PTKEINFORM, tm3); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_protatez */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_psamplechoice() X`7B X Pint wsid, dev; X Pchoice choice; X X wsid = readinteger("workstation identifier ? "); X dev = readinteger("choice device number ? "); X psamplechoice(wsid, dev, &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 `20 X`7D /* do_psamplechoice */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_psampleloc() X`7B X Pint wsid, dev; X Ploc loc; X X wsid = readinteger("workstation identifier ? "); X dev = readinteger("locator device number ? "); X psampleloc(wsid, dev, &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_psampleloc */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_psampleloc3() X`7B X Pint wsid, dev; X Ploc3 loc; X X wsid = readinteger("workstation identifier ? "); X dev = readinteger("locator device number ? "); X psampleloc3(wsid, dev, &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_psampleloc3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_psamplepick() X`7B X Pint wsid, dev, depth; X Ppick pick; X X wsid = readinteger("workstation identifier ? "); X dev = readinteger("pick device number ? "); X depth = readinteger("pick path depth ? "); X pick.pick_path.pick_path = (Ppickpathel *)calloc(depth,`20 X sizeof(Ppickpathel)); X pick.pick_path.depth = depth; X psamplepick(wsid, dev, 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_psamplepick */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_psamplestring() X`7B X Pint wsid, dev, size; X Pchar *string; X X wsid = readinteger("workstation identifier ? "); X dev = readinteger("string device number ? "); X size = readinteger("buffer size ? "); X string = (Pchar *)malloc(size); X psamplestring(wsid, dev, 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); X`7D /* do_psamplestring */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_psamplestroke() X`7B X Pint wsid, dev, size; X Pstroke stroke; X X wsid = readinteger("workstation identifier ? "); X dev = readinteger("stroke device number ? "); X size = readinteger("number of points in buffer ? "); X stroke.points = (Ppoint *)calloc(size, sizeof(Ppoint)); X psamplestroke(wsid, dev, &stroke); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X phinprintf(PTKEINFORM, "view index = "); X writeintvalue(PTKEINFORM, stroke.view_index, PTKEVIEWIND); X phinprintf(PTKEINFORM, "number of points = "); X writeinteger(PTKEINFORM, stroke.n_points); X phinprintf(PTKEINFORM, "points:\n"); X writepointarray(PTKEINFORM, stroke.n_points, X stroke.points); X `7D X free(stroke.points); X`7D /* do_psamplestroke */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_psamplestroke3() X`7B X Pint wsid, dev, size; X Pstroke3 stroke; X X wsid = readinteger("workstation identifier ? "); X dev = readinteger("stroke device number ? "); X size = readinteger("number of points in buffer ? "); X stroke.points = (Ppoint3 *)calloc(size, sizeof(Ppoint3)); X psamplestroke3(wsid, dev, &stroke); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X phinprintf(PTKEINFORM, "view index = "); X writeintvalue(PTKEINFORM, stroke.view_index, PTKEVIEWIND); X phinprintf(PTKEINFORM, "number of points = "); X writeinteger(PTKEINFORM, stroke.n_points); X phinprintf(PTKEINFORM, "points:\n"); X writepointarray3(PTKEINFORM, stroke.n_points, X stroke.points); X `7D X free(stroke.points); X`7D /* do_psamplestroke3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_psampleval() X`7B X Pint wsid, dev; X Pfloat val; X X wsid = readinteger("workstation identifier ? "); X dev = readinteger("valuator device number ? "); X psampleval(wsid, dev, &val); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X phinprintf(PTKEINFORM, "value = "); X writereal(PTKEINFORM, val); X `7D X`7D /* do_psampleval */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pscale() X`7B X Pvector scale; X Pint err; X X scale = readvector("scale vector"); X pscale(&scale, &err, tm); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "transformation matrix:\n"); X writematrix3(PTKEINFORM, tm); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_pscale */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pscale3() X`7B X Pvector3 scale; X Pint err; X X scale = readvector3("scale vector"); X pscale3(&scale, &err, tm3); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "transformation matrix:\n"); X writematrix3(PTKEINFORM, tm3); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_pscale3 */ X X/*-------------------------------------------------------------------------- V*/ X X#include "psetfns.c" X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_ptext() X`7B X Ppoint tp; X Pchar s`5B201`5D; X X tp = readpoint("text origin"); X readquote(s, "text string ? "); X ptext(&tp, s); X`7D /* do_ptext */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_ptext3() X`7B X Ppoint3 tp; X Pchar s`5B201`5D; X Pvector3 td`5B2`5D; X X tp = readpoint3("text origin"); X td`5B0`5D = readvector3("Reference point 1"); X td`5B1`5D = readvector3("Reference point 2"); X readquote(s, "text string ? "); X ptext3(&tp, td, s); X`7D /* do_ptext3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_ptranpt() X`7B X Ppoint pt, result; X Pmatrix matrix; X Pint err; X X pt = readpoint("point"); X readmatrix(matrix, "transformation matrix"); X ptranpt(&pt, matrix, &err, &result); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "transformed point:\n"); X writepoint(PTKEINFORM, &result); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_ptranpt */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_ptranpt3() X`7B X Ppoint3 pt, result; X Pmatrix3 matrix; X Pint err; X X pt = readpoint3("point"); X readmatrix3(matrix, "transformation matrix"); X ptranpt3(&pt, matrix, &err, &result); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "transformed point:\n"); X writepoint3(PTKEINFORM, &result); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_ptranpt3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_ptranslate() X`7B X Pvector transvector; X Pint err; X X transvector = readvector("translation vector"); X ptranslate(&transvector, &err, tm); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "transformation matrix:\n"); X writematrix(PTKEINFORM, tm); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_ptranslate */ X`20 X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_ptranslate3() X`7B X Pvector3 transvector; X Pint err; X X transvector = readvector3("translation vector"); X ptranslate3(&transvector, &err, tm3); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "transformation matrix:\n"); X writematrix3(PTKEINFORM, tm3); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_ptranslate3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_punpostallstruct() X`7B X Pint wsid; X X wsid = readinteger("workstation identifier ? "); X punpostallstruct(wsid); X`7D /* do_punpostallstruct */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_punpoststruct() X`7B X Pint ws_no, s_name; X X ws_no = readinteger("workstation identifier ? "); X s_name = readintvalue("structure identifier ? ", PTKESTRUCTID); X punpoststruct(ws_no, s_name); X`7D /* do_punpoststruct */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pupdatews() X`7B X Pint wsid; X Pregen reg; X X wsid = readinteger("workstation identifier ? "); X reg = readphigsenum(PTKEREGEN, "regen flag (PPOSTPONE/PPERFORM) ? "); X pupdatews(wsid, reg); X`7D /* do_pupdatews */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pwritemf() X`7B X phintererror(1, (Pchar *)NULL, INFORM); X`7D /* do_pwritemf */ X X/*-------------------------------------------------------------------------- V*/ X/*------------------------- phinter functions ------------------------------ V*/ X/*-------------------------------------------------------------------------- V*/ X Xstatic void process_phigs_function(C(ptkephigsnames) phigsname) XPreANSI(ptkephigsnames phigsname) X/* X** description:`20 X** input params:`20 X** output params:`20 X** return value:`20 X*/ X`7B X /* This routine processes the PHIGS function whose namelist index is l */ X /* write out the function name onto an output script if required */ X if (writingscript) X phinprintf(PTKEOUTPUT, "%s\n", phigsnamelist`5B(Pint)phigsname`5D); X activefunction = (Pint)phigsname; X switch (phigsname)`20 X `7B X case PTKEADDNAMESET: do_paddnameset(); X break; X `20 X case PTKEANNOTATIONTEXTRELATIVE: do_pannotationtextrelative(); X break; X `20 X case PTKEANNOTATIONTEXTRELATIVE3: do_pannotationtextrelative3(); X break; X `20 X case PTKEAPPLICATIONDATA: do_papplicationdata(); X break; X `20 X case PTKEARALLSTRUCT: do_parallstruct(); X break; X `20 X case PTKEARSTRUCT: do_parstruct(); X break; X `20 +-+-+-+-+-+-+-+- END OF PART 232 +-+-+-+-+-+-+-+-