X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_Group.h;h=193e1d54182391bfa0aa62f17d57b7b0f4392d73;hb=4f565b2204d3fba046aa8c851abada2a5a17bf6c;hp=7544fbaa2c7600d32348054ea90f37449e15ea96;hpb=ed721b9f1a622ab9134f908883a191fd34e4edc6;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_Group.h b/src/SketchSolver/SketchSolver_Group.h index 7544fbaa2..193e1d541 100644 --- a/src/SketchSolver/SketchSolver_Group.h +++ b/src/SketchSolver/SketchSolver_Group.h @@ -61,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 @@ -78,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 @@ -100,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(); @@ -114,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); @@ -152,19 +158,27 @@ private: /// \brief Verifies is the feature valid bool checkFeatureValidity(FeaturePtr theFeature); + /// \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 EntityID myWorkplaneID; ///< Index of workplane, the group is based on 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 + + /// 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 - SketchSolver_SolveStatus myPrevResult; ///< Result of previous solution of the set of constraints + /// Result of previous solution of the set of constraints + SketchSolver_SolveStatus myPrevResult; + std::set myConflictingConstraints; ///< List of conflicting constraints }; #endif