00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef __CamDispc__h
00043 #define __CamDispc__h
00044
00045 #ifndef EXTERN
00046 #ifdef _DVS_
00047 #define EXTERN
00048 #else
00049 #define EXTERN extern
00050 #endif
00051 #endif
00052
00053 #include <stdio.h>
00054
00055 #ifndef __double_real
00056 #define __double_real
00057 typedef double real;
00058 #endif
00059 #ifndef __double_vector
00060 #define __double_vector
00061 typedef real vector[4];
00062 #endif
00063 #ifndef __double_vect2
00064 #define __double_vect2
00065 typedef real vect2[3];
00066 #endif
00067 #ifndef __double_matrix
00068 #define __double_matrix
00069 typedef real matrix[4][4];
00070 #endif
00071 #ifndef __struct_solid
00072 #define __struct_solid
00073 typedef struct solid STYPE;
00074 #endif
00075 #ifndef __struct_face
00076 #define __struct_face
00077 typedef struct face FTYPE;
00078 #endif
00079 #ifndef __struct_edge
00080 #define __struct_edge
00081 typedef struct edge ETYPE;
00082 #endif
00083 #ifndef __struct_halfedge
00084 #define __struct_halfedge
00085 typedef struct halfedge HTYPE;
00086 #endif
00087 #ifndef __struct_grouptp
00088 #define __struct_grouptp
00089 typedef struct grouptp GTYPE;
00090 #endif
00091 #ifndef __struct_box
00092 #define __struct_box
00093 typedef struct box BTYPE;
00094 #endif
00095 #ifndef __struct_cameratp
00096 #define __struct_cameratp
00097 typedef struct cameratp CTYPE;
00098 #endif
00099
00100 EXTERN int MAX_COLOR_NUMBER;
00101
00102 struct cameratp
00103 {
00104 Id cn;
00105 char cname[18];
00106 vector eye;
00107 vector ref;
00108 vector eyedir;
00109 real scale;
00110 real cdis;
00111 int hid;
00112 int dash;
00113 int smooth;
00114 int mode;
00115 matrix drot;
00116 CTYPE *nxt;
00117 };
00118
00119 typedef struct
00120 {
00121 vector devtx;
00122 char devis;
00123 } DEDGTYPE;
00124
00125 EXTERN DEDGTYPE *divedge;
00126 EXTERN DEDGTYPE *divedptr;
00127 EXTERN int divednum;
00128 EXTERN vector desvtx;
00129 EXTERN vector deevtx;
00130 EXTERN BTYPE debox;
00131
00132 EXTERN int Draw;
00133 EXTERN int NumCinema;
00134 EXTERN FILE *dspfwptr;
00135 EXTERN FILE *dspfrptr;
00136 EXTERN int breakflg;
00137 EXTERN real abseps;
00138 EXTERN real xyratio;
00139 EXTERN CTYPE camera3;
00140 EXTERN CTYPE *camary;
00141 EXTERN CTYPE *camptr;
00142 EXTERN int camused;
00143 EXTERN real angsmooth;
00144 EXTERN char monisw;
00145 EXTERN CTYPE *monicptr;
00146
00147 EXTERN int defltcol;
00148 EXTERN int framecol;
00149 EXTERN int lncolor;
00150 EXTERN int lntype;
00151
00152
00153 int MSD_highAlteraCurrentCamera(char opt, real Ex, real Ey, real Ez,
00154 real Rx, real Ry, real Rz, real scale,
00155 int mode, int hidtype, int dash, int smooth);
00156
00157
00158 int MSD_highNameAlteraCamera(char opt, char *name, real Ex, real Ey,
00159 real Ez, real Rx, real Ry, real Rz,
00160 real scale, int mode, int hidtype, int dash,
00161 int smooth);
00162 int MSD_highAlteraCamera(char opt, Id cn, real Ex, real Ey, real Ez,
00163 real Rx, real Ry, real Rz, real scale,
00164 int mode, int hidtype, int dash, int smooth);
00165 int MSD_lowAlteraCamera(char opt, CTYPE *cptr, real Ex, real Ey,
00166 real Ez, real Rx, real Ry, real Rz,
00167 real scale, int mode, int hidtype, int dash,
00168 int smooth);
00169
00170
00171 int MSD_highCheckCamera(real, real, real, real, real, real, real, int,
00172 int, int, int);
00173 int MSD_lowCheckCamera(vector, vector, real, int, int, int, int);
00174 void MSD_highSetCamera(CTYPE *, real, real, real, real, real, real,
00175 real, int, int, int, int);
00176 void MSD_lowSetCamera(CTYPE *, vector, vector, real, int, int, int, int);
00177 void MSD_lowSetCameraTransformation(CTYPE *cptr);
00178 void MSD_lowSetCamera3View(int type, CTYPE *cptr);
00179
00180
00181
00182 void MSD_execNameCopyCamera(void);
00183 int MSD_highNameCopyCamera(char *name1, char *name2);
00184 void MSD_execCopyCamera(void);
00185 int MSD_highCopyCamera(int cn);
00186 int MSD_lowCopyCamera(CTYPE *cptr, Id cn);
00187
00188
00189 void MSD_execGetCurrentCameraParameters(void);
00190 int MSD_getCurrentCameraParameters(real *Ex, real *Ey, real *Ez,
00191 real *Rx, real *Ry, real *Rz,
00192 real *ampl, int *mode, int *elim,
00193 int *hash, int *edge);
00194
00195
00196 void MSD_execNameListCameraName(void);
00197 int MSD_highNameListCameraName(char *name);
00198 int MSD_lowNameListCameraName(CTYPE *cptr);
00199 void MSD_lowListAllCamera(void);
00200 void MSD_lowListAllCameraName(void);
00201
00202
00203 int MSD_getNumberOfCameras(void);
00204 char **MSD_putCameraNameInList(char **list);
00205 CTYPE *MSD_getCamera(Id cn);
00206 Id MSD_getCameraIdFromName(char *nam);
00207 CTYPE *MSD_lowFindCameraByName(char *nam);
00208 CTYPE *MSD_lowFindCamera(Id cn);
00209 Id MSD_getMaxCameraId(void);
00210
00211
00212 void MSD_execNameCreateCamera(void);
00213 int MSD_highNameCreateCamera(char *name, real Ex, real Ey, real Ez,
00214 real Rx, real Ry, real Rz, real scale,
00215 int mode, int hidtype, int dash, int smooth);
00216 void MSD_execCreateCamera(void);
00217 int MSD_highCreateCamera(real Ex, real Ey, real Ez,
00218 real Rx, real Ry, real Rz, real scale,
00219 int mode, int hidtype, int dash, int smooth);
00220 int MSD_middleCreateCamera(int cn, real Ex, real Ey, real Ez, real Rx,
00221 real Ry, real Rz, real scale, int mode,
00222 int hidtype, int dash, int smooth);
00223 CTYPE *MSD_lowCreateCamera(Id cn, real Ex, real Ey, real Ez,
00224 real Rx, real Ry, real Rz, real scale,
00225 int mode, int hidtype, int dash, int smooth);
00226
00227
00228 void MSD_execNameRemoveCamera(void);
00229 int MSD_highNameRemoveCamera(char *name);
00230 void MSD_execRemoveCamera(void);
00231 int MSD_highRemoveCamera(Id cn);
00232 int MSD_lowRemoveCamera(CTYPE *cptr);
00233
00234
00235 void MSD_execNameRenameCamera(void);
00236 int MSD_highNameRenameCamera(char *name1, char *name2);
00237 int MSD_lowNameRenameCamera(CTYPE *cptr, char *name2);
00238
00239
00240 void MSD_execNameSetCurrentCamera(void);
00241 int MSD_highNameSetCurrentCamera(char *name);
00242 void MSD_execSetCurrentCamera(void);
00243 int MSD_highSetCurrentCamera(Id cn);
00244 int MSD_lowSetCurrentCamera(CTYPE *cptr);
00245
00246
00247 void MSD_execTranslateCurrentCamera(void);
00248 void MSD_lowTranslateCurrentCamera(real dEx, real dEy, real dEz);
00249
00250
00251 #if !defined (__UNIX_) && !defined (_Windows)
00252 void MSD_lowSetBreakInterruption(void);
00253 void interrupt far MSD_lowBreakFunction(...);
00254 void MSD_lowSetBreakResident(void);
00255
00256 #endif
00257
00258
00259 void MSD_execCamera(void);
00260
00261
00262 void MSD_execDisplayCoordinates(void);
00263 int MSD_highDisplayCoordinates(int opt, int dir, real dis, real l, real dl, int acolor, int mcolor);
00264 int MSD_lowDisplayAxis(real len, int acolor);
00265 int MSD_lowDisplayMesh(int dir, real dis, real len, real dl, int acolor, int mcolor);
00266 void MSD_lowDisplayLineCoordinates(int lt, vector sv, vector ev);
00267
00268
00269 void MSD_execColor(void);
00270 int MSD_lowSetFrameColor(int color);
00271 int MSD_lowSetDefaultColor(int color);
00272 int MSD_lowGetIntersectionColor(SPTYPE o1ptr, SPTYPE o2ptr);
00273 int MSD_lowGetSolidColor(SPTYPE optr);
00274
00275
00276 void MSD_execDisplay(void);
00277 int MSD_highNameDisplay(char *cname, char *olist);
00278 int MSD_highNameSetDisplay(char *oname);
00279 void MSD_highDisplayAllEdges(void);
00280 void MSD_lowDisplayAllEdges(void);
00281 void MSD_highDisplayLocalHidden(void);
00282 void MSD_lowDisplayLocalHidden(CTYPE *cptr);
00283 void MSD_lowDisplayLine(int l, vector sv, vector ev);
00284 void MSD_lowDisplayVertex(int l, vector v);
00285
00286
00287 void MSD_execDisplayFile(void);
00288 int MSD_highDisplayFile(char rw, char *fname);
00289 int MSD_lowDisplayReadFile(char *fname);
00290 int MSD_lowDisplayWriteFile(char *fname);
00291
00292
00293 int MSD_lowClip3Dimension(vector v1, vector v2);
00294 int MSD_lowCheckClipDisplay(vector t1, vector t2);
00295 int MSD_lowClipingPlane(vector v1, vector v2, vector normal, real d);
00296 void MSD_lowDetermineVisibility(CTYPE *cptr);
00297 void MSD_lowEdgeClip(EPTYPE eptr);
00298
00299
00300 void MSD_execDisplayEdge(void);
00301 void MSD_highDisplayEdge(Id s, Id e, int color);
00302 void MSD_lowDisplayEdge(EPTYPE eptr, int color);
00303
00304
00305 void MSD_lowEdgeEdgeIntersection(SPTYPE optr, EPTYPE eptr, FPTYPE f1ptr, FPTYPE f2ptr);
00306
00307 int MSD_lowEdgeEdgeCheck(SPTYPE xoptr, SPTYPE optr, EPTYPE xeptr, EPTYPE eptr, \
00308 real sbox[][2], FPTYPE f1ptr, FPTYPE f2ptr);
00309 int MSD_lowEdgeEdgeCheckStep2(vector a1, vector a2, vector b1, vector b2, real *u, real *v);
00310 int MSD_lowEdgeEdgeCheckStep3(vector s0, vector s1, vector v0, vector v1, real u, vector p);
00311 void MSD_lowEdgeFaceIntersection(SPTYPE o1ptr, SPTYPE o2ptr, FPTYPE f1ptr, FPTYPE f2ptr);
00312 void MSD_lowAddEdgeDivision(vector pos);
00313
00314
00315 void MSD_lowSetEdgeVisibility(char, FPTYPE, FPTYPE, vector);
00316 int MSD_lowIntersectionCheck(vector, FPTYPE, FPTYPE);
00317 int MSD_lowIntersectionCheckStep1(vector, FPTYPE, FPTYPE);
00318 int MSD_lowPositionalVisibility(char, vector, FPTYPE, FPTYPE, vector);
00319 int MSD_lowEdgePlaneIntersection(vector, vector, FPTYPE, real *, real *);
00320
00321
00322 void MSD_lowCameraDisplayHidden(void);
00323 void MSD_lowDisplayHidden(CTYPE *cptr);
00324
00325
00326 int MSD_lowIsInsideFace(vector pos, FPTYPE xfptr, HPTYPE *ei);
00327 int MSD_lowIsInsideLoop(vector pos, LPTYPE lptr, HPTYPE *ei);
00328
00329
00330 void MSD_lowCameraDisplayIntersection(void);
00331 void MSD_lowDisplayIntersection(void);
00332
00333 void MSD_lowIntersectionFaceFace(SPTYPE, FPTYPE, SPTYPE, FPTYPE);
00334 int MSD_lowIntersectionParallelFaces(FPTYPE f1ptr, FPTYPE f2ptr);
00335 void MSD_lowIntersectionFaceEdge(FPTYPE f1ptr, FPTYPE f2ptr);
00336 int MSD_lowIntersectionSeparateMinMax(void);
00337 void MSD_lowIntersectionClipDropCoord(int idx);
00338
00339
00340 void MSD_lowSortDividedEdge(void);
00341
00342
00343 int MSD_lowIsEdgeVisible(CTYPE *cptr, EPTYPE eptr);
00344 int MSD_lowIsFaceVisible(CTYPE *cptr, FPTYPE fptr);
00345 int MSD_lowIsInvertedEdge(int isleft, vector dir, FPTYPE fp, vector edir);
00346
00347
00348 void MSD_lowDisplayDividedEdge(CTYPE *cptr, EPTYPE eptr);
00349
00350
00351 void g_frame(void);
00352 void g_tpoint(int lt, vect2 v);
00353 void g_tline(int lt, vect2 sv, vect2 ev);
00354 void g_iline(int lt, int *sv, int *ev);
00355 void h_line(void);
00356 void g_open(void);
00357 void g_filbox(int color, vect2 v0, vect2 v1);
00358 void g_clear(void);
00359 void g_pcolor(int color);
00360 void g_close(void);
00361 void gdcpos(vect2 npos, int *dpos);
00362
00363
00364 void MSD_lowDisplayTransformation(vector, vector);
00365 void MSD_lowInverseDisplayTransformation(vector, vector);
00366 void MSD_lowApplyDisplayTransformation(matrix, vector, vector);
00367 void MSD_lowExecInverseDisplayTransformation(vect2, vect2, vector, vector);
00368 char MSD_lowExecDisplayTransformation(vector, vector, vect2, vect2);
00369 void MSD_lowDisplayTransformationScale(vector, vector, vector, vector);
00370 char MSD_lowClipDisplayTransformation(vector, vector, vector, vector);
00371
00372
00373 void MSD_execMonitor(void);
00374 int MSD_highMonitor(char *name);
00375 int MSD_lowMonitor(CTYPE *cptr, int flag);
00376 void MSD_lowDisplayMonitor(int t, SPTYPE optr, GPTYPE gptr);
00377 void MSD_lowDisplayMonitorSolid(SPTYPE op);
00378 void MSD_lowDisplayMonitorGroup(GPTYPE gptr);
00379 void MSD_lowDisplayMonitorAxis(void);
00380
00381 #endif