Salome HOME
Remove extra files
[modules/shaper.git] / src / SketchSolver / SketchSolver_Group.h
index a8c09c2ac88349621d9f0e7763abc3a1062a2f74..9312c6a5a0a43eb5bedfd788fd0c70d4f2f37347 100644 (file)
@@ -13,9 +13,7 @@
 #include <SketchSolver_ISolver.h>
 
 #include <SketchPlugin_Constraint.h>
-////#include <ModelAPI_Data.h>
 #include <ModelAPI_Feature.h>
-////#include <ModelAPI_AttributeRefList.h>
 
 #include <memory>
 #include <list>
@@ -63,8 +61,11 @@ class SketchSolver_Group
     return mySketch->data() && mySketch->data()->isValid();
   }
 
-  /// \brief Verifies the constraint is complex, i.e. it needs another constraints to be created before
-  static bool isComplexConstraint(FeaturePtr theConstraint);
+  /// \brief Check the group has conflicting constraints
+  inline bool isFailed() const
+  {
+    return !myConflictingConstraints.empty();
+  }
 
   /** \brief Adds or updates a constraint in the group
    *  \param[in] theConstraint constraint to be changed
@@ -80,8 +81,9 @@ class SketchSolver_Group
   /** \brief Updates the data corresponding the specified feature moved in GUI.
    *         Additional Fixed constraints are created.
    *  \param[in] theFeature the feature to be updated
+   *  \return \c true, if the feature is moved
    */
-  void moveFeature(FeaturePtr theFeature);
+  bool moveFeature(FeaturePtr theFeature);
 
   /** \brief Verifies the feature attributes are used in this group
    *  \param[in] theFeature constraint or any other object for verification of interaction
@@ -102,7 +104,8 @@ class SketchSolver_Group
   }
 
   /** \brief Update parameters of workplane. Should be called when Update event is coming.
-   *  \return \c true if workplane updated successfully, \c false if workplane parameters are not consistent
+   *  \return \c true if workplane updated successfully, 
+   *  \c false if workplane parameters are not consistent
    */
   bool updateWorkplane();
 
@@ -116,7 +119,8 @@ class SketchSolver_Group
    */
   void mergeGroups(const SketchSolver_Group& theGroup);
 
-  /** \brief Cut from the group several subgroups, which are not connected to the current one by any constraint
+  /** \brief Cut from the group several subgroups, which are not connected to 
+   * the current one by any constraint
    *  \param[out] theCuts enlarge this list by newly created groups
    */
   void splitGroup(std::list<SketchSolver_Group*>& theCuts);
@@ -154,11 +158,9 @@ private:
   /// \brief Verifies is the feature valid
   bool checkFeatureValidity(FeaturePtr theFeature);
 
-  /// \brief Update just changed constraints
-  void updateConstraints();
-
-  /// \brief Update Multi-Translation/-Rotation constraints due to multi coincidence appears/disappears
-  void notifyMultiConstraints();
+  /// \brief Notify all interested constraints that coincidence appears or removed
+  /// \param[in] theCoincidence  coincidence constraint
+  void notifyCoincidenceChanged(SolverConstraintPtr theCoincidence);
 
 private:
   GroupID  myID; ///< Index of the group
@@ -166,14 +168,17 @@ private:
   CompositeFeaturePtr mySketch; ///< Sketch is equivalent to workplane
   ConstraintConstraintMap myConstraints; ///< List of constraints
   std::set<SolverConstraintPtr> myTempConstraints; ///< List of temporary constraints
-  std::map<AttributePtr, SolverConstraintPtr> myParametricConstraints; ///< List of parametric constraints
-  std::set<ConstraintPtr> myChangedConstraints; ///< List of just updated constraints
+
+  /// List of parametric constraints
+  std::map<AttributePtr, SolverConstraintPtr> myParametricConstraints; 
 
   StoragePtr myStorage; ///< Container for the set of SolveSpace constraints and their entities
 
   SolverPtr mySketchSolver;  ///< Solver for set of equations obtained by constraints
 
-  bool myPrevSolved; ///< Indicates that previous solving was done correctly
+  /// Result of previous solution of the set of constraints
+  SketchSolver_SolveStatus myPrevResult; 
+  std::set<ObjectPtr>      myConflictingConstraints; ///< List of conflicting constraints
 };
 
 #endif