From b2d20dd837f9e4d9be21868eb0cb29c43f3a3985 Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 30 Apr 2010 09:55:34 +0000 Subject: [PATCH] Removed printf and added the standard callback approach --- vcg/complex/trimesh/create/mc_trivial_walker.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vcg/complex/trimesh/create/mc_trivial_walker.h b/vcg/complex/trimesh/create/mc_trivial_walker.h index d2916a08..230419e4 100644 --- a/vcg/complex/trimesh/create/mc_trivial_walker.h +++ b/vcg/complex/trimesh/create/mc_trivial_walker.h @@ -163,7 +163,7 @@ private: {_thr=0;} template - void BuildMesh(MeshType &mesh, VolumeType &volume, EXTRACTOR_TYPE &extractor, const float threshold) + void BuildMesh(MeshType &mesh, VolumeType &volume, EXTRACTOR_TYPE &extractor, const float threshold, vcg::CallBackPos * cb=0) { Init(volume); _volume = &volume; @@ -175,7 +175,9 @@ private: Begin(); extractor.Initialize(); for (int j=_bbox.min.Y(); j<(_bbox.max.Y()-1)-1; j+=1) - { if((j%10)==0) printf("Marching volume z %i (%i ..%i)\r",j,_bbox.min.Y(),_bbox.max.Y()); + { + + if(cb && ((j%10)==0) ) cb(j*_bbox.DimY()/100.0,"Marching volume"); for (int i=_bbox.min.X(); i<(_bbox.max.X()-1)-1; i+=1) { @@ -340,4 +342,4 @@ protected: }; } // end namespace } // end namespace -#endif // __VCGTEST_WALKER \ No newline at end of file +#endif // __VCGTEST_WALKER