Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / SketchSolver / SketchSolver_Solver.h
index 944a58e69354102e1d694b7c6efbb314ea175a5f..8bdc566f0c733691d69e24d1ee3b30ae22961ffc 100644 (file)
@@ -2,8 +2,8 @@
 // Created: 07 May 2014
 // Author:  Artem ZHIDKOV
 
-#ifndef SketchSolver_Solver_Headerfile
-#define SketchSolver_Solver_Headerfile
+#ifndef SketchSolver_Solver_H_
+#define SketchSolver_Solver_H_
 
 #include "SketchSolver.h"
 
@@ -18,20 +18,25 @@ typedef unsigned int UINT32;
 
 #include <vector>
 
-
 #define SLVS_RESULT_EMPTY_SET -1
 
+// Unknown constraint (for error reporting)
+#define SLVS_C_UNKNOWN 0
+// Unknown entity
+#define SLVS_E_UNKNOWN 0
 
 class SketchSolver_Solver
 {
-public:
+ public:
   SketchSolver_Solver();
   ~SketchSolver_Solver();
 
   /** \brief Initialize the ID of the group
    */
   inline void setGroupID(Slvs_hGroup theGroupID)
-  { myGroupID = theGroupID; }
+  {
+    myGroupID = theGroupID;
+  }
 
   /** \brief Change array of parameters
    *  \param[in] theParameters vector of parameters
@@ -48,6 +53,12 @@ public:
    */
   void setConstraints(const std::vector<Slvs_Constraint>& theConstraints);
 
+  /** \brief Store the parameters of the point which was moved by user.
+   *         The solver will watch this items to be constant
+   *  \param[in] theDragged list of parameters (not more than 4) which should not be changed during solving
+   */
+  void setDraggedParameters(const std::vector<Slvs_hParam>& theDragged);
+
   /** \brief Solve the set of equations
    *  \return identifier whether solution succeeded
    */
@@ -59,9 +70,9 @@ public:
    */
   bool getResult(std::vector<Slvs_Param>& theParameters);
 
-private:
+ private:
   Slvs_hGroup myGroupID;         ///< identifier of the group to be solved
-  Slvs_System myEquationsSystem; ///< set of equations for solving in SolveSpace
+  Slvs_System myEquationsSystem;  ///< set of equations for solving in SolveSpace
 };
 
 #endif