From 67a0bd4750c91c92a068629e5be42cea0d9f2ab7 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 18 Feb 2017 09:44:58 +0100 Subject: [PATCH] improve whitespaces --- src/Mod/Mesh/App/Core/Triangulation.cpp | 4 ++-- .../Robot/App/kdl_cp/velocityprofile_trap.cpp | 17 +++++++++-------- .../App/kdl_cp/velocityprofile_traphalf.cpp | 10 +++++----- src/Mod/Sketcher/App/SketchObject.cpp | 6 ++++-- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/Mod/Mesh/App/Core/Triangulation.cpp b/src/Mod/Mesh/App/Core/Triangulation.cpp index d0c20ee86..41f06e6b6 100644 --- a/src/Mod/Mesh/App/Core/Triangulation.cpp +++ b/src/Mod/Mesh/App/Core/Triangulation.cpp @@ -538,8 +538,8 @@ struct Vertex2d_EqualTo : public std::binary_function 1) - return; // do not exceed max + if (factor > 1) + return; // do not exceed max - a2*=factor; + a2*=factor; a3*=factor*factor; b2*=factor; b3*=factor*factor; @@ -111,11 +111,12 @@ void VelocityProfile_Trap::SetProfileDuration( void VelocityProfile_Trap::SetProfileVelocity( double pos1,double pos2,double newvelocity) { - // Max velocity + // Max velocity SetProfile(pos1,pos2); - // Must be Slower : + // Must be Slower : double factor = newvelocity; // valid = [KDL::epsilon, 1.0] - if (1.0 < factor) factor = 1.0; + if (1.0 < factor) + factor = 1.0; if (KDL::epsilon > factor) factor = KDL::epsilon; a2*=factor; a3*=factor*factor; diff --git a/src/Mod/Robot/App/kdl_cp/velocityprofile_traphalf.cpp b/src/Mod/Robot/App/kdl_cp/velocityprofile_traphalf.cpp index c587b2c14..9c17445b9 100644 --- a/src/Mod/Robot/App/kdl_cp/velocityprofile_traphalf.cpp +++ b/src/Mod/Robot/App/kdl_cp/velocityprofile_traphalf.cpp @@ -100,13 +100,13 @@ void VelocityProfile_TrapHalf::SetProfile(double pos1,double pos2) { void VelocityProfile_TrapHalf::SetProfileDuration( double pos1,double pos2,double newduration) { - SetProfile(pos1,pos2); - double factor = duration/newduration; + SetProfile(pos1,pos2); + double factor = duration/newduration; - if ( factor > 1 ) - return; + if ( factor > 1 ) + return; - double s = sign(endpos-startpos); + double s = sign(endpos-startpos); double tmp = 2.0*s*(endpos-startpos)/maxvel; double v = s*maxvel; duration = newduration; diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index e39f886cc..7de4bb614 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -3097,13 +3097,15 @@ int SketchObject::ExposeInternalGeometry(int GeoId) this->addGeometry(igeo,true); this->addConstraints(icon); - for (std::vector::iterator it=igeo.begin(); it != igeo.end(); ++it) + for (std::vector::iterator it=igeo.begin(); it != igeo.end(); ++it) { if (*it) delete *it; + } - for (std::vector::iterator it=icon.begin(); it != icon.end(); ++it) + for (std::vector::iterator it=icon.begin(); it != icon.end(); ++it) { if (*it) delete *it; + } icon.clear(); igeo.clear();