From 33bab2157f1aa92432fe5d0b659b9d43e79936db Mon Sep 17 00:00:00 2001 From: cignoni Date: Tue, 23 Jul 2013 07:37:29 +0000 Subject: [PATCH] removed useless include from the tridecimator sample --- apps/tridecimator/tridecimator.cpp | 62 +++++++++++------------------- 1 file changed, 23 insertions(+), 39 deletions(-) diff --git a/apps/tridecimator/tridecimator.cpp b/apps/tridecimator/tridecimator.cpp index 02137a38..347723c2 100644 --- a/apps/tridecimator/tridecimator.cpp +++ b/apps/tridecimator/tridecimator.cpp @@ -1,26 +1,10 @@ -#include -#include - -#include -#include - - // stuff to define the mesh -#include -#include -#include #include -#include -#include - // io #include #include -// update -#include - // local optimization #include #include @@ -37,9 +21,9 @@ For edge collpases we need verteses with: - per vertex Normal -Moreover for using a quadric based collapse the vertex class +Moreover for using a quadric based collapse the vertex class must have also a Quadric member Q(); -Otherwise the user have to provide an helper function object +Otherwise the user have to provide an helper function object to recover the quadric. ******************************************************/ @@ -84,32 +68,32 @@ class MyTriEdgeCollapse: public vcg::tri::TriEdgeCollapseQuadric< MyMesh, Vertex void Usage() { - printf( + printf( "---------------------------------\n" " TriSimp V.1.0 \n" " http://vcg.isti.cnr.it\n" " http://vcg.sourceforge.net\n" " release date: "__DATE__"\n" "---------------------------------\n\n" - "TriDecimator 1.0 \n"__DATE__"\n" + "TriDecimator 1.0 \n"__DATE__"\n" "Copyright 2003-2012 Visual Computing Lab I.S.T.I. C.N.R.\n" "\nUsage: "\ "tridecimator fileIn fileOut face_num [opt]\n"\ "Where opt can be:\n"\ " -e# QuadricError threshold (range [0,inf) default inf)\n" - " -b# Boundary Weight (default .5)\n" - " -q# Quality threshold (range [0.0, 0.866], default .3 )\n" - " -n# Normal threshold (degree range [0,180] default 90)\n" - " -E# Minimal admitted quadric value (default 1e-15, must be >0)\n" - " -Q[y|n] Use or not Quality Threshold (default yes)\n" - " -N[y|n] Use or not Normal Threshold (default no)\n" - " -A[y|n] Use or not Area Weighted Quadrics (default yes)\n" - " -O[y|n] Use or not vertex optimal placement (default yes)\n" - " -S[y|n] Use or not Scale Independent quadric measure(default yes) \n" - " -B[y|n] Preserve or not mesh boundary (default no)\n" - " -T[y|n] Preserve or not Topology (default no)\n" - " -H[y|n] Use or not Safe Heap Update (default no)\n" - " -P Before simplification, remove duplicate & unreferenced vertices\n" + " -b# Boundary Weight (default .5)\n" + " -q# Quality threshold (range [0.0, 0.866], default .3 )\n" + " -n# Normal threshold (degree range [0,180] default 90)\n" + " -E# Minimal admitted quadric value (default 1e-15, must be >0)\n" + " -Q[y|n] Use or not Quality Threshold (default yes)\n" + " -N[y|n] Use or not Normal Threshold (default no)\n" + " -A[y|n] Use or not Area Weighted Quadrics (default yes)\n" + " -O[y|n] Use or not vertex optimal placement (default yes)\n" + " -S[y|n] Use or not Scale Independent quadric measure(default yes) \n" + " -B[y|n] Preserve or not mesh boundary (default no)\n" + " -T[y|n] Preserve or not Topology (default no)\n" + " -H[y|n] Use or not Safe Heap Update (default no)\n" + " -P Before simplification, remove duplicate & unreferenced vertices\n" ); exit(-1); } @@ -129,7 +113,7 @@ if(argc<4) Usage(); exit(-1); } printf("mesh loaded %d %d \n",mesh.vn,mesh.fn); - + TriEdgeCollapseQuadricParameter qparams; qparams.QualityThr =.3; float TargetError=std::numeric_limits::max(); @@ -175,12 +159,12 @@ if(argc<4) Usage(); printf("reducing it to %i\n",FinalSize); - + vcg::tri::UpdateBounding::Box(mesh); - + // decimator initialization vcg::LocalOptimization DeciSession(mesh,&qparams); - + int t1=clock(); DeciSession.Init(); int t2=clock(); @@ -196,8 +180,8 @@ if(argc<4) Usage(); int t3=clock(); printf("mesh %d %d Error %g \n",mesh.vn,mesh.fn,DeciSession.currMetric); printf("\nCompleted in (%i+%i) msec\n",t2-t1,t3-t2); - + vcg::tri::io::ExporterPLY::Save(mesh,argv[2]); - return 0; + return 0; }