From 45f44a2d9fa7c1ead2c7b5fa4d4a6a6207c33893 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Fri, 3 May 2019 14:23:07 +0200 Subject: [PATCH] Path: PathSimulator PCH --- src/Mod/Path/PathSimulator/App/PathSim.cpp | 11 +++++------ src/Mod/Path/PathSimulator/App/PreCompiled.h | 3 +++ src/Mod/Path/PathSimulator/App/VolSim.cpp | 20 ++++++++++++-------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/Mod/Path/PathSimulator/App/PathSim.cpp b/src/Mod/Path/PathSimulator/App/PathSim.cpp index 2901c13d3a..64afa13f67 100644 --- a/src/Mod/Path/PathSimulator/App/PathSim.cpp +++ b/src/Mod/Path/PathSimulator/App/PathSim.cpp @@ -24,10 +24,9 @@ #include "PreCompiled.h" #ifndef _PreComp_ +# include #endif -#include - #include #include #include @@ -81,7 +80,7 @@ void PathSim::SetCurrentTool(Tool * tool) case Tool::DRILL: tp = cSimTool::CHAMFER; angle = tool->CuttingEdgeAngle; - if (angle > 180) + if (angle > 180) { angle = 180; } @@ -89,7 +88,7 @@ void PathSim::SetCurrentTool(Tool * tool) case Tool::CENTERDRILL: tp = cSimTool::CHAMFER; angle = tool->CuttingEdgeAngle; - if (angle > 180) + if (angle > 180) { angle = 180; } @@ -107,7 +106,7 @@ void PathSim::SetCurrentTool(Tool * tool) case Tool::ENGRAVER: tp = cSimTool::CHAMFER; angle = tool->CuttingEdgeAngle; - if (angle > 180) + if (angle > 180) { angle = 180; } @@ -155,4 +154,4 @@ Base::Placement * PathSim::ApplyCommand(Base::Placement * pos, Command * cmd) - + diff --git a/src/Mod/Path/PathSimulator/App/PreCompiled.h b/src/Mod/Path/PathSimulator/App/PreCompiled.h index 26a5c80c0e..830cacf252 100644 --- a/src/Mod/Path/PathSimulator/App/PreCompiled.h +++ b/src/Mod/Path/PathSimulator/App/PreCompiled.h @@ -58,6 +58,9 @@ #include #include +// Boost +#include + // Xerces #include diff --git a/src/Mod/Path/PathSimulator/App/VolSim.cpp b/src/Mod/Path/PathSimulator/App/VolSim.cpp index 1a95a4de5f..9619d43f3a 100644 --- a/src/Mod/Path/PathSimulator/App/VolSim.cpp +++ b/src/Mod/Path/PathSimulator/App/VolSim.cpp @@ -21,7 +21,11 @@ ***************************************************************************/ #include "PreCompiled.h" -#include + +#ifndef _PreComp_ +# include +#endif + #include "VolSim.h" //************************************************************************************************************ @@ -103,7 +107,7 @@ float cStock::FindRectTop(int & xp, int & yp, int & x_size, int & y_size, bool s } } - // sweep up y direction + // sweep up y direction if (yu_ok) { int ty = yp + y_size; @@ -124,7 +128,7 @@ float cStock::FindRectTop(int & xp, int & yp, int & x_size, int & y_size, bool s } } - // sweep down y direction + // sweep down y direction if (yd_ok) { int ty = yp - 1; @@ -249,7 +253,7 @@ void cStock::FindRectBot(int & xp, int & yp, int & x_size, int & y_size, bool sc } } - // sweep up y direction + // sweep up y direction if (yu_ok) { int ty = yp + y_size; @@ -270,7 +274,7 @@ void cStock::FindRectBot(int & xp, int & yp, int & x_size, int & y_size, bool sc } } - // sweep down y direction + // sweep down y direction if (yd_ok) { int ty = yp - 1; @@ -552,7 +556,7 @@ void cStock::ApplyLinearTool(Point3D & p1, Point3D & p2, cSimTool & tool) for (float r = 0.5f; r <= rad; r += (float)SIM_WALK_RES) { Point3D cupCirc(perpDirX * r, perpDirY * r, pi2.z); - float rotang = 180 * SIM_WALK_RES / (3.1415926535 * r); + float rotang = 180 * SIM_WALK_RES / (3.1415926535 * r); cupCirc.SetRotationAngle(-rotang); float z = pi2.z + tool.GetToolProfileAt(r / rad); for (float a = 0; a < cupAngle; a += rotang) @@ -593,7 +597,7 @@ void cStock::ApplyCircularTool(Point3D & p1, Point3D & p2, Point3D & cent, cSimT cpx += pi1.x; cpy += pi1.y; double eang = atan2(pi2.y - cpy, pi2.x - cpx); // end angle - + double ang = eang - sang; if (!isCCW && ang > 0) ang -= 2 * 3.1415926; @@ -609,7 +613,7 @@ void cStock::ApplyCircularTool(Point3D & p1, Point3D & p2, Point3D & cent, cSimT { cupCirc.x = xynorm.x * r; cupCirc.y = xynorm.y * r; - float rotang = (float)SIM_WALK_RES / r; + float rotang = (float)SIM_WALK_RES / r; int ndivs = (int)(ang / rotang) + 1; if (!isCCW) rotang = -rotang;