Salome HOME
Fix compilation error on Linux
[modules/shaper.git] / src / SketchSolver / SketchSolver_Manager.h
index 6883cd44877d27e2eded0acde185eeb3f7ecb63d..0781129c0f2c43cb1e0aae70299e4ef18115220c 100644 (file)
@@ -14,7 +14,7 @@
 #include <Events_Listener.h>
 #include <SketchPlugin_Constraint.h>
 
-#include <vector>
+#include <list>
 #include <set>
 
 /** \class   SketchSolver_Manager
@@ -83,9 +83,10 @@ protected:
   void moveEntity(std::shared_ptr<SketchPlugin_Feature> theFeature);
 
   /** \brief Goes through the list of groups and solve the constraints
+   *  \param[in] theGroups  list of groups to be resolved (if empty list, all groups are resolved)
    *  \return \c true, if groups are resolved, and features should be updated (send the Update event)
    */
-  bool resolveConstraints();
+  bool resolveConstraints(const std::list<SketchSolver_Group*>& theGroups = std::list<SketchSolver_Group*>());
 
 private:
   /** \brief Searches list of groups which interact with specified feature
@@ -108,13 +109,22 @@ private:
   /// \brief Allow to send the Update event
   void allowSendUpdate() const;
 
+  /// \brief If the message shows that any group is repaired after conflicting,
+  ///        find other groups on the same sketch, which have conflicts.
+  void checkConflictingConstraints(const std::shared_ptr<Events_Message>& theMessage);
+
+  /// \brief Calculate DoF for each sketch and send messages if changed
+  void degreesOfFreedom();
+
 private:
   static SketchSolver_Manager*     mySelf;    ///< Self pointer to implement singleton functionality
-  std::vector<SketchSolver_Group*> myGroups;  ///< Groups of constraints
+  std::list<SketchSolver_Group*>   myGroups;  ///< Groups of constraints
   BuilderPtr                       myBuilder; ///< Builder for solver's entities
   /// true if computation is performed and all "updates" are generated by this algo
   /// and needs no recomputation
   bool myIsComputed;
+
+  std::map<CompositeFeaturePtr, int> myDoF; ///< Degree of freedom for corresponding sketch
 };
 
 #endif