From ca9bbde2dd7f753848faedc09366325bfce12276 Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Wed, 29 Mar 2006 07:30:54 +0000 Subject: [PATCH] use fabs instead of abs for floats, needed for gcc 3.4.5 --- src/meshlabplugins/meshfilter/decimator.h | 9 ++++++--- src/meshlabplugins/meshfilter/transformDialog.cpp | 7 +++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/meshlabplugins/meshfilter/decimator.h b/src/meshlabplugins/meshfilter/decimator.h index beee649d2..a50659a25 100644 --- a/src/meshlabplugins/meshfilter/decimator.h +++ b/src/meshlabplugins/meshfilter/decimator.h @@ -24,6 +24,9 @@ History $Log$ +Revision 1.3 2006/03/29 07:30:54 zifnab1974 +use fabs instead of abs for floats, needed for gcc 3.4.5 + Revision 1.2 2006/01/31 14:44:41 mariolatronico removed unused and commented old code @@ -114,13 +117,13 @@ namespace vcg{ Point3f tras = Cmin; tras.Zero(); if ( Cmin.X() < 0.00000001 ) { - tras.X() =abs( Cmin.X()); + tras.X() = fabs( Cmin.X()); } if ( Cmin.Y() < 0.00000001 ) { - tras.Y() = abs(Cmin.Y()); + tras.Y() = fabs(Cmin.Y()); } if ( Cmin.Z() < 0.00000001 ) { - tras.Z() = abs(Cmin.Z()); + tras.Z() = fabs(Cmin.Z()); } //Passo di divisione per ogni asse della bounding box diff --git a/src/meshlabplugins/meshfilter/transformDialog.cpp b/src/meshlabplugins/meshfilter/transformDialog.cpp index fa224c03d..e66b055f0 100644 --- a/src/meshlabplugins/meshfilter/transformDialog.cpp +++ b/src/meshlabplugins/meshfilter/transformDialog.cpp @@ -26,6 +26,9 @@ /* $Log$ +Revision 1.3 2006/03/29 07:30:54 zifnab1974 +use fabs instead of abs for floats, needed for gcc 3.4.5 + Revision 1.2 2006/01/31 18:24:44 mariolatronico - dial updated only if rotate line edit has non negative numbers. This allows negative numbers on rotate line edit @@ -235,8 +238,8 @@ void TransformDialog::on_mvCenterOriginPB_clicked() { // scale to unit box void TransformDialog::on_scaleUnitPB_clicked() { // get the bounding box longest edge - float scale =1.0 / (float)( max(abs(maxBbox[0] - minBbox[0]), - max(abs(maxBbox[1] - minBbox[1]), abs(maxBbox[2] - minBbox[2])))); + float scale =1.0 / (float)( max(fabs(maxBbox[0] - minBbox[0]), + max(fabs(maxBbox[1] - minBbox[1]), fabs(maxBbox[2] - minBbox[2])))); setScale(QString().setNum(scale), QString().setNum(scale), QString().setNum(scale)); } // do the real calculations