Salome HOME
crash fix: mirror (line, axis of sketch), select with rectangle, delete
[modules/shaper.git] / src / SketchSolver / PlaneGCSSolver / PlaneGCSSolver_Solver.h
index 605a9779442d8a3c46d26fe5d5a26b3a05b44d51..c2c463c5d41a9fd4954fd749832a975ceffc0241 100644 (file)
 #include <SketchSolver_ISolver.h>
 #include <PlaneGCSSolver_Defs.h>
 
-////// Need to be defined before including SolveSpace to avoid additional dependences on Windows platform
-////#if defined(WIN32) && !defined(HAVE_C99_INTEGER_TYPES)
-////typedef unsigned int UINT32;
-////#else
-////#include <stdint.h>
-////#endif
-////#include <string.h>
 #include <GCS.h>
 
-////#include <vector>
-
 /**
  * The main class that performs the high-level operations for connection to the PlaneGCS.
  */
@@ -48,10 +39,26 @@ public:
    */
   virtual SketchSolver_SolveStatus solve();
 
+  /// \brief Prepare for solving. Store initial values of parameters for undo
+  virtual void prepare()
+  { /* do nothing */ }
+
+  /// \brief Revert solution to initial values
+  virtual void undo();
+
+  /// \brief Check the constraint is conflicted with others
+  virtual bool isConflicting(const ConstraintID& theConstraint) const;
+
+private:
+  void collectConflicting();
+
 private:
   GCS::VEC_pD                myParameters;     ///< list of unknowns
   std::set<GCS::Constraint*> myConstraints;    ///< list of constraints already processed by the system
   GCS::System                myEquationSystem; ///< set of equations for solving in FreeGCS
+
+  GCS::VEC_I                 myConflictingIDs; ///< list of IDs of conflicting constraints
+  bool                       myConfCollected;  ///< specifies the conflicting constraints are already collected
 };
 
 #endif