Subversion Repositories gelsvn

Rev

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

Rev 643 Rev 646
Line 49... Line 49...
49
    private:
49
    private:
50
        iterator begin_;
50
        iterator begin_;
51
        iterator end_;
51
        iterator end_;
52
    };
52
    };
53
 
53
 
-
 
54
    typedef std::vector<std::vector<VertexID>> VertexIDBatches;
54
 
55
    
55
 
56
 
56
    
57
    
57
    void for_each_vertex(Manifold& m, function<void(VertexID)> f) { for(auto v : m.vertices()) f(v); }
58
    void for_each_vertex(Manifold& m, function<void(VertexID)> f) { for(auto v : m.vertices()) f(v); }
58
    void for_each_face(Manifold& m, function<void(FaceID)> f) { for(auto p : m.faces()) f(p); }
59
    void for_each_face(Manifold& m, function<void(FaceID)> f) { for(auto p : m.faces()) f(p); }
59
    void for_each_halfedge(Manifold& m, function<void(HalfEdgeID)> f) { for(auto h : m.halfedges()) f(h); }
60
    void for_each_halfedge(Manifold& m, function<void(HalfEdgeID)> f) { for(auto h : m.halfedges()) f(h); }
Line 206... Line 207...
206
            swap(m.positions_attribute_vector(), new_pos);
207
            swap(m.positions_attribute_vector(), new_pos);
207
        }
208
        }
208
        
209
        
209
    }
210
    }
210
    
211
    
211
    typedef vector<vector<VertexID>> VertexIDBatches;
-
 
212
    
212
    
213
//    template<typename  T>
213
//    template<typename  T>
214
//    void for_each_vertex_parallel(int no_threads, const VertexIDBatches& batches, const T& f) {
214
//    void for_each_vertex_parallel(int no_threads, const VertexIDBatches& batches, const T& f) {
215
//        vector<future<void>> f_vec(no_threads);
215
//        vector<future<void>> f_vec(no_threads);
216
//        for(auto t : range(0, no_threads))
216
//        for(auto t : range(0, no_threads))
Line 249... Line 249...
249
            for_each_vertex_parallel(CORES, vertex_ids, f);
249
            for_each_vertex_parallel(CORES, vertex_ids, f);
250
            swap(m.positions_attribute_vector(), new_pos);
250
            swap(m.positions_attribute_vector(), new_pos);
251
        }
251
        }
252
    }
252
    }
253
 
253
 
254
 
254
 
255
 
255
 
256
 
256
 
257
    void laplacian_smooth(Manifold& m,float weight, int max_iter)
257
    void laplacian_smooth(Manifold& m,float weight, int max_iter)
258
    {
258
    {
259
//        laplacian_smooth_example(m);
259
//        laplacian_smooth_example(m);
Line 346... Line 346...
346
 
346
 
347
 
347
 
348
    }
348
    }
349
 
349
 
350
    
350
    
-
 
351
 
351
    
352
    
352
    
353
    
353
    void taubin_smooth(Manifold& m, int max_iter)
354
    void taubin_smooth(Manifold& m, int max_iter)
354
    {
355
    {
355
        auto new_pos = m.positions_attribute_vector();
356
        auto new_pos = m.positions_attribute_vector();