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 __Eulerops_h
00043 #define __Eulerops_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 __int_id
00060 #define __int_id
00061 typedef int Id;
00062 #endif
00063 #ifndef __double_matrix
00064 #define __double_matrix
00065 typedef real matrix[4][4];
00066 #endif
00067 #ifndef __struct_eulerop
00068 #define __struct_eulerop
00069 typedef struct eulerop EulerOp;
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_loop
00080 #define __struct_loop
00081 typedef struct loop LTYPE;
00082 #endif
00083 #ifndef __struct_edge
00084 #define __struct_edge
00085 typedef struct edge ETYPE;
00086 #endif
00087 #ifndef __struct_halfedge
00088 #define __struct_halfedge
00089 typedef struct halfedge HTYPE;
00090 #endif
00091 #ifndef __struct_vertex
00092 #define __struct_vertex
00093 typedef struct vertex VTYPE;
00094 #endif
00095
00096 typedef enum opcode OpCode;
00097
00098 #ifndef __VIRTUAL_MEM
00099 EXTERN EulerOp *OpHead;
00100 EXTERN EulerOp *OpHeadRedo;
00101 #else
00102 EXTERN long OpHead;
00103 EXTERN long OpHeadRedo;
00104 #endif
00105 EXTERN int OpCount;
00106 EXTERN int OpCountRedo;
00107 EXTERN int Gdoinversion;
00108 EXTERN int Gdodirect;
00109 EXTERN int CommandCount;
00110
00111
00112 enum opcode
00113 {
00114 MVSF,
00115 KVSF,
00116 MEV,
00117 KEV,
00118 MEF,
00119 KEF,
00120 KEMR,
00121 MEKR,
00122 KFMRH,
00123 MFKRH,
00124 MSFKR,
00125 KSFMR,
00126 HARDREM,
00127 RMOVE,
00128 NEWLOC,
00129 REVERT,
00130 MODIFYNAMES,
00131 MERGE,
00132 DETACH,
00133 TRANS,
00134 ROTAT,
00135 SCALE,
00136 TRANSFORM,
00137 ASSOCIATE,
00138 CRTAXSTRS,
00139 CRTAXSROT,
00140 CRTGRP,
00141 REMAXS,
00142 REMGRP,
00143 MOVAXIS,
00144 ROTAXIS,
00145 SETGRP,
00146 COLOR,
00147 NAME,
00148
00149 #ifdef __curved_env__
00150 SETCTAG,
00151 SETSTAG,
00152 NEWLINE,
00153 KILLLINE,
00154 NEWPOLY,
00155 KILLPOLY,
00156 ADDLPOINT,
00157 REMLPOINT,
00158 NEWPLANE,
00159 KILLPLANE,
00160 NEWCYLINDER,
00161 KILLCYLINDER,
00162 NEWCONE,
00163 KILLCONE,
00164 NEWSPHERE,
00165 KILLSPHERE,
00166 NEWTORUS,
00167 KILLTORUS,
00168 NEWROTSURF,
00169 KILLROTSURF,
00170 NEWBLENDSURF,
00171 KILLBLENDSURF,
00172 #endif
00173 MAXCODE,
00174 };
00175
00176 struct eulerop
00177 {
00178 OpCode opcode;
00179 Id solidno;
00180 Id ip1;
00181 Id ip2;
00182 Id ip3;
00183 Id ip4;
00184 Id ip5;
00185 Id ip6;
00186 Id ip7;
00187 Id ip8;
00188 real fp1;
00189 real fp2;
00190 real fp3;
00191 real fp4;
00192 int CommandCount;
00193 #ifndef __VIRTUAL_MEM
00194 EulerOp *opnext;
00195 #else
00196 long pp;
00197 #endif
00198 };
00199
00200
00201 int MSD_highNameColor(char *name, int color);
00202 int MSD_highNameSolidColor(char *name, int col);
00203 int MSD_highNameGroupColor(char *name, int col);
00204 int MSD_highColor(Id sn, int color, int cod);
00205 void MSD_lowSolidColor(SPTYPE s, int color);
00206 void MSD_lowGroupColor(GPTYPE g, int color);
00207 int MSD_execStructColor(EulerOp *op);
00208 void MSD_printStructColor(FILE *f, EulerOp *op);
00209 int MSD_readStructColor(FILE *f, EulerOp *op);
00210 int MSD_modifyStructColor(EulerOp *op);
00211
00212
00213 void MSD_execNome(void);
00214 int MSD_highName(Id sn, char *nome, int cod);
00215 void MSD_lowSolidName(SPTYPE s, char *nome);
00216 void MSD_lowGroupName(GPTYPE g, char *nome);
00217 void MSD_lowAxisName(APTYPE a, char *nome);
00218 int MSD_execStructName(EulerOp *op);
00219 void MSD_printStructName(FILE *f, EulerOp *op);
00220 int MSD_readStructName(FILE *f, EulerOp *op);
00221 int MSD_modifyStructName(EulerOp *op);
00222
00223
00224 void MSD_execSetDoInverse(void);
00225 void MSD_lowSetDoInverse(void);
00226
00227
00228 void MSD_lowAddEulerOp(SPTYPE a, OpCode b, Id c, Id d, Id e, Id f, \
00229 Id g, Id h, Id i, Id j, \
00230 real k, real l, real m, real n);
00231 void MSD_lowAddEulerOpRedo(SPTYPE a, OpCode b, Id c, Id d, Id e, Id f, \
00232 Id g, Id h, Id i, Id j, \
00233 real k, real l, real m, real n);
00234 void MSD_lowAddMatrix(SPTYPE a, OpCode b, Id c, Id d, Id e, Id f, Id g, Id h, matrix i);
00235 void MSD_lowAddMatrixRedo(SPTYPE s, OpCode opcode, Id ip1, Id ip2, Id ip3, \
00236 Id ip4, Id ip5, Id ip6, \
00237 matrix m);
00238
00239
00240 void MSD_execKEF(void);
00241 int MSD_highKEF(Id sn, Id v1, Id v2, Id fn);
00242 void MSD_execKEF2(void);
00243 int MSD_highKEF2(Id sn, Id v1, Id v2, Id f1, Id f2);
00244 void MSD_lowKEF(HPTYPE he1, HPTYPE he2);
00245 int MSD_execStructKEF(EulerOp *op);
00246 void MSD_printStructKEF(FILE *f, EulerOp *op);
00247 int MSD_readStructKEF(FILE *f, EulerOp *op);
00248 int MSD_modifyStructKEF(EulerOp *op);
00249
00250
00251 void MSD_execKEMR(void);
00252 int MSD_highKEMR(Id sn, Id fn, Id v1, Id v2);
00253 void MSD_lowKEMR(HPTYPE he1, HPTYPE he2);
00254 int MSD_execStructKEMR(EulerOp *op);
00255 void MSD_printStructKEMR(FILE *f, EulerOp *op);
00256 int MSD_readStructKEMR(FILE *f, EulerOp *op);
00257 int MSD_modifyStructKEMR(EulerOp *op);
00258
00259
00260 void MSD_execKEV(void);
00261 int MSD_highKEV(Id sn, Id fn, Id v1, Id v2);
00262 void MSD_execJVKE(void);
00263 int MSD_highJVKE(Id sn, Id v1, Id v2, Id f);
00264 void MSD_execJEKV(void);
00265 int MSD_highJEKV(Id sn, Id v1, Id v2);
00266 void MSD_execKEV2(void);
00267 int MSD_highKEV2(Id sn, Id v1, Id v2, Id f1, Id f2);
00268 void MSD_lowKEV(HPTYPE he1, HPTYPE he2);
00269 int MSD_execStructKEV(EulerOp *op);
00270 void MSD_printStructKEV(FILE *f, EulerOp *op);
00271 int MSD_readStructKEV(FILE *f, EulerOp *op);
00272 int MSD_modifyStructKEV(EulerOp *op);
00273
00274
00275 void MSD_execKFMRH(void);
00276 int MSD_highKFMRH(Id sn, Id fn1, Id fn2);
00277 void MSD_lowKFMRH(FPTYPE f1, FPTYPE f2);
00278 int MSD_execStructKFMRH(EulerOp *op);
00279 void MSD_printStructKFMRH(FILE *f, EulerOp *op);
00280 int MSD_readStructKFMRH(FILE *f, EulerOp *op);
00281 int MSD_modifyStructKFMRH(EulerOp *op);
00282
00283
00284 void MSD_execKSFMR(void);
00285 int MSD_highKSFMR(Id sn, Id fn1, Id fn2);
00286 void MSD_lowKSFMR(FPTYPE f1, FPTYPE f2);
00287 int MSD_execStructKSFMR(EulerOp *op);
00288 void MSD_printStructKSFMR(FILE *f, EulerOp *op);
00289 int MSD_readStructKSFMR(FILE *f, EulerOp *op);
00290 int MSD_modifyStructKSFMR(EulerOp *op);
00291
00292
00293 void MSD_execKVSF(void);
00294 int MSD_highKVSF(Id sn, Id fn);
00295 void MSD_lowKVSF(SPTYPE s);
00296 int MSD_execStructKVSF(EulerOp *op);
00297 void MSD_printStructKVSF(FILE *f, EulerOp *op);
00298 int MSD_readStructKVSF(FILE *f, EulerOp *op);
00299 int MSD_modifyStructKVSF(EulerOp *op);
00300
00301
00302 void MSD_execMEF(void);
00303 int MSD_highMEF(Id sn, Id v1, Id v2, Id f1, Id f2);
00304 void MSD_execMEF2(void);
00305 int MSD_highMEF2(Id sn, Id v1, Id v2, Id v3, Id v4, Id f1, Id f2, Id f3, Id f4);
00306 FPTYPE MSD_lowMEF(HPTYPE he1, HPTYPE he2, Id fn);
00307 int MSD_execStructMEF(EulerOp *op);
00308 void MSD_printStructMEF(FILE *f, EulerOp *op);
00309 int MSD_readStructMEF(FILE *f, EulerOp *op);
00310 int MSD_modifyStructMEF(EulerOp *op);
00311
00312
00313 void MSD_execMEKR(void);
00314 int MSD_highMEKR(Id sn, Id fn, Id v1, Id v2);
00315 void MSD_execMEKR2(void);
00316 int MSD_highMEKR2(Id sn, Id v1, Id v2, Id v3, Id v4, Id f1, Id f2, Id f3);
00317 void MSD_lowMEKR(HPTYPE he1, HPTYPE he2);
00318 int MSD_execStructMEKR(EulerOp *op);
00319 void MSD_printStructMEKR(FILE *f, EulerOp *op);
00320 int MSD_readStructMEKR(FILE *f, EulerOp *op);
00321 int MSD_modifyStructMEKR(EulerOp *op);
00322
00323
00324 void MSD_execMEV(void);
00325 int MSD_highMEV(Id sn, Id fn, Id v1, Id v2, real x, real y, real z);
00326 void MSD_execSEMV(void);
00327 int MSD_highSEMV(Id sn, Id v1, Id v2, Id v3, real x, real y, real z);
00328 void MSD_execSVME(void);
00329 int MSD_highSVME(Id sn, Id v1, Id v2, Id f1, Id f2, real x, real y, real z);
00330 void MSD_execSVME2(void);
00331 int MSD_highSVME2(Id sn, Id v1, Id v2, Id v3, Id v4, Id f1, Id f2, real x,
00332 real y, real z);
00333 void MSD_execSVME3(void);
00334 int MSD_highSVME3(Id sn, Id v1, Id v2, Id v3, Id v4, Id f1, Id f2, Id f3, Id f4, \
00335 real x, real y, real z);
00336 void MSD_lowMEV(HPTYPE he1, HPTYPE he2, Id vn, real x, real y, real z);
00337 int MSD_execStructMEV(EulerOp *op);
00338 void MSD_printStructMEV(FILE *f, EulerOp *op);
00339 int MSD_readStructMEV(FILE *f, EulerOp *op);
00340 int MSD_modifyStructMEV(EulerOp *op);
00341
00342
00343 void MSD_execMFKRH(void);
00344 int MSD_highMFKRH(Id sn, Id f1, Id f2);
00345 void MSD_execMFKRH2(void);
00346 int MSD_highMFKRH2(Id sn, Id f1, Id f2, Id v1, Id v2);
00347 FPTYPE MSD_lowMFKRH(FPTYPE f, LPTYPE l, Id fn);
00348 int MSD_execStructMFKRH(EulerOp *op);
00349 void MSD_printStructMFKRH(FILE *f, EulerOp *op);
00350 int MSD_readStructMFKRH(FILE *f, EulerOp *op);
00351 int MSD_modifyStructMFKRH(EulerOp *op);
00352
00353
00354 SPTYPE MSD_lowModifyEulerOp(EulerOp *op);
00355 int MSD_modifyStructError(EulerOp *op);
00356 void MSD_lowIniciaTranslatorTable(void);
00357 int MSD_lowCheckTranslatorTable(int elemno, int code);
00358 void MSD_lowSetTranslatorTable(int elemnoold, int elemno, int code);
00359
00360
00361 void MSD_execMSFKR(void);
00362 int MSD_highMSFKR(Id sn, Id ff, Id fn, Id dn);
00363 void MSD_execMSFKR2(void);
00364 int MSD_highMSFKR2(Id sn, Id ff, Id fn, Id dn, Id v1, Id v2);
00365 FPTYPE MSD_lowMSFKR(LPTYPE l, Id fn, Id dn);
00366 int MSD_execStructMSFKR(EulerOp *op);
00367 void MSD_printStructMSFKR(FILE *f, EulerOp *op);
00368 int MSD_readStructMSFKR(FILE *f, EulerOp *op);
00369 int MSD_modifyStructMSFKR(EulerOp *op);
00370 void markface(FPTYPE f, DPTYPE d);
00371 void redo(DPTYPE shell, DPTYPE oldshell);
00372 int sfindv(DPTYPE d, VPTYPE v);
00373 int sfinde(DPTYPE d, EPTYPE e);
00374
00375
00376 void MSD_execMVSF(void);
00377 SPTYPE MSD_highMVSF(Id fn, Id vn, Id dn, real xx, real yy, real zz);
00378 SPTYPE MSD_lowMVSF(Id sn, Id fn, Id vn, Id dn, real xx, real yy, real zz);
00379 int MSD_execStructMVSF(EulerOp *op);
00380 void MSD_printStructMVSF(FILE *f, EulerOp *op);
00381 int MSD_readStructMVSF(FILE *f, EulerOp *op);
00382 int MSD_modifyStructMVSF(EulerOp *op);
00383
00384
00385 void MSD_highPrintAllOps(void);
00386 void MSD_highPrintAllRedoOps(void);
00387 void MSD_lowPrintEulerOp(FILE *f, EulerOp *op);
00388 void MSD_printStructError(FILE *f, EulerOp *op);
00389
00390
00391 int MSD_lowScanEulerOperator(FILE *f, EulerOp *op);
00392 int MSD_readStructError(FILE *f, EulerOp *op);
00393
00394
00395 void MSD_setEulCoef(SPTYPE s, int dn, int fn, int rn, int en, int vn, int hn);
00396 void MSD_addEulCoef(SPTYPE s, int dn, int fn, int rn, int en, int vn, int hn);
00397
00398
00399 void MSD_execUndoOp(void);
00400 void MSD_highUndoOp(void);
00401 SPTYPE MSD_lowUndoOp(void);
00402 SPTYPE MSD_lowApplyEulerOp(EulerOp *op, int *cont);
00403 int MSD_execStructError(EulerOp *op);
00404 void MSD_lowFreeUndoLog(PEulerOp EndOp);
00405 void MSD_lowGetMatrix(EulerOp *op, matrix m);
00406
00407
00408 void MSD_execCleanSolid(void);
00409 void MSD_execNameCleanSolid(void);
00410 int MSD_highNameCleanSolid(char *);
00411 int MSD_highCleanSolid(Id sn);
00412 void MSD_lowCleanSolid(SPTYPE s);
00413
00414
00415 void MSD_execDetach(void);
00416 int MSD_highDetach(Id sn, Id sn1, Id dn, Id newd, int addf, int addv);
00417 SPTYPE MSD_lowDetach(SPTYPE s, Id sn, DPTYPE d, Id newd, int addf, int addv);
00418 void MSD_lowShellDetach(SPTYPE s, SPTYPE s1, DPTYPE d, Id newd, int addf, int addv);
00419 int MSD_execStructDetach(EulerOp *op);
00420 void MSD_printStructDetach(FILE *f, EulerOp *op);
00421 int MSD_readStructDetach(FILE *f, EulerOp *op);
00422 int MSD_modifyStructDetach(EulerOp *op);
00423
00424
00425 void MSD_execGlue(void);
00426 int MSD_highGlue(Id sn1, Id sn2);
00427 void MSD_lowGlue(SPTYPE s1, SPTYPE s2);
00428 void MSD_lowFaceGlue(SPTYPE s1, SPTYPE s2, FPTYPE f1, FPTYPE f2);
00429 int MSD_lowLoopGlue(FPTYPE f);
00430
00431
00432 void MSD_execNameMerge(void);
00433 void MSD_execMerge(void);
00434 int MSD_highNameMerge(char *, char *);
00435 int MSD_highMerge(Id sn1, Id sn2);
00436 void MSD_lowMerge(SPTYPE s1, SPTYPE s2);
00437
00438
00439 void MSD_execModifyIds(void);
00440 int MSD_highModifyIds(Id sn, Id snew);
00441 void MSD_lowModifyIds(SPTYPE s, Id snew);
00442 int MSD_execStructModifyIds(EulerOp *op);
00443 void MSD_printStructModifyIds(FILE *f, EulerOp *op);
00444 int MSD_readStructModifyIds(FILE *f, EulerOp *op);
00445 int MSD_modifyStructModifyIds(EulerOp *op);
00446
00447
00448 void MSD_execNewVertexLocation(void);
00449 int MSD_highNewVertexLocation(Id sn, Id vn, real x, real y, real z);
00450 void MSD_lowNewVertexLocation(SPTYPE s, VPTYPE v, real x, real y, real z);
00451 int MSD_execStructNewVertexLocation(EulerOp *op);
00452 void MSD_printStructNewVertexLocation(FILE *f, EulerOp *op);
00453 int MSD_readStructNewVertexLocation(FILE *f, EulerOp *op);
00454 int MSD_modifyStructNewVertexLocation(EulerOp *op);
00455
00456
00457 void MSD_execRevert(void);
00458 int MSD_highRevert(Id sn, Id dn);
00459 int MSD_lowRevert(DPTYPE d);
00460 int MSD_execStructRevert(EulerOp *op);
00461 void MSD_printStructRevert(FILE *f, EulerOp *op);
00462 int MSD_readStructRevert(FILE *f, EulerOp *op);
00463 int MSD_modifyStructRevert(EulerOp *op);
00464
00465
00466 void MSD_execRingMove(void);
00467 int MSD_highRingMove(Id sn, Id v1, Id v2, Id f1, Id f2, int out);
00468 int MSD_lowRingMove(FPTYPE f1, FPTYPE f2, LPTYPE l, int out);
00469 int MSD_execStructRingMove(EulerOp *op);
00470 void MSD_printStructRingMove(FILE *f, EulerOp *op);
00471 int MSD_readStructRingMove(FILE *f, EulerOp *op);
00472 int MSD_modifyStructRingMove(EulerOp *op);
00473 void MSD_execAllRingMove(void);
00474 int MSD_highAllRingMove(Id sn, Id f1, Id f2);
00475 int MSD_lowAllRingMove(FPTYPE f1, FPTYPE f2);
00476
00477
00478 void MSD_execHardRemove(void);
00479 int MSD_highHardRemove(Id sn);
00480 int MSD_lowHardRemove(SPTYPE s);
00481 int MSD_execStructHardRemove(EulerOp *op);
00482 void MSD_printStructHardRemove(FILE *f, EulerOp *op);
00483 int MSD_readStructHardRemove(FILE *f, EulerOp *op);
00484 int MSD_modifyStructHardRemove(EulerOp *op);
00485
00486
00487 void MSD_execNameSoftRemove(void);
00488 int MSD_highNameSoftRemove(char *name);
00489 void MSD_execSoftRemove(void);
00490 int MSD_highSoftRemove(Id sn);
00491 int MSD_lowSoftRemove(SPTYPE s);
00492 void MSD_lowShellRemove(SPTYPE s);
00493 void MSD_lowEdgeRemove(SPTYPE s);
00494 void MSD_lowFaceRemove(SPTYPE s);
00495
00496 #endif