edge.h

Go to the documentation of this file.
00001 /**
00002  *\file         edge.h
00003  *
00004  *              
00005  *\brief        Define HALF edge (no EDGE in euler!)
00006  *
00007  *              1. From a *pure perspective* of topological plane model of a closed     
00008  *                 2-manifold, there are actually no such things as edges, instead,     
00009  *                 there are only half edges, with the condition each is identified to  
00010  *                 exactly another one. Therefore, there is no edge nodes in my         
00011  *                 design. The identification is archived by storing the opposite half  
00012  *                 edge in the half edge node (member o).                               
00013  *                                                                                      
00014  *              2. All half edges, including circular edge (end points coincident), have
00015  *                 their oppositive halves, except singular half edge, i.e., of zero length,
00016  *                 which has nil as its opposite half edge link.
00017  * 
00018  *              3. Because there are only half edges, we simple use edge_t to denote the 
00019  *                 actually half edge type.
00020  *
00021  *\author       Xianming Chen\n
00022  *              Computer Science Department\n
00023  *              University of Utah
00024  *
00025  *\date         15 Aug 2006\n
00026  *              Copyright (c) 2006, University of Utah
00027  */
00028 
00029 
00030 #ifndef _EDGE_H
00031 #define _EDGE_H
00032 
00033 #include "node_fwd_dcl.h"
00034 #include <utility>
00035 #include <cassert>
00036 
00037 
00038 namespace euler
00039 {
00040   class edge_t
00041   {
00042   public:
00043       loop_t *l;
00044       edge_t *o;
00045       edge_t *pre, *nxt;
00046       vertex_t *v;
00047 
00048   private:
00049       edge_t(vertex_t* v, loop_t* l) : l(l), o(0), pre(this), nxt(this), v(v)           { assert(! l->e); l->e = this; }
00050       edge_t(vertex_t* v, edge_t *nxt) : l(nxt->l), o(0), pre(nxt->pre), nxt(nxt), v(v) { nxt->pre->nxt = this; nxt->pre = this; }
00051 
00052       friend class solid_t;
00053       friend class loop_t;
00054   };
00055 
00056 
00057 }
00058 
00059 
00060 #endif

Generated on Wed Aug 30 16:27:58 2006 for euler by  doxygen 1.4.6