-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File: SolveSpaceSolver_Solver.cpp
-// Created: 07 May 2014
-// Author: Artem ZHIDKOV
+// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#include "SolveSpaceSolver_Solver.h"
#include <Events_LongOp.h>
//if (myEquationsSystem.constraints <= 0)
// return STATUS_EMPTYSET;
- myEquationsSystem.calculateFaileds = myFindFaileds ? 1 : 0;
+ myEquationsSystem.calculateFaileds = 0;
+ if (myFindFaileds) {
+ myEquationsSystem.calculateFaileds = 1;
+ myEquationsSystem.faileds = myEquationsSystem.constraints;
+ }
Events_LongOp::start(this);
- Slvs_Solve(&myEquationsSystem, myGroup);
+ Slvs_Solve(&myEquationsSystem, (Slvs_hGroup)myGroup);
Events_LongOp::end(this);
SketchSolver_SolveStatus aStatus;
}
return false;
}
+
+bool SolveSpaceSolver_Solver::isConflicting(const ConstraintID& theConstraint) const
+{
+ for (int i = 0; i < myEquationsSystem.faileds; ++i)
+ if (myEquationsSystem.failed[i] == (Slvs_hConstraint)theConstraint)
+ return true;
+ return false;
+}
+
+int SolveSpaceSolver_Solver::dof() const
+{
+ return myEquationsSystem.dof;
+}