Subversion Repositories gelsvn

Rev

Rev 120 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 120 Rev 121
Line 3... Line 3...
3
 
3
 
4
using namespace CGLA;
4
using namespace CGLA;
5
 
5
 
6
namespace HMesh
6
namespace HMesh
7
{
7
{
8
	template<class R>
8
		template<class R>
9
	HalfEdge_template<R>::HalfEdge_template():
9
		HalfEdge_template<R>::HalfEdge_template():
10
		vert(NULL_VERTEX_ITER),
10
				vert(NULL_VERTEX_ITER),
11
		next(NULL_HALFEDGE_ITER),
11
				next(NULL_HALFEDGE_ITER),
12
		prev(NULL_HALFEDGE_ITER),
12
				prev(NULL_HALFEDGE_ITER),
13
		face(NULL_FACE_ITER),
13
				face(NULL_FACE_ITER),
14
		opp(NULL_HALFEDGE_ITER),
14
				opp(NULL_HALFEDGE_ITER),
15
		touched(0)
15
				touched(0)
16
	{}
16
		{}
17
 
17
 
18
	bool is_boundary(HalfEdgeIter h)
18
		bool is_boundary(HalfEdgeIter h)
19
	{
19
		{
20
		return h->face == NULL_FACE_ITER || h->opp->face == NULL_FACE_ITER;
20
				return h->face == NULL_FACE_ITER || h->opp->face == NULL_FACE_ITER;
21
	}
21
		}
22
 
22
 
23
 
23
 
24
	void link(HalfEdgeIter h0, HalfEdgeIter h1)
24
		void link(HalfEdgeIter h0, HalfEdgeIter h1)
25
	{
25
		{
26
		h0->next = h1;
26
				h0->next = h1;
27
		h1->prev = h0;
27
				h1->prev = h0;
28
	}
28
		}
29
 
29
 
30
	void glue(HalfEdgeIter h0, HalfEdgeIter h1)
30
		void glue(HalfEdgeIter h0, HalfEdgeIter h1)
31
	{
31
		{
32
		h0->opp = h1;
32
				h0->opp = h1;
33
		h1->opp = h0;
33
				h1->opp = h0;
34
	}
34
		}
35
 
35
 
36
	float length(HalfEdgeIter h)
36
		float length(HalfEdgeIter h)
37
	{
37
		{
38
		return (h->vert->pos-h->opp->vert->pos).length();
38
				return (h->vert->pos-h->opp->vert->pos).length();
-
 
39
		}
-
 
40
 
-
 
41
		
-
 
42
		template struct HalfEdge_template<Iters>;
-
 
43
 
-
 
44
		HalfEdgeIter get_null_halfedge_iter()
-
 
45
		{
-
 
46
				static HalfEdgeList l;
-
 
47
				return l.end();
39
	}
48
		}
40
 
49
 
41
 
50
 
42
}
51
}