X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_Solver.cpp;h=975588bbb18084947a2bbcdeb457c1f68864f614;hb=cdd9efd8fbc75f120188ae16eed7471dc6492ac3;hp=b91d267f61b4625b1402b314787a0253a0850d66;hpb=96ff1d1fb2acb842cee193f15492de81060a1d58;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_Solver.cpp b/src/SketchSolver/SketchSolver_Solver.cpp index b91d267f6..975588bbb 100644 --- a/src/SketchSolver/SketchSolver_Solver.cpp +++ b/src/SketchSolver/SketchSolver_Solver.cpp @@ -30,21 +30,21 @@ SketchSolver_Solver::SketchSolver_Solver() SketchSolver_Solver::~SketchSolver_Solver() { if (myEquationsSystem.param) - delete [] myEquationsSystem.param; + delete[] myEquationsSystem.param; if (myEquationsSystem.entity) - delete [] myEquationsSystem.entity; + delete[] myEquationsSystem.entity; if (myEquationsSystem.constraint) - delete [] myEquationsSystem.constraint; + delete[] myEquationsSystem.constraint; if (myEquationsSystem.failed) - delete [] myEquationsSystem.failed; + delete[] myEquationsSystem.failed; } void SketchSolver_Solver::setParameters(const std::vector& theParameters) { - if (theParameters.size() != myEquationsSystem.params) // number of parameters was changed => reallocate the memory - { + if (theParameters.size() != myEquationsSystem.params) // number of parameters was changed => reallocate the memory + { if (myEquationsSystem.param) - delete [] myEquationsSystem.param; + delete[] myEquationsSystem.param; myEquationsSystem.params = theParameters.size(); myEquationsSystem.param = new Slvs_Param[theParameters.size()]; } @@ -57,8 +57,7 @@ void SketchSolver_Solver::setParameters(const std::vector& theParame void SketchSolver_Solver::setDraggedParameters(const std::vector& theDragged) { - if (theDragged.size() == 0) - { + if (theDragged.size() == 0) { myEquationsSystem.dragged[0] = 0; myEquationsSystem.dragged[1] = 0; myEquationsSystem.dragged[2] = 0; @@ -71,10 +70,10 @@ void SketchSolver_Solver::setDraggedParameters(const std::vector& t void SketchSolver_Solver::setEntities(const std::vector& theEntities) { - if (theEntities.size() != myEquationsSystem.entities) // number of entities was changed => reallocate the memory - { + if (theEntities.size() != myEquationsSystem.entities) // number of entities was changed => reallocate the memory + { if (myEquationsSystem.entity) - delete [] myEquationsSystem.entity; + delete[] myEquationsSystem.entity; myEquationsSystem.entities = theEntities.size(); myEquationsSystem.entity = new Slvs_Entity[theEntities.size()]; } @@ -87,16 +86,16 @@ void SketchSolver_Solver::setEntities(const std::vector& theEntitie void SketchSolver_Solver::setConstraints(const std::vector& theConstraints) { - if (theConstraints.size() != myEquationsSystem.constraints) // number of constraints was changed => reallocate the memory - { + if (theConstraints.size() != myEquationsSystem.constraints) // number of constraints was changed => reallocate the memory + { if (myEquationsSystem.constraint) - delete [] myEquationsSystem.constraint; + delete[] myEquationsSystem.constraint; myEquationsSystem.constraints = theConstraints.size(); myEquationsSystem.constraint = new Slvs_Constraint[theConstraints.size()]; // Assign the memory for the failed constraints if (myEquationsSystem.failed) - delete [] myEquationsSystem.failed; + delete[] myEquationsSystem.failed; myEquationsSystem.failed = new Slvs_hConstraint[theConstraints.size()]; myEquationsSystem.faileds = theConstraints.size(); } @@ -125,13 +124,12 @@ bool SketchSolver_Solver::getResult(std::vector& theParameters) return false; if (theParameters.size() != myEquationsSystem.params) - return false; // number of parameters is not the same + return false; // number of parameters is not the same std::vector::iterator aParamIter = theParameters.begin(); - for (int i = 0; i < myEquationsSystem.params; i++, aParamIter++) - { + for (int i = 0; i < myEquationsSystem.params; i++, aParamIter++) { if (myEquationsSystem.param[i].h != aParamIter->h) - return false; // sequence of parameters was changed + return false; // sequence of parameters was changed aParamIter->val = myEquationsSystem.param[i].val; }