Salome HOME
Pipe validator fix
[modules/shaper.git] / src / SketchSolver / SketchSolver_Group.h
index 36bd337399dc6e7ae2daa04fd78fa2ff2f59913f..89a14f49072f636f22721367182e52d385c498a5 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
@@ -75,19 +76,19 @@ class SketchSolver_Group
   /** \brief Updates the data corresponding the specified feature
    *  \param[in] theFeature the feature to be updated
    */
-  bool updateFeature(std::shared_ptr<SketchPlugin_Feature> theFeature);
+  bool updateFeature(FeaturePtr theFeature);
 
   /** \brief Updates the data corresponding the specified feature moved in GUI.
    *         Additional Fixed constraints are created.
    *  \param[in] theFeature the feature to be updated
    */
-  void moveFeature(std::shared_ptr<SketchPlugin_Feature> theFeature);
+  void 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
    *  \return \c true if some of attributes are used in current group
    */
-  bool isInteract(std::shared_ptr<SketchPlugin_Feature> theFeature) const;
+  bool isInteract(FeaturePtr theFeature) const;
 
   /** \brief Verifies the specified feature is equal to the base workplane for this group
    *  \param[in] theWorkplane the feature to be compared with base workplane
@@ -154,11 +155,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
@@ -167,13 +166,13 @@ private:
   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
 
   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
+  SketchSolver_SolveStatus myPrevResult; ///< Result of previous solution of the set of constraints
+  std::set<ObjectPtr>      myConflictingConstraints; ///< List of conflicting constraints
 };
 
 #endif