X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_Group.h;h=9312c6a5a0a43eb5bedfd788fd0c70d4f2f37347;hb=176403004ff97696f3c0b5f8bdf48692177fb34a;hp=a8c09c2ac88349621d9f0e7763abc3a1062a2f74;hpb=e3483e0c2eaddb88f2e55a72bd81ca0fb67cc4ce;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_Group.h b/src/SketchSolver/SketchSolver_Group.h index a8c09c2ac..9312c6a5a 100644 --- a/src/SketchSolver/SketchSolver_Group.h +++ b/src/SketchSolver/SketchSolver_Group.h @@ -13,9 +13,7 @@ #include #include -////#include #include -////#include #include #include @@ -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& 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 myTempConstraints; ///< List of temporary constraints - std::map myParametricConstraints; ///< List of parametric constraints - std::set myChangedConstraints; ///< List of just updated constraints + + /// List of parametric constraints + std::map 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 myConflictingConstraints; ///< List of conflicting constraints }; #endif