From 84d037cc4b22417b816eb918e8bdbc6f6545c44c Mon Sep 17 00:00:00 2001 From: Shai Seger Date: Sun, 22 Oct 2017 23:43:39 +0300 Subject: [PATCH] debugging wip --- src/Mod/Path/PathSimulator/App/PathSim.cpp | 5 ++++- src/Mod/Path/PathSimulator/App/PathSimPyImp.cpp | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Mod/Path/PathSimulator/App/PathSim.cpp b/src/Mod/Path/PathSimulator/App/PathSim.cpp index ce950db858..c7e0a7eabc 100644 --- a/src/Mod/Path/PathSimulator/App/PathSim.cpp +++ b/src/Mod/Path/PathSimulator/App/PathSim.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include "PathSim.h" //#include "VolSim.h" @@ -58,7 +59,8 @@ PathSim::~PathSim() void PathSim::BeginSimulation(Part::TopoShape * stock, float resolution) { Base::BoundBox3d & bbox = stock->getBoundBox(); - m_stock = new cStock(bbox.MinX, bbox.MinY, bbox.MinZ, bbox.LengthX(), bbox.LengthY(), bbox.LengthZ(), resolution); + //m_stock = new cStock(bbox.MinX, bbox.MinY, bbox.MinZ, bbox.LengthX(), bbox.LengthY(), bbox.LengthZ(), resolution); + m_stock = new cStock(0,0,0, bbox.LengthX(), bbox.LengthY(), bbox.LengthZ(), resolution); } void PathSim::SetCurrentTool(Tool * tool) @@ -77,6 +79,7 @@ void PathSim::SetCurrentTool(Tool * tool) break; } m_tool = new cSimTool(tp, tool->Diameter / 2.0, angle); + Base::Console().Log("Diam %f\n", tool->Diameter); } diff --git a/src/Mod/Path/PathSimulator/App/PathSimPyImp.cpp b/src/Mod/Path/PathSimulator/App/PathSimPyImp.cpp index 2979b4c4f7..ec71e17886 100644 --- a/src/Mod/Path/PathSimulator/App/PathSimPyImp.cpp +++ b/src/Mod/Path/PathSimulator/App/PathSimPyImp.cpp @@ -22,13 +22,15 @@ #include "PreCompiled.h" -#include "Mod/Path/PathSimulator/App/PathSim.h" #include #include #include #include +#include #include +#include #include +#include "Mod/Path/PathSimulator/App/PathSim.h" // inclusion of the generated files (generated out of PathSimPy.xml) #include "PathSimPy.h" @@ -72,7 +74,8 @@ PyObject* PathSimPy::BeginSimulation(PyObject * args, PyObject * kwds) PyObject* PathSimPy::SetCurrentTool(PyObject * args) { PyObject *pObjTool; - if (!PyArg_ParseTuple(args, "O!", &(Path::ToolPy::Type), &pObjTool)) + //Path::ToolPy tptmp(new Path::Tool); + if (!PyArg_ParseTuple(args, "O", /*tptmp.GetType(),*/ &pObjTool)) return 0; PathSim *sim = getPathSimPtr(); sim->SetCurrentTool(static_cast(pObjTool)->getToolPtr()); @@ -98,7 +101,7 @@ PyObject* PathSimPy::ApplyCommand(PyObject * args, PyObject * kwds) static char *kwlist[] = { "position", "command", NULL }; PyObject *pObjPlace; PyObject *pObjCmd; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!O!", kwlist, &(Base::PlacementPy::Type), &pObjPlace, &(Path::CommandPy::Type), &pObjCmd)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!O", kwlist, &(Base::PlacementPy::Type), &pObjPlace, /*&(Path::CommandPy::Type),*/ &pObjCmd)) return 0; PathSim *sim = getPathSimPtr(); Base::Placement *pos = static_cast(pObjPlace)->getPlacementPtr();