Subversion Repositories gelsvn

Rev

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

Rev 572 Rev 588
Line 11... Line 11...
11
    using namespace std;
11
    using namespace std;
12
 
12
 
13
    void ConnectivityKernel::cleanup(IDRemap& map)
13
    void ConnectivityKernel::cleanup(IDRemap& map)
14
    {
14
    {
15
        VertexID::IndexType vid = 0;
15
        VertexID::IndexType vid = 0;
16
        for(VertexID v = vertices_begin(); v != vertices_end(); v = vertices_next(v), ++vid)
16
        for(VertexID v = vertices.index_begin(); v != vertices.index_end(); v = vertices.index_next(v), ++vid)
17
            map.vmap[v] = VertexID(vid);
17
            map.vmap[v] = VertexID(vid);
18
 
18
 
19
        FaceID::IndexType fid = 0;
19
        FaceID::IndexType fid = 0;
20
        for(FaceID f = faces_begin(); f != faces_end(); f = faces_next(f), ++fid)
20
        for(FaceID f = faces.index_begin(); f != faces.index_end(); f = faces.index_next(f), ++fid)
21
            map.fmap[f] = FaceID(fid);
21
            map.fmap[f] = FaceID(fid);
22
 
22
 
23
        HalfEdgeID::IndexType hid = 0;
23
        HalfEdgeID::IndexType hid = 0;
24
        for(HalfEdgeID h = halfedges_begin(); h != halfedges_end(); h = halfedges_next(h), ++hid){
24
        for(HalfEdgeID h = halfedges.index_begin(); h != halfedges.index_end(); h = halfedges.index_next(h), ++hid){
25
            map.hmap[h] = HalfEdgeID(hid);
25
            map.hmap[h] = HalfEdgeID(hid);
26
        }
26
        }
27
 
27
 
28
        //2. update the connectivity kernel connectivity with the new locations
28
        //2. update the connectivity kernel connectivity with the new locations
29
        for(VertexID v = vertices_begin(); v != vertices_end(); v = vertices_next(v))
29
        for(VertexID v = vertices.index_begin(); v != vertices.index_end(); v = vertices.index_next(v))
30
            set_out(v, map.hmap[out(v)]);
30
            set_out(v, map.hmap[out(v)]);
31
 
31
 
32
        for(FaceID f = faces_begin(); f != faces_end(); f = faces_next(f))
32
        for(FaceID f = faces.index_begin(); f != faces.index_end(); f = faces.index_next(f))
33
            set_last(f, map.hmap[last(f)]);
33
            set_last(f, map.hmap[last(f)]);
34
 
34
 
35
        for(HalfEdgeID h = halfedges_begin(); h != halfedges_end(); h = halfedges_next(h)){ 
35
        for(HalfEdgeID h = halfedges.index_begin(); h != halfedges.index_end(); h = halfedges.index_next(h)){ 
36
            // do not update holes
36
            // do not update holes
37
            if(face(h) != InvalidFaceID)
37
            if(face(h) != InvalidFaceID)
38
                set_face(h, map.fmap[face(h)]);
38
                set_face(h, map.fmap[face(h)]);
39
            set_next(h, map.hmap[next(h)]);
39
            set_next(h, map.hmap[next(h)]);
40
            set_prev(h, map.hmap[prev(h)]);
40
            set_prev(h, map.hmap[prev(h)]);