-+-+-+-+-+-+-+-+ START OF PART 281 -+-+-+-+-+-+-+-+ XPreANSI(Pprojtype proj) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPprojtype`7D`7Bproj`7D`7Bcamera projection type`7D`7BIN`7D X** \paramend`20 X** \blurb`7BThis function sets the projection type of the view given by the X** camera to PARALLEL or PERSPECTIVE. The default is PARALLEL.`7D X*/ X`7B X setwindow(windid); X if (windptr != NULL) X `7B X windptr->cameraproj = proj; X updatecamera(); X `7D X`7D /* ptk_setcameraprojtype */ X `20 X/*-------------------------------------------------------------------------- V*/ X `20 X/*function:external*/ Xextern void ptk_setcamerastate(C(Pint) windid,`20 X C(ptkecamerastate) cameraswitch) XPreANSI(Pint windid) XPreANSI(ptkecamerastate cameraswitch) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7Bptkecamerastate`7D`7Bcameraswitch`7D`7Bcamera on or off`7D`7BIN` V7D X** \paramend`20 X** \blurb`7BThis function sets the camera of the window `7B\tt windid`7D X** to ON or OFF. The default is ON.`7D X*/ X`7B X setwindow(windid); X if (windptr != NULL) X `7B X windptr->cameraswitch = cameraswitch; X updatewindowview(); X `7D X`7D /* ptk_setcamerastate */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_setcameraworld(C(Pint) windid, C(Pintlst *) stids) XPreANSI(Pint windid) XPreANSI(Pintlst *stids) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPintlst *`7D`7Bstids`7D`7Bstructure identifier list`7D`7BIN`7D X** \paramend`20 X** \blurb`7BThis function sets the view volume of the camera so`20 X** that it contains the combined bounding box of all the`20 X** structures and structure networks in `7B\tt stids`7D.`7D X*/ X`7B X Pint i; X Plimit3 cameraworld, stlimits; X X setwindow(windid); X if (windptr != NULL) X `7B X cameraworld = ptk_limit3(100.0, -100.0, 100.0, -100.0, 100.0, -100.0); X for (i = 0; i < stids->number; i++) X `7B X if (ptk_boundingbox(stids->integers`5Bi`5D, &stlimits, TRUE)) X `7B X if (stlimits.xmin < cameraworld.xmin) X cameraworld.xmin = stlimits.xmin; X if (stlimits.ymin < cameraworld.ymin) X cameraworld.ymin = stlimits.ymin; X if (stlimits.zmin < cameraworld.zmin) X cameraworld.zmin = stlimits.zmin; X if (stlimits.xmax > cameraworld.xmax) X cameraworld.xmax = stlimits.xmax; X if (stlimits.ymax > cameraworld.ymax) X cameraworld.ymax = stlimits.ymax; X if (stlimits.zmax > cameraworld.zmax) X cameraworld.zmax = stlimits.zmax; X `7D X `7D X evalviewvolume(&cameraworld, TRUE); X updatecamera(); X `7D X`7D /* ptk_setcameraworld */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_setcameralimits(C(Pint) windid, C(Plimit3 *) limits, X C(ptkboolean) adjust) XPreANSI(Pint windid) XPreANSI(Plimit3 *limits) XPreANSI(ptkboolean adjust) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPlimit3 *`7D`7Blimits`7D`7Bcamera viewing limits in WC`7D`7BIN`7 VD X** \param`7Bptkboolean`7D`7Badjust`7D`7Badjust given limits`7D`7BIN`7D X** \paramend`20 X** \blurb`7BThis function sets the view volume of the camera X** to the specified bounding box given in World Coordinates. If`20 X** `7B\tt adjust`7D is set to TRUE then the bounding box will be adjusted`20 X** to be the bounding box of a sphere which encloses the original box.`7D X*/ X`7B X Pint i; X X setwindow(windid); X if (windptr != NULL) X `7B X evalviewvolume(limits, adjust); X updatecamera(); X `7D X`7D /* ptk_setcameralimits */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_resetcamera(C(Pint) windid) XPreANSI(Pint windid) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \paramend`20 X** \blurb`7BThis function resets the camera variables to their default X** values. The camera view volume is left unchanged.`7D X*/ X`7B X Pint i; X X setwindow(windid); X if (windptr != NULL) X `7B X windptr->position = ptk_point3(0.5, 0.5, 2.0); X windptr->ptinterest = ptk_point3(0.5, 0.5, 0.5); X windptr->positionaxis = ptk_point3(0.0, 1.0, 0.0); X windptr->ptinterestaxis = ptk_point3(0.0, 1.0, 0.0); X windptr->lastvpn = ptk_point3(0.0, 0.0, 1.0); X windptr->lastvup = ptk_point3(0.0, 1.0, 0.0); X windptr->xaxis = ptk_point3(1.0, 0.0, 0.0); X windptr->yaxis = ptk_point3(0.0, 1.0, 0.0); X windptr->swivelangle = windptr->spinangle =`20 X windptr->twistangle = 0.0; X windptr->cameraproj = PPARALLEL; X if (windptr->cameraswitch == PTKECAMERAON) X updatecamera(); X `7D X`7D /* ptk_resetcamera */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqcameraposition(C(Pint) windid, C(Ppoint3 *) position, X C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(Ppoint3 *position) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPpoint3 *`7D`7Bposition`7D`7Bcamera position`7D`7BOUT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the camera position in X** World Coordinates. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X *position = windptr->position; X else X *err = 1; X`7D /* ptk_inqcameraposition */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqcameraptinterest(C(Pint) windid, C(Ppoint3 *) ptinterest, X C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(Ppoint3 *ptinterest) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPpoint3 *`7D`7Bptinterest`7D`7Bcamera point of interest`7D`7BOUT V`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the camera point of interest X** in World Coordinates. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X *ptinterest = windptr->ptinterest; X else X *err = 1; X`7D /* ptk_inqcameraptinterest */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqcameraprojtype(C(Pint) windid, C(Pprojtype *) projtype, X C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(Pprojtype *projtype) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPprojtype *`7D`7Bprojtype`7D`7Bcamera projection type`7D`7BOUT`7 VD X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the camera view projection X** type which is either PARALLEL or PERSPECTIVE. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X *projtype = windptr->proj; X else X *err = 1; X`7D /* ptk_inqcameraprojtype */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqcamerastate(C(Pint) windid,`20 X C(ptkecamerastate *) cameraswitch, C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(ptkecamerastate *cameraswitch) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7Bptkecamerastate *`7D`7Bcameraswitch`7D`7Bcamera ON/OFF switch`7D V`7BOUT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the camera state which is X** either ON or OFF. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X *cameraswitch = windptr->cameraswitch; X else X *err = 1; X`7D /* ptk_inqcamerastate */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqcameralimits(C(Pint) windid, C(Plimit3 *) limits, X C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(Plimit3 *limits) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPlimit3 *`7D`7Blimits`7D`7Bcamera world limits`7D`7BOUT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the camera view volume. X** This defines the volume of a scene that the camera knows about X** and is returned in World Coordinates. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X `7B X *limits = ptk_limit3(windptr->ptinterest.x - windptr->viewvolume.x / 2.0 V, X windptr->ptinterest.x + windptr->viewvolume.x / 2.0, X windptr->ptinterest.y - windptr->viewvolume.y / 2.0, X windptr->ptinterest.y + windptr->viewvolume.y / 2.0, X windptr->ptinterest.z - windptr->viewvolume.z / 2.0, X windptr->ptinterest.z + windptr->viewvolume.z / 2.0); X `7D X else X *err = 1; X`7D /* ptk_inqcameralimits */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqpositionaxis(C(Pint) windid, C(Ppoint3 *) axis, X C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(Ppoint3 *axis) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPpoint3 *`7D`7Baxis`7D`7Bcamera position axis of rotation`7D`7BO VUT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the axis of rotation X** which is used to rotate the camera position in the function X** `7B\tt ptk\_rotatecameraposition`7D. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X *axis = windptr->positionaxis; X else X *err = 1; X`7D /* ptk_inqpositionaxis */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqptinterestaxis(C(Pint) windid, C(Ppoint3 *) axis, X C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(Ppoint3 *axis) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPpoint3 *`7D`7Baxis`7D`7Bcamera point of interest axis of rotati Von`7D`7BOUT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the axis of rotation X** which is used to rotate the camera point of interest in the function X** `7B\tt ptk\_rotatecameraptinterest`7D. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X *axis = windptr->ptinterestaxis; X else X *err = 1; X`7D /* ptk_inqptinterestaxis */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqwindowviewrep(C(Pint) windid, C(Pviewrep3 *) rep, X C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(Pviewrep3 *rep) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPviewrep3 *`7D`7Brep`7D`7Bwindow view representation`7D`7BOUT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the viewing parameters X** which are used to set the window view when the camera is switched X** OFF. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X Pviewmapping3 vmap; X X *err = 0; X setwindow(windid); X if (windptr != NULL) X `7B X ptk_pevalvieworientationmatrix3(&windptr->vrp, &windptr->vpn,`20 X &windptr->vup, err, rep->orientation_matrix); X vmap.viewport = windptr->viewport; X vmap.window = windptr->window; X vmap.proj = windptr->proj; X vmap.prp = windptr->prp; X vmap.view_plane = windptr->viewplane; X vmap.front_plane = windptr->frontplane; X vmap.back_plane = windptr->backplane; X pevalviewmappingmatrix3(&vmap, err, rep->mapping_matrix); X rep->clip_limit = windptr->cliplimit; X rep->clip_xy = windptr->clipxy; X rep->clip_back = windptr->clipback; X rep->clip_front = windptr->clipfront; X `7D X else X *err = 1; X`7D /* ptk_inqwindowviewrep */ X X/*-------------------------------------------------------------------------- V*/ X/*------------------------ Viewing functions ------------------------------- V*/ X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_setvieworientation3(C(Pint) windid, C(Ppoint3 *) vrp,`20 X C(Ppoint3 *) vpn, C(Ppoint3 *) vup, C(Pint *) error) XPreANSI(Pint windid) XPreANSI(Ppoint3 *vrp) XPreANSI(Ppoint3 *vpn) XPreANSI(Ppoint3 *vup) XPreANSI(Pint *error) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPpoint3 *`7D`7Bvrp`7D`7Bview reference point`7D`7BIN`7D X** \param`7BPpoint3 *`7D`7Bvpn`7D`7Bview plane normal`7D`7BIN`7D X** \param`7BPpoint3 *`7D`7Bvup`7D`7Bview up vector`7D`7BIN`7D X** \param`7BPint *`7D`7Berror`7D`7Berror indicator`7D`7BOUT`7D X** \paramend`20 X** \blurb`7BThis function sets the window view orientation values.`20 +-+-+-+-+-+-+-+- END OF PART 281 +-+-+-+-+-+-+-+-