00001
00002
00039
00040
00063 Face* Surf::create(Point *p0, Point *p1, Point *p2);
00064 void Surf::destroy(Face *f);
00065 Edge* Surf::glue(Hedge *e1, Hedge *e2);
00066 Edge* Surf::unglue(Hedge *e1, Hedge *e2);
00067 \endcode
00068
00069 For adaptations purposes, Tops library supplies more four
00070 functions:
00071
00072 \code
00073
00074 Vertex* split(Face *f);
00075 Vertex* split(Hedge* e);
00076 Hedge* weld(Vertex* w);
00077 Hedge* flip(Hedge *h);
00078 \endcode
00079
00080 The above API's turns transparent to the user all topological
00081 changes of the surface and data structures updates.
00082
00083 In addition to these API's, the library also provides
00084 the standard operators for querying and navigating
00085 topological data structures.
00086
00087 The library data structure include a geometric
00088 data. This is supplied by algebra3 library so that
00089 Tops library deals with topological and geometic issues.
00090 Therefore, the application has full control of
00091 geometry aspects through the face, edge and vertex attribute classes.
00092
00093 */
00094
00095
00096
00097
00220
00221
00222
00318
00319
00320
00333 Point* p[4];
00334 p[0] = new Point(vec3(0,0,0), vec3(0,0,0), 0);
00335 p[1] = new Point(vec3(1,0,0), vec3(0,0,0), 1);
00336 p[2] = new Point(vec3(0,1,0), vec3(0,0,0), 2);
00337 p[3] = new Point(vec3(0,0,1), vec3(0,0,0), 3);
00338
00339
00340 Surf *s = new Surf();
00341
00342
00343 Face* f[4];
00344 f[0] = s->create(p[0], p[2], p[1]);
00345 f[1] = s->create(p[0], p[2], p[3]);
00346 f[2] = s->create(p[1], p[2], p[3]);
00347 f[3] = s->create(p[0], p[3], p[2]);
00348
00349
00350 for(i=1; i<4; i++)
00351 {
00352 Hedge* he[3], *mhe[3];
00353 Point *p[3];
00354
00355
00356 for(j=0; j<3;j++){
00357 he[j] = f[i]->hedge(j);
00358 p[j] = f[i]->vertex(j);
00359 }
00360
00361
00362 mhe[0] = p[0]->lookup_hedge(p[1]);
00363 mhe[1] = p[1]->lookup_hedge(p[2]);
00364 mhe[2] = p[2]->lookup_hedge(p[0]);
00365
00366 is_manifold = true;
00367
00368
00369 for(j =0;j<3; j++)
00370 if (mhe[j]!=NULL && !mhe[j]->edge()->is_bdry())
00371 is_manifold = false;
00372
00373
00374 if(is_manifold){
00375
00376 if(mhe[0]!=NULL)
00377 s->glue(mhe[0], he[0])
00378
00379 if(mhe[1]!=NULL)
00380 s->glue(mhe[1], he[1])
00381
00382 if(mhe[2]!=NULL)
00383 s->glue(mhe[2], he[2])
00384 }
00385
00386 }
00387
00388 \endcode
00389
00390 */
00391
00392
00393
00394
00413
00414
00453
00454
00455
00477
00478
00511
00512
00513