From 904f0d9d3a8f923a60a91b5577acc7bc3ffbf9e3 Mon Sep 17 00:00:00 2001 From: granzuglia Date: Thu, 29 Apr 2010 09:33:05 +0000 Subject: [PATCH] updated callback function for ball pivoting. --- vcg/complex/trimesh/create/advancing_front.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vcg/complex/trimesh/create/advancing_front.h b/vcg/complex/trimesh/create/advancing_front.h index 76725dc6..6d23a0e0 100644 --- a/vcg/complex/trimesh/create/advancing_front.h +++ b/vcg/complex/trimesh/create/advancing_front.h @@ -74,20 +74,21 @@ template class AdvancingFront { virtual ScalarType radi() { return 0; } void BuildMesh(CallBackPos call = NULL, int interval = 512) { - while(1) { - if(call) call(0, "Advancing front"); + float finalfacesext = mesh.vert.size() * 2.0f; + if(call) call(0, "Advancing front"); + while(1) { + for(int i = 0; i < interval; i++) { if(!front.size() && !SeedFace()) return; AddFace(); if(call) { - float rap = float(i) / float(interval); + float rap = float(mesh.face.size()) / finalfacesext; int perc = (int) (100.0f * rap); - (*call)(perc,"Ball Pivoting Rolling: Adding Faces"); + (*call)(perc,"Adding Faces"); } } } - if (call) (*call)(100,"Complete"); } protected: