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 __SetHmain_h
00043 #define __SetHmain_h
00044
00045 #ifndef EXT
00046 #ifdef _BOOLEAN_
00047 #define EXT
00048 #else
00049 #define EXT extern
00050 #endif
00051 #endif
00052
00053 #ifndef __SplSplit_h
00054
00055 #include <stdio.h>
00056 #ifndef __int_id
00057 #define __int_id
00058 typedef int Id;
00059 #endif
00060 #ifndef __double_vector
00061 #define __double_vector
00062 typedef real vector[4];
00063 #endif
00064 #ifndef __struct_solid
00065 #define __struct_solid
00066 typedef struct solid STYPE;
00067 #endif
00068 #ifndef __struct_face
00069 #define __struct_face
00070 typedef struct face FTYPE;
00071 #endif
00072 #ifndef __struct_loop
00073 #define __struct_loop
00074 typedef struct loop LTYPE;
00075 #endif
00076 #ifndef __struct_edge
00077 #define __struct_edge
00078 typedef struct edge ETYPE;
00079 #endif
00080 #ifndef __struct_halfedge
00081 #define __struct_halfedge
00082 typedef struct halfedge HTYPE;
00083 #endif
00084 #ifndef __struct_vertex
00085 #define __struct_vertex
00086 typedef struct vertex VTYPE;
00087 #endif
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 #undef TRACE_BOOLEAN
00101 #undef TRACE_BOOLEAN1
00102 #undef TRACE_BOOLEAN2
00103 #undef TRACE_BOOLEAN21
00104 #undef TRACE_BOOLEAN22
00105 #undef TRACE_BOOLEAN3
00106 #undef TRACE_BOOLEAN4
00107
00108 #define MAXONVERTICES 200
00109 #define MAXSECTORS 50
00110 #define MAXEDGESFORVERTEX 50
00111 #define MAXNULLEDGES 100
00112 #define MAXNULLFACES 50
00113 #define MAXENDEDGES 50
00114 #define MAXENDS 30
00115
00116 #ifdef _Windows
00117 namespace USPDesigner
00118 {
00119 #endif
00120
00121 #define USP_IN 1
00122 #define USP_ON 0
00123 #define USP_OUT -1
00124
00125 #define USP_UNION 1
00126 #define USP_INTERSECT 2
00127 #define USP_DIFFERENCE 3
00128
00129 #ifdef _Windows
00130 }
00131 #endif
00132
00133 typedef struct _nbr NBR;
00134 typedef struct _nb NB;
00135 typedef struct _sectors SECTORS;
00136 typedef struct _sonvv SONVV;
00137 typedef struct _sonvf SONVF;
00138
00139
00140 struct _nbr
00141 {
00142 HPTYPE sector;
00143 int c1;
00144 };
00145
00146 struct _nb
00147 {
00148 HPTYPE he;
00149 vector ref1, ref2, ref12;
00150 };
00151
00152 struct _sectors
00153 {
00154 int secta, sectb, s1a, s2a, s1b, s2b, intersect, onon;
00155 };
00156
00157 #ifndef __VIRTUAL_MEM
00158 EXT NB nbb[MAXSECTORS];
00159 EXT NB nba[MAXSECTORS];
00160 EXT SECTORS sectors[MAXSECTORS];
00161 #endif
00162 EXT int nnba, nnbb, nsectors;
00163
00164 #ifndef __VIRTUAL_MEM
00165 EXT NBR nbr[MAXEDGESFORVERTEX];
00166 #endif
00167 EXT int nnbr;
00168
00169
00170 struct _sonvv
00171 {
00172 VPTYPE va;
00173 VPTYPE vb;
00174 };
00175
00176 struct _sonvf
00177 {
00178 VPTYPE v;
00179 FPTYPE f;
00180 };
00181
00182 #ifndef MAXSHELLS
00183 #define MAXSHELLS 50
00184 #endif
00185 typedef struct sff SFF;
00186 struct sff
00187 {
00188 DPTYPE shell;
00189 int sign;
00190 };
00191 #ifndef __VIRTUAL_MEM
00192 EXT SFF shellposa[MAXSHELLS], shellposb[MAXSHELLS];
00193 #endif
00194 EXT int contshella, contshellb;
00195
00196 #ifndef __VIRTUAL_MEM
00197 EXT SONVV sonvv[MAXONVERTICES];
00198 EXT SONVF sonva[MAXONVERTICES], sonvb[MAXONVERTICES];
00199 #endif
00200 EXT int nvvtx, nvtxa, nvtxb;
00201
00202 #ifndef __VIRTUAL_MEM
00203 EXT EPTYPE sonea[MAXNULLEDGES];
00204 EXT EPTYPE soneb[MAXNULLEDGES];
00205 EXT FPTYPE sonfa[MAXNULLFACES * 2];
00206 EXT FPTYPE sonfb[MAXNULLFACES * 2];
00207 #endif
00208 EXT int nedga, nedgb, nfaca, nfacb;
00209
00210
00211 #ifndef __VIRTUAL_MEM
00212 EXT HPTYPE endsa[MAXENDS];
00213 EXT HPTYPE endsb[MAXENDS];
00214 #endif
00215 EXT int nenda, nendb, null_pnta, null_pntb;
00216
00217 #endif
00218
00219
00220 #ifdef TRACE_BOOLEAN
00221 #ifndef TRACE_SPLIT
00222 EXT FILE *trace;
00223 #endif
00224 #endif
00225
00226
00227 void MSD_execNameDifference(void);
00228 void MSD_highNameDifference(char *name1, char *name2, char *name);
00229 void MSD_execDifference(void);
00230 Id MSD_highDifference(Id sn1, Id sn2);
00231
00232
00233 void MSD_execNameIntersection(void);
00234 void MSD_highNameIntersection(char *name1, char *name2, char *name);
00235 void MSD_execIntersection(void);
00236 Id MSD_highIntersection(Id sn1, Id sn2);
00237
00238
00239 int MSD_lowSetOp(SPTYPE a, SPTYPE b, Id sn, SPTYPE *res, int op);
00240 int MSD_lowSetOpInitiate0(void);
00241 void MSD_lowSetOpTerminate0(void);
00242 int MSD_lowSetOpInitiate1(void);
00243 void MSD_lowSetOpTerminate1(void);
00244 int MSD_lowSetOpInitiate2(void);
00245 void MSD_lowSetOpTerminate2(void);
00246 int MSD_lowSetOpInitiate3(void);
00247 void MSD_lowSetOpTerminate3(void);
00248 int MSD_lowSetOpInitiate4(void);
00249 void MSD_lowSetOpTerminate4(void);
00250 int MSD_lowSetOpInitiate5(void);
00251 void MSD_lowSetOpTerminate5(void);
00252
00253
00254 void MSD_lowSetOpClassify(int op);
00255 void MSD_lowVtxVtxClassify(VPTYPE va, VPTYPE vb, int op);
00256 void MSD_lowVtxFacClassify(VPTYPE v, FPTYPE f, int op, int flag);
00257 void MSD_lowSetOpVFGetNeighborhood(VPTYPE v, vector SP);
00258 void MSD_lowSetOpVFReclassifyOnSectors(vector SP, int op, int flag);
00259 void MSD_lowSetOpVFReclassifyOnEdges(void);
00260 void MSD_lowSetOpVFInsertNullEdges(FPTYPE f, int flag);
00261 void MSD_lowSetOpMakeRing(FPTYPE f, double x, double y, double z, int flag);
00262
00263
00264 void MSD_lowSetOpConnect(void);
00265
00266 void MSD_lowSetOpJoin(HPTYPE, HPTYPE);
00267 int MSD_lowSetOpCanJoin(HPTYPE, HPTYPE, HPTYPE *, HPTYPE *);
00268 void MSD_lowSetOpSortNullEdges(void);
00269 int MSD_lowSetOpGreater(int i, int j);
00270 void MSD_lowSetOpSwap(int i, int j);
00271 int MSD_lowSetOpIsLooseA(HPTYPE he);
00272 int MSD_lowSetOpIsLooseB(HPTYPE he);
00273 void MSD_lowSetOpCutA(HPTYPE he);
00274 void MSD_lowSetOpCutB(HPTYPE he);
00275 int MSD_lowSetOpGetNextNullEdge(EPTYPE *, EPTYPE *);
00276
00277 int MSD_lowSetOpNeighbor(HPTYPE, HPTYPE);
00278
00279
00280 SPTYPE MSD_lowSetOpFinish(SPTYPE a, SPTYPE b, Id sn, int op);
00281
00282
00283 void MSD_lowSetOpGenerate(SPTYPE a, SPTYPE b);
00284
00285 void MSD_lowSetOpProcessEdge(EPTYPE, FPTYPE, DPTYPE, int BvxA);
00286 void MSD_lowSetOpDoGenerate(EPTYPE, FPTYPE, int BvxA);
00287 void MSD_lowSetOpDoVertexOnFace(VPTYPE, FPTYPE, int BvxA);
00288 void MSD_lowSetOpAddSOVF(VPTYPE, FPTYPE, int flag);
00289 void MSD_lowSetOpAddSOVV(VPTYPE, VPTYPE, int flag);
00290 int MSD_lowSetOpFacPntContainment(FPTYPE, real x, real y, real z);
00291
00292
00293 void MSD_lowSetOpVVGetNeighborhood(VPTYPE, VPTYPE);
00294 int MSD_lowSetOpNbaPreProcess(VPTYPE);
00295 int MSD_lowSetOpNbbPreProcess(VPTYPE);
00296 int MSD_lowSetOpSectorTest(int i, int j);
00297 int MSD_lowSetOpSectorWithin(vector dir, vector ref1, vector ref2, vector ref12);
00298
00299 int MSD_lowSetOpOverlap(HPTYPE, HPTYPE);
00300 int MSD_lowSetOpSectorOverlap(HPTYPE, HPTYPE);
00301 void MSD_lowSetOpInside(HPTYPE he, vector in);
00302
00303
00304 void MSD_lowSetOpVVInsertNullEdges(int);
00305
00306 int MSD_lowSetOpGetOrient(HPTYPE, HPTYPE, HPTYPE);
00307 int MSD_lowSetOpSectorWide(HPTYPE, int);
00308 int MSD_lowSetOpConvexEdge(HPTYPE);
00309 void MSD_lowSetOpSepar1(HPTYPE, HPTYPE, int);
00310 void MSD_lowSetOpSepar2(HPTYPE, int, int, int);
00311 int MSD_lowSetOpStrutNullEdge(HPTYPE);
00312 int MSD_lowSetOpNullEdge(HPTYPE);
00313
00314
00315 void MSD_lowSetOpVVReclassifyEdges(int op);
00316
00317
00318 void MSD_lowSetOpVVReclassifySectors(int op);
00319
00320
00321 void MSD_execNameUnion(void);
00322 void MSD_highNameUnion(char *name1, char *name2, char *name);
00323 void MSD_execUnion(void);
00324 Id MSD_highUnion(Id sn1, Id sn2);
00325
00326
00327 void trace_he(HPTYPE he);
00328 void trace_e(EPTYPE e);
00329 void trace_nbr(int x);
00330 void trace_nba(int x);
00331 void trace_nbb(int x);
00332
00333 #endif