2 ** License Applicability. Except to the extent portions of this file are
3 ** made subject to an alternative license as permitted in the SGI Free
4 ** Software License B, Version 1.1 (the "License"), the contents of this
5 ** file are subject only to the provisions of the License. You may not use
6 ** this file except in compliance with the License. You may obtain a copy
7 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
8 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
10 ** http://oss.sgi.com/projects/FreeB
12 ** Note that, as provided in the License, the Software is distributed on an
13 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
14 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
15 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
16 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
18 ** Original Code. The Original Code is: OpenGL Sample Implementation,
19 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
20 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
21 ** Copyright in any portions created by third parties is as indicated
22 ** elsewhere herein. All Rights Reserved.
24 ** Additional Notice Provisions: The application programming interfaces
25 ** established by SGI in conjunction with the Original Code are The
26 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
27 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
28 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
29 ** Window System(R) (Version 1.3), released October 19, 1998. This software
30 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
31 ** published by SGI, but has not been independently verified as being
32 ** compliant with the OpenGL(R) version 1.2.1 Specification.
36 ** Author: Eric Veach, July 1994.
38 ** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
39 ** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/mesh.c,v 1.1 2001/03/17 00:25:41 brianp Exp $
51 static GLUvertex
*allocVertex()
53 return (GLUvertex
*)memAlloc( sizeof( GLUvertex
));
56 static GLUface
*allocFace()
58 return (GLUface
*)memAlloc( sizeof( GLUface
));
61 /************************ Utility Routines ************************/
63 /* Allocate and free half-edges in pairs for efficiency.
64 * The *only* place that should use this fact is allocation/free.
66 typedef struct { GLUhalfEdge e
, eSym
; } EdgePair
;
68 /* MakeEdge creates a new pair of half-edges which form their own loop.
69 * No vertex or face structures are allocated, but these must be assigned
70 * before the current edge operation is completed.
72 static GLUhalfEdge
*MakeEdge( GLUhalfEdge
*eNext
)
77 EdgePair
*pair
= (EdgePair
*)memAlloc( sizeof( EdgePair
));
78 if (pair
== NULL
) return NULL
;
83 /* Make sure eNext points to the first edge of the edge pair */
84 if( eNext
->Sym
< eNext
) { eNext
= eNext
->Sym
; }
86 /* Insert in circular doubly-linked list before eNext.
87 * Note that the prev pointer is stored in Sym->next.
89 ePrev
= eNext
->Sym
->next
;
93 eNext
->Sym
->next
= eSym
;
101 e
->activeRegion
= NULL
;
109 eSym
->activeRegion
= NULL
;
114 /* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
115 * CS348a notes (see mesh.h). Basically it modifies the mesh so that
116 * a->Onext and b->Onext are exchanged. This can have various effects
117 * depending on whether a and b belong to different face or vertex rings.
118 * For more explanation see __gl_meshSplice() below.
120 static void Splice( GLUhalfEdge
*a
, GLUhalfEdge
*b
)
122 GLUhalfEdge
*aOnext
= a
->Onext
;
123 GLUhalfEdge
*bOnext
= b
->Onext
;
125 aOnext
->Sym
->Lnext
= b
;
126 bOnext
->Sym
->Lnext
= a
;
131 /* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
132 * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
133 * a place to insert the new vertex in the global vertex list. We insert
134 * the new vertex *before* vNext so that algorithms which walk the vertex
135 * list will not see the newly created vertices.
137 static void MakeVertex( GLUvertex
*newVertex
,
138 GLUhalfEdge
*eOrig
, GLUvertex
*vNext
)
142 GLUvertex
*vNew
= newVertex
;
144 assert(vNew
!= NULL
);
146 /* insert in circular doubly-linked list before vNext */
153 vNew
->anEdge
= eOrig
;
155 /* leave coords, s, t undefined */
157 /* fix other edges on this vertex loop */
162 } while( e
!= eOrig
);
165 /* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
166 * face of all edges in the face loop to which eOrig belongs. "fNext" gives
167 * a place to insert the new face in the global face list. We insert
168 * the new face *before* fNext so that algorithms which walk the face
169 * list will not see the newly created faces.
171 static void MakeFace( GLUface
*newFace
, GLUhalfEdge
*eOrig
, GLUface
*fNext
)
175 GLUface
*fNew
= newFace
;
177 assert(fNew
!= NULL
);
179 /* insert in circular doubly-linked list before fNext */
186 fNew
->anEdge
= eOrig
;
189 fNew
->marked
= FALSE
;
191 /* The new face is marked "inside" if the old one was. This is a
192 * convenience for the common case where a face has been split in two.
194 fNew
->inside
= fNext
->inside
;
196 /* fix other edges on this face loop */
201 } while( e
!= eOrig
);
204 /* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
205 * and removes from the global edge list.
207 static void KillEdge( GLUhalfEdge
*eDel
)
209 GLUhalfEdge
*ePrev
, *eNext
;
211 /* Half-edges are allocated in pairs, see EdgePair above */
212 if( eDel
->Sym
< eDel
) { eDel
= eDel
->Sym
; }
214 /* delete from circular doubly-linked list */
216 ePrev
= eDel
->Sym
->next
;
217 eNext
->Sym
->next
= ePrev
;
218 ePrev
->Sym
->next
= eNext
;
224 /* KillVertex( vDel ) destroys a vertex and removes it from the global
225 * vertex list. It updates the vertex loop to point to a given new vertex.
227 static void KillVertex( GLUvertex
*vDel
, GLUvertex
*newOrg
)
229 GLUhalfEdge
*e
, *eStart
= vDel
->anEdge
;
230 GLUvertex
*vPrev
, *vNext
;
232 /* change the origin of all affected edges */
237 } while( e
!= eStart
);
239 /* delete from circular doubly-linked list */
248 /* KillFace( fDel ) destroys a face and removes it from the global face
249 * list. It updates the face loop to point to a given new face.
251 static void KillFace( GLUface
*fDel
, GLUface
*newLface
)
253 GLUhalfEdge
*e
, *eStart
= fDel
->anEdge
;
254 GLUface
*fPrev
, *fNext
;
256 /* change the left face of all affected edges */
261 } while( e
!= eStart
);
263 /* delete from circular doubly-linked list */
273 /****************** Basic Edge Operations **********************/
275 /* __gl_meshMakeEdge creates one edge, two vertices, and a loop (face).
276 * The loop consists of the two new half-edges.
278 GLUhalfEdge
*__gl_meshMakeEdge( GLUmesh
*mesh
)
280 GLUvertex
*newVertex1
= allocVertex();
281 GLUvertex
*newVertex2
= allocVertex();
282 GLUface
*newFace
= allocFace();
285 /* if any one is null then all get freed */
286 if (newVertex1
== NULL
|| newVertex2
== NULL
|| newFace
== NULL
) {
287 if (newVertex1
!= NULL
) memFree(newVertex1
);
288 if (newVertex2
!= NULL
) memFree(newVertex2
);
289 if (newFace
!= NULL
) memFree(newFace
);
293 e
= MakeEdge( &mesh
->eHead
);
294 if (e
== NULL
) return NULL
;
296 MakeVertex( newVertex1
, e
, &mesh
->vHead
);
297 MakeVertex( newVertex2
, e
->Sym
, &mesh
->vHead
);
298 MakeFace( newFace
, e
, &mesh
->fHead
);
303 /* __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the
304 * mesh connectivity and topology. It changes the mesh so that
305 * eOrg->Onext <- OLD( eDst->Onext )
306 * eDst->Onext <- OLD( eOrg->Onext )
307 * where OLD(...) means the value before the meshSplice operation.
309 * This can have two effects on the vertex structure:
310 * - if eOrg->Org != eDst->Org, the two vertices are merged together
311 * - if eOrg->Org == eDst->Org, the origin is split into two vertices
312 * In both cases, eDst->Org is changed and eOrg->Org is untouched.
314 * Similarly (and independently) for the face structure,
315 * - if eOrg->Lface == eDst->Lface, one loop is split into two
316 * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
317 * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
319 * Some special cases:
320 * If eDst == eOrg, the operation has no effect.
321 * If eDst == eOrg->Lnext, the new face will have a single edge.
322 * If eDst == eOrg->Lprev, the old face will have a single edge.
323 * If eDst == eOrg->Onext, the new vertex will have a single edge.
324 * If eDst == eOrg->Oprev, the old vertex will have a single edge.
326 int __gl_meshSplice( GLUhalfEdge
*eOrg
, GLUhalfEdge
*eDst
)
328 int joiningLoops
= FALSE
;
329 int joiningVertices
= FALSE
;
331 if( eOrg
== eDst
) return 1;
333 if( eDst
->Org
!= eOrg
->Org
) {
334 /* We are merging two disjoint vertices -- destroy eDst->Org */
335 joiningVertices
= TRUE
;
336 KillVertex( eDst
->Org
, eOrg
->Org
);
338 if( eDst
->Lface
!= eOrg
->Lface
) {
339 /* We are connecting two disjoint loops -- destroy eDst->Lface */
341 KillFace( eDst
->Lface
, eOrg
->Lface
);
344 /* Change the edge structure */
345 Splice( eDst
, eOrg
);
347 if( ! joiningVertices
) {
348 GLUvertex
*newVertex
= allocVertex();
349 if (newVertex
== NULL
) return 0;
351 /* We split one vertex into two -- the new vertex is eDst->Org.
352 * Make sure the old vertex points to a valid half-edge.
354 MakeVertex( newVertex
, eDst
, eOrg
->Org
);
355 eOrg
->Org
->anEdge
= eOrg
;
357 if( ! joiningLoops
) {
358 GLUface
*newFace
= allocFace();
359 if (newFace
== NULL
) return 0;
361 /* We split one loop into two -- the new loop is eDst->Lface.
362 * Make sure the old face points to a valid half-edge.
364 MakeFace( newFace
, eDst
, eOrg
->Lface
);
365 eOrg
->Lface
->anEdge
= eOrg
;
372 /* __gl_meshDelete( eDel ) removes the edge eDel. There are several cases:
373 * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
374 * eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
375 * the newly created loop will contain eDel->Dst. If the deletion of eDel
376 * would create isolated vertices, those are deleted as well.
378 * This function could be implemented as two calls to __gl_meshSplice
379 * plus a few calls to memFree, but this would allocate and delete
380 * unnecessary vertices and faces.
382 int __gl_meshDelete( GLUhalfEdge
*eDel
)
384 GLUhalfEdge
*eDelSym
= eDel
->Sym
;
385 int joiningLoops
= FALSE
;
387 /* First step: disconnect the origin vertex eDel->Org. We make all
388 * changes to get a consistent mesh in this "intermediate" state.
390 if( eDel
->Lface
!= eDel
->Rface
) {
391 /* We are joining two loops into one -- remove the left face */
393 KillFace( eDel
->Lface
, eDel
->Rface
);
396 if( eDel
->Onext
== eDel
) {
397 KillVertex( eDel
->Org
, NULL
);
399 /* Make sure that eDel->Org and eDel->Rface point to valid half-edges */
400 eDel
->Rface
->anEdge
= eDel
->Oprev
;
401 eDel
->Org
->anEdge
= eDel
->Onext
;
403 Splice( eDel
, eDel
->Oprev
);
404 if( ! joiningLoops
) {
405 GLUface
*newFace
= allocFace();
406 if (newFace
== NULL
) return 0;
408 /* We are splitting one loop into two -- create a new loop for eDel. */
409 MakeFace( newFace
, eDel
, eDel
->Lface
);
413 /* Claim: the mesh is now in a consistent state, except that eDel->Org
414 * may have been deleted. Now we disconnect eDel->Dst.
416 if( eDelSym
->Onext
== eDelSym
) {
417 KillVertex( eDelSym
->Org
, NULL
);
418 KillFace( eDelSym
->Lface
, NULL
);
420 /* Make sure that eDel->Dst and eDel->Lface point to valid half-edges */
421 eDel
->Lface
->anEdge
= eDelSym
->Oprev
;
422 eDelSym
->Org
->anEdge
= eDelSym
->Onext
;
423 Splice( eDelSym
, eDelSym
->Oprev
);
426 /* Any isolated vertices or faces have already been freed. */
433 /******************** Other Edge Operations **********************/
435 /* All these routines can be implemented with the basic edge
436 * operations above. They are provided for convenience and efficiency.
440 /* __gl_meshAddEdgeVertex( eOrg ) creates a new edge eNew such that
441 * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
442 * eOrg and eNew will have the same left face.
444 GLUhalfEdge
*__gl_meshAddEdgeVertex( GLUhalfEdge
*eOrg
)
446 GLUhalfEdge
*eNewSym
;
447 GLUhalfEdge
*eNew
= MakeEdge( eOrg
);
448 if (eNew
== NULL
) return NULL
;
452 /* Connect the new edge appropriately */
453 Splice( eNew
, eOrg
->Lnext
);
455 /* Set the vertex and face information */
456 eNew
->Org
= eOrg
->Dst
;
458 GLUvertex
*newVertex
= allocVertex();
459 if (newVertex
== NULL
) return NULL
;
461 MakeVertex( newVertex
, eNewSym
, eNew
->Org
);
463 eNew
->Lface
= eNewSym
->Lface
= eOrg
->Lface
;
469 /* __gl_meshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
470 * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
471 * eOrg and eNew will have the same left face.
473 GLUhalfEdge
*__gl_meshSplitEdge( GLUhalfEdge
*eOrg
)
476 GLUhalfEdge
*tempHalfEdge
= __gl_meshAddEdgeVertex( eOrg
);
477 if (tempHalfEdge
== NULL
) return NULL
;
479 eNew
= tempHalfEdge
->Sym
;
481 /* Disconnect eOrg from eOrg->Dst and connect it to eNew->Org */
482 Splice( eOrg
->Sym
, eOrg
->Sym
->Oprev
);
483 Splice( eOrg
->Sym
, eNew
);
485 /* Set the vertex and face information */
486 eOrg
->Dst
= eNew
->Org
;
487 eNew
->Dst
->anEdge
= eNew
->Sym
; /* may have pointed to eOrg->Sym */
488 eNew
->Rface
= eOrg
->Rface
;
489 eNew
->winding
= eOrg
->winding
; /* copy old winding information */
490 eNew
->Sym
->winding
= eOrg
->Sym
->winding
;
496 /* __gl_meshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
497 * to eDst->Org, and returns the corresponding half-edge eNew.
498 * If eOrg->Lface == eDst->Lface, this splits one loop into two,
499 * and the newly created loop is eNew->Lface. Otherwise, two disjoint
500 * loops are merged into one, and the loop eDst->Lface is destroyed.
502 * If (eOrg == eDst), the new face will have only two edges.
503 * If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
504 * If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
506 GLUhalfEdge
*__gl_meshConnect( GLUhalfEdge
*eOrg
, GLUhalfEdge
*eDst
)
508 GLUhalfEdge
*eNewSym
;
509 int joiningLoops
= FALSE
;
510 GLUhalfEdge
*eNew
= MakeEdge( eOrg
);
511 if (eNew
== NULL
) return NULL
;
515 if( eDst
->Lface
!= eOrg
->Lface
) {
516 /* We are connecting two disjoint loops -- destroy eDst->Lface */
518 KillFace( eDst
->Lface
, eOrg
->Lface
);
521 /* Connect the new edge appropriately */
522 Splice( eNew
, eOrg
->Lnext
);
523 Splice( eNewSym
, eDst
);
525 /* Set the vertex and face information */
526 eNew
->Org
= eOrg
->Dst
;
527 eNewSym
->Org
= eDst
->Org
;
528 eNew
->Lface
= eNewSym
->Lface
= eOrg
->Lface
;
530 /* Make sure the old face points to a valid half-edge */
531 eOrg
->Lface
->anEdge
= eNewSym
;
533 if( ! joiningLoops
) {
534 GLUface
*newFace
= allocFace();
535 if (newFace
== NULL
) return NULL
;
537 /* We split one loop into two -- the new loop is eNew->Lface */
538 MakeFace( newFace
, eNew
, eOrg
->Lface
);
544 /******************** Other Operations **********************/
546 /* __gl_meshZapFace( fZap ) destroys a face and removes it from the
547 * global face list. All edges of fZap will have a NULL pointer as their
548 * left face. Any edges which also have a NULL pointer as their right face
549 * are deleted entirely (along with any isolated vertices this produces).
550 * An entire mesh can be deleted by zapping its faces, one at a time,
551 * in any order. Zapped faces cannot be used in further mesh operations!
553 void __gl_meshZapFace( GLUface
*fZap
)
555 GLUhalfEdge
*eStart
= fZap
->anEdge
;
556 GLUhalfEdge
*e
, *eNext
, *eSym
;
557 GLUface
*fPrev
, *fNext
;
559 /* walk around face, deleting edges whose right face is also NULL */
560 eNext
= eStart
->Lnext
;
566 if( e
->Rface
== NULL
) {
567 /* delete the edge -- see __gl_MeshDelete above */
569 if( e
->Onext
== e
) {
570 KillVertex( e
->Org
, NULL
);
572 /* Make sure that e->Org points to a valid half-edge */
573 e
->Org
->anEdge
= e
->Onext
;
574 Splice( e
, e
->Oprev
);
577 if( eSym
->Onext
== eSym
) {
578 KillVertex( eSym
->Org
, NULL
);
580 /* Make sure that eSym->Org points to a valid half-edge */
581 eSym
->Org
->anEdge
= eSym
->Onext
;
582 Splice( eSym
, eSym
->Oprev
);
586 } while( e
!= eStart
);
588 /* delete from circular doubly-linked list */
598 /* __gl_meshNewMesh() creates a new mesh with no edges, no vertices,
599 * and no loops (what we usually call a "face").
601 GLUmesh
*__gl_meshNewMesh( void )
607 GLUmesh
*mesh
= (GLUmesh
*)memAlloc( sizeof( GLUmesh
));
615 eSym
= &mesh
->eHeadSym
;
617 v
->next
= v
->prev
= v
;
621 f
->next
= f
->prev
= f
;
635 e
->activeRegion
= NULL
;
644 eSym
->activeRegion
= NULL
;
650 /* __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in
651 * both meshes, and returns the new mesh (the old meshes are destroyed).
653 GLUmesh
*__gl_meshUnion( GLUmesh
*mesh1
, GLUmesh
*mesh2
)
655 GLUface
*f1
= &mesh1
->fHead
;
656 GLUvertex
*v1
= &mesh1
->vHead
;
657 GLUhalfEdge
*e1
= &mesh1
->eHead
;
658 GLUface
*f2
= &mesh2
->fHead
;
659 GLUvertex
*v2
= &mesh2
->vHead
;
660 GLUhalfEdge
*e2
= &mesh2
->eHead
;
662 /* Add the faces, vertices, and edges of mesh2 to those of mesh1 */
663 if( f2
->next
!= f2
) {
664 f1
->prev
->next
= f2
->next
;
665 f2
->next
->prev
= f1
->prev
;
670 if( v2
->next
!= v2
) {
671 v1
->prev
->next
= v2
->next
;
672 v2
->next
->prev
= v1
->prev
;
677 if( e2
->next
!= e2
) {
678 e1
->Sym
->next
->Sym
->next
= e2
->next
;
679 e2
->next
->Sym
->next
= e1
->Sym
->next
;
680 e2
->Sym
->next
->Sym
->next
= e1
;
681 e1
->Sym
->next
= e2
->Sym
->next
;
689 #ifdef DELETE_BY_ZAPPING
691 /* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
693 void __gl_meshDeleteMesh( GLUmesh
*mesh
)
695 GLUface
*fHead
= &mesh
->fHead
;
697 while( fHead
->next
!= fHead
) {
698 __gl_meshZapFace( fHead
->next
);
700 assert( mesh
->vHead
.next
== &mesh
->vHead
);
707 /* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
709 void __gl_meshDeleteMesh( GLUmesh
*mesh
)
712 GLUvertex
*v
, *vNext
;
713 GLUhalfEdge
*e
, *eNext
;
715 for( f
= mesh
->fHead
.next
; f
!= &mesh
->fHead
; f
= fNext
) {
720 for( v
= mesh
->vHead
.next
; v
!= &mesh
->vHead
; v
= vNext
) {
725 for( e
= mesh
->eHead
.next
; e
!= &mesh
->eHead
; e
= eNext
) {
726 /* One call frees both e and e->Sym (see EdgePair above) */
738 /* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency.
740 void __gl_meshCheckMesh( GLUmesh
*mesh
)
742 GLUface
*fHead
= &mesh
->fHead
;
743 GLUvertex
*vHead
= &mesh
->vHead
;
744 GLUhalfEdge
*eHead
= &mesh
->eHead
;
746 GLUvertex
*v
, *vPrev
;
747 GLUhalfEdge
*e
, *ePrev
;
750 for( fPrev
= fHead
; (f
= fPrev
->next
) != fHead
; fPrev
= f
) {
751 assert( f
->prev
== fPrev
);
754 assert( e
->Sym
!= e
);
755 assert( e
->Sym
->Sym
== e
);
756 assert( e
->Lnext
->Onext
->Sym
== e
);
757 assert( e
->Onext
->Sym
->Lnext
== e
);
758 assert( e
->Lface
== f
);
760 } while( e
!= f
->anEdge
);
762 assert( f
->prev
== fPrev
&& f
->anEdge
== NULL
&& f
->data
== NULL
);
765 for( vPrev
= vHead
; (v
= vPrev
->next
) != vHead
; vPrev
= v
) {
766 assert( v
->prev
== vPrev
);
769 assert( e
->Sym
!= e
);
770 assert( e
->Sym
->Sym
== e
);
771 assert( e
->Lnext
->Onext
->Sym
== e
);
772 assert( e
->Onext
->Sym
->Lnext
== e
);
773 assert( e
->Org
== v
);
775 } while( e
!= v
->anEdge
);
777 assert( v
->prev
== vPrev
&& v
->anEdge
== NULL
&& v
->data
== NULL
);
780 for( ePrev
= eHead
; (e
= ePrev
->next
) != eHead
; ePrev
= e
) {
781 assert( e
->Sym
->next
== ePrev
->Sym
);
782 assert( e
->Sym
!= e
);
783 assert( e
->Sym
->Sym
== e
);
784 assert( e
->Org
!= NULL
);
785 assert( e
->Dst
!= NULL
);
786 assert( e
->Lnext
->Onext
->Sym
== e
);
787 assert( e
->Onext
->Sym
->Lnext
== e
);
789 assert( e
->Sym
->next
== ePrev
->Sym
790 && e
->Sym
== &mesh
->eHeadSym
792 && e
->Org
== NULL
&& e
->Dst
== NULL
793 && e
->Lface
== NULL
&& e
->Rface
== NULL
);