From 788c0cd3fc7de0b3d91ab9c8bc6e1ee2243f09fc Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 24 Sep 2015 09:29:00 +0300 Subject: [PATCH] Make workplane and its parameters external --- src/SketchSolver/SketchSolver_Group.cpp | 6 +++--- src/SketchSolver/SketchSolver_Solver.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/SketchSolver/SketchSolver_Group.cpp b/src/SketchSolver/SketchSolver_Group.cpp index cc60f0c25..aeac2ebea 100644 --- a/src/SketchSolver/SketchSolver_Group.cpp +++ b/src/SketchSolver/SketchSolver_Group.cpp @@ -76,7 +76,7 @@ private: static Slvs_hGroup myGroupIndex; ///< index of the group }; -Slvs_hGroup GroupIndexer::myGroupIndex = 0; +Slvs_hGroup GroupIndexer::myGroupIndex = SLVS_G_OUTOFGROUP; static void sendMessage(const char* theMessageName) @@ -500,13 +500,13 @@ bool SketchSolver_Group::updateWorkplane() std::vector::iterator aParIter = aParams.begin(); for (; aParIter != aParams.end(); aParIter++) { aParIter->h = SLVS_E_UNKNOWN; // the ID should be generated by storage - aParIter->group = myID; + aParIter->group = SLVS_G_OUTOFGROUP; aParIter->h = myStorage->addParameter(*aParIter); } std::vector::iterator anEntIter = anEntities.begin(); for (; anEntIter != anEntities.end(); anEntIter++) { anEntIter->h = SLVS_E_UNKNOWN; // the ID should be generated by storage - anEntIter->group = myID; + anEntIter->group = SLVS_G_OUTOFGROUP; anEntIter->wrkpl = myWorkplaneID; for (int i = 0; i < 4; i++) if (anEntIter->param[i] != SLVS_E_UNKNOWN) diff --git a/src/SketchSolver/SketchSolver_Solver.h b/src/SketchSolver/SketchSolver_Solver.h index f90d71fd2..52ac18f98 100644 --- a/src/SketchSolver/SketchSolver_Solver.h +++ b/src/SketchSolver/SketchSolver_Solver.h @@ -34,6 +34,8 @@ typedef unsigned int UINT32; #define SLVS_E_UNKNOWN 0 // Unknown group #define SLVS_G_UNKNOWN 0 +// Group ID to store external objects +#define SLVS_G_OUTOFGROUP 1 /** * The main class that performs the high-level operations for connection to the SolveSpace. -- 2.39.2