-+-+-+-+-+-+-+-+ START OF PART 227 -+-+-+-+-+-+-+-+ X sns.integers`5Bi`5D = readintvalue(prom, PTKESTRUCTID); X `7D X parstruct(libid, &sns); X free(sns.integers); X`7D /* do_parstruct */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_parstructnet() X`7B X Pint i, libid; X Pintlst sns; X Pchar prom`5B50`5D; X X libid = readinteger("archive identifier ? "); X sns.number = readinteger("number of structure networks to archive ? "); X sns.integers = (Pint *)calloc(sns.number, sizeof(Pint)); X for (i = 0; i < sns.number; i++)`20 X `7B X sprintf(prom, "root structure identifier `5B%d`5D ? ", i); X sns.integers`5Bi`5D = readintvalue(prom, PTKESTRUCTID); X `7D X parstructnet(libid, &sns); X free(sns.integers); X`7D /* do_parstructnet */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pawaitevent() X`7B X Pevent event; X Pfloat timeout; X X timeout = readreal("time out (seconds) ? "); X pawaitevent(timeout, &event); X`7D /* do_pawaitevent */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pbuildtran() X`7B X Ppoint pt; X Pvector shift; X Pfloat angle; X Pvector scale; X Pint err; X X pt = readpoint("fixed point"); X shift = readvector("shift vector"); X angle = readreal("rotation angle ? "); X scale = readvector("scale vector"); X pbuildtran(&pt, &shift, angle, &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 writematrix(PTKEINFORM, tm); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_pbuildtran */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pbuildtran3() X`7B X Ppoint3 pt; X Pvector3 shift; X Pfloat xangle, yangle, zangle; X Pvector3 scale; X Pint err; X X pt = readpoint3("fixed point"); X shift = readvector3("shift vector"); X xangle = readreal("rotation angle x ? "); X yangle = readreal("rotation angle y ? "); X zangle = readreal("rotation angle z ? "); X scale = readvector3("scale vector"); X pbuildtran3(&pt, &shift, xangle, yangle, zangle, &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_pbuildtran3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pcellarray() X`7B X#ifdef SUN X Prect rect; X Pdim dim; X Pint colours`5B255`5D, i; X X rect.ll = readpoint("lower left of cell rectangle"); X rect.ur = readpoint("upper right of cell rectangle"); X dim.x_dim = readinteger("number of cell divisions, x ? "); X dim.y_dim = readinteger("number of cell divisions, y ? "); X for (i = 0; i < dim.y_dim; i++) X readintarray(dim.x_dim, &colours`5Bi * dim.x_dim`5D, "colour index",`20 X PTKECOLOURIND); X pcellarray(&rect, &dim, colours); X#endif X#ifdef VMS X phintererror(1, (Pchar *)NULL, INFORM); X#endif X`7D /* do_pcellarray */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pcellarray3() X`7B X#ifdef SUN X Ppoint3 pgram`5B3`5D; X Pdim dim; X Pint colours`5B255`5D, i; X X pgram`5B0`5D = readpoint3("parallelogram corner 1"); X pgram`5B1`5D = readpoint3("parallelogram corner 2"); X pgram`5B2`5D = readpoint3("parallelogram corner 3"); X dim.x_dim = readinteger("number of cell divisions, x ? "); X dim.y_dim = readinteger("number of cell divisions, y ? "); X for (i = 0; i < dim.y_dim; i++) X readintarray(dim.x_dim, &colours`5Bi * dim.x_dim`5D, "colour index",`20 X PTKECOLOURIND); X pcellarray3(pgram, &dim, colours); X#endif X#ifdef VMS X phintererror(1, (Pchar *)NULL, INFORM); X#endif X`7D /* do_pcellarray3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pchangestructid() X`7B X Pint old, new; X X old = readintvalue("old structure identifier ? ", PTKESTRUCTID); X new = readintvalue("new structure identifier ? ", PTKESTRUCTID); X pchangestructid(old, new); X`7D /* do_pchangestructid */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pchangestructidref() X`7B X Pint old, new; X X old = readintvalue("old structure identifier ? ", PTKESTRUCTID); X new = readintvalue("new structure identifier ? ", PTKESTRUCTID); X pchangestructidref(old, new); X`7D /* do_pchangestructidref */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pchangestructref() X`7B X Pint old, new; X X old = readintvalue("old structure identifier ? ", PTKESTRUCTID); X new = readintvalue("new structure identifier ? ", PTKESTRUCTID); X pchangestructref(old, new); X`7D /* do_pchangestructref */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pclosearfile() X`7B X Pint libid; X X libid = readinteger("archive identifier ? "); X pclosearfile(libid); X`7D /* do_pclosearfile */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pclosephigs() X`7B X pclosephigs(); X`7D /* do_pclosephigs */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pclosestruct() X`7B X pclosestruct(); X`7D /* do_pclosestruct */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pclosews() X`7B X Pint wsid; X X wsid = readinteger("workstation identifier ? "); X pclosews(wsid); X`7D /* do_pclosews */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pcomposematrix() X`7B X Pmatrix a, b; X Pint err; X X readmatrix(a, "matrix a"); X readmatrix(b, "matrix b"); X pcomposematrix(a, b, &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, "composed transformation matrix:\n"); X writematrix(PTKEINFORM, tm); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_pcomposematrix */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pcomposematrix3() X`7B X Pmatrix3 a, b; X Pint err; X X readmatrix3(a, "matrix a"); X readmatrix3(b, "matrix b"); X pcomposematrix3(a, b, &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, "composed transformation matrix:\n"); X writematrix3(PTKEINFORM, tm3); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_pcomposematrix3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pcomposetran() X`7B X Ppoint pt; X Pvector shift; X Pfloat angle; X Pvector scale; X Pint err; X Pmatrix matrix; X X readmatrix(matrix, "matrix"); X pt = readpoint("fixed point"); X shift = readvector("shift vector"); X angle = readreal("rotation angle ? "); X scale = readvector("scale vector"); X pcomposetran(matrix, &pt, &shift, angle, &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 writematrix(PTKEINFORM, tm); X `7D X else X phigserror(PTKEINFORM, err); X `7D X`7D /* do_pcomposetran */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pcomposetran3() X`7B X Ppoint3 pt; X Pvector3 shift; X Pfloat xangle, yangle, zangle; X Pvector3 scale; X Pint err; X Pmatrix3 matrix, tm3; X X readmatrix3(matrix, "matrix"); X pt = readpoint3("fixed point"); X shift = readvector3("shift vector"); X xangle = readreal("rotation angle x ? "); X yangle = readreal("rotation angle y ? "); X zangle = readreal("rotation angle z ? "); X scale = readvector3("scale vector"); X pcomposetran3(matrix, &pt, &shift, xangle, yangle, zangle, &scale,`20 X &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_pcomposetran3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pcopyallelemsstruct() X`7B X pcopyallelemsstruct(readintvalue("structure identifier to copy ? ",`20 X PTKESTRUCTID)); X`7D /* do_pcopyallelemsstruct */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pdelallstruct() X`7B X pdelallstruct(); X`7D /* do_pdelallstruct */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pdelallstructar() X`7B X pdelallstructar(readinteger("archive identifier ? ")); X`7D /* pdelallstructar */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pdelelem() X`7B X pdelelem(); X`7D /* do_pdelelem() */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pdelelemrange() X`7B X Pint e1, e2; X X e1 = readinteger("element to start ? "); X e2 = readinteger("element to finish ? "); X pdelelemrange(e1, e2); X`7D /* do_pdelelemrange */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pdelelemslabels() X`7B X Pint s1, s2; X X s1 = readintvalue("start label ? ", PTKELABELVAL); X s2 = readintvalue("finish label ? ", PTKELABELVAL); X pdelelemslabels(s1, s2); X`7D /* do_pdelelemslabels */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pdelstruct() X`7B X pdelstruct(readintvalue("structure identifier ? ", PTKESTRUCTID)); X`7D /* do_pdelstruct() */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pdelstructar() X`7B X Pint i, libid; X Pintlst sns; X Pchar prom`5B30`5D; X X libid = readinteger("archive identifier ? "); X sns.number = readinteger("number of structures to delete ? "); X sns.integers = (Pint *)calloc(sns.number, sizeof(Pint)); X for (i = 0; i < sns.number; i++)`20 X `7B X sprintf(prom, "structure identifier `5B%d`5D ? ", i); X sns.integers`5Bi`5D = readintvalue(prom, PTKESTRUCTID); X `7D X pdelstructar(libid, &sns); X free(sns.integers); X`7D /* do_pdelstructar */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pdelstructnet() X`7B X Pint delstid; X Preff refflag; X X delstid = readintvalue("root structure identifier ? ", PTKESTRUCTID); X refflag = readphigsenum(PTKEREFF, "reference handling flag ? "); X pdelstructnet(delstid, refflag); X`7D /* do_pdelstructnet */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pdelstructnetar() X`7B X Pint i, libid; X Pintlst sns; X Pchar prom`5B30`5D; X X libid = readinteger("archive identifier ? "); X sns.number = readinteger("number of structures to delete ? "); X sns.integers = (Pint *)calloc(sns.number, sizeof(Pint)); X for (i = 0; i < sns.number; i++)`20 X `7B X sprintf(prom, "structure identifier `5B%d`5D ? ", i); X sns.integers`5Bi`5D = readintvalue(prom, PTKESTRUCTID); X `7D X pdelstructnetar(libid, &sns); X free(sns.integers); X`7D /* do_pdelstructnetar */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pelemsrch() X`7B X#ifdef SUN X Pint stid, elptr; X Psrchdir dir; X Psrcheltypelst incl; X Psrcheltypelst excl; X Psrcheltype inclnames`5B255`5D; X Psrcheltype exclnames`5B255`5D; X Pint err, foundel; X Psrchstatus status; X X stid = readintvalue("structure identifier ? ", PTKESTRUCTID); X elptr = readinteger("starting element pointer ? "); X dir = readphigsenum(PTKESRCHDIR, "search direction ? "); X incl.elems = inclnames; X excl.elems = exclnames; X incl.number = readinteger("length of element inclusion set ? "); X readenumlist(incl.number, incl.elems, PTKESRCHELTYPE,`20 X "element inclusion set"); X excl.number = readinteger("length of element exclusion set ? "); X readenumlist(excl.number, excl.elems, PTKESRCHELTYPE,`20 X "element exclusion set"); X pelemsrch(stid, elptr, dir, &incl, &excl, &err, &status, &foundel); X if (writeinform) X `7B X phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist`5Bactivefunction`5D V); X if (err == 0) X `7B X phinprintf(PTKEINFORM, "search status = "); X writephigsenum(PTKEINFORM, PTKESRCHSTATUS, status); X phinprintf(PTKEINFORM, "element number = "); X writeinteger(PTKEINFORM, foundel); X `7D X else X phigserror(PTKEINFORM, err); X `7D`20 X#endif X#ifdef VMS X phintererror(1, (Pchar *)NULL, INFORM); X#endif X`7D /* do_pelemsrch */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pemergencyclosephigs() X`7B X pemergencyclosephigs(); X`7D /* do_pemergencyclosephigs */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_pemptystruct() X`7B X pemptystruct(readintvalue("structure identifier ? ", PTKESTRUCTID)); X`7D /* do_pemptystruct */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void do_perrorhand() X`7B +-+-+-+-+-+-+-+- END OF PART 227 +-+-+-+-+-+-+-+-