- void resolveConstraints();
-
-private:
- class SketchSolver_ConstraintGroup;
-
- /** \brief Searches list of groups which interact with specified constraint
- * \param[in] theConstraint constraint to be found
- * \param[out] theGroups list of group indexes interacted with constraint
- */
- void findGroups(boost::shared_ptr<SketchPlugin_Constraint> theConstraint,
- std::set<Slvs_hGroup>& theGroupIDs) const;
-
- /** \brief Searches in the list of groups the workplane which constains specified constraint
- * \param[in] theConstraint constraint to be found
- * \return workplane containing the constraint
- */
- boost::shared_ptr<SketchPlugin_Feature> findWorkplaneForConstraint(
- boost::shared_ptr<SketchPlugin_Constraint> theConstraint) const;
-
-private:
- static SketchSolver_ConstraintManager* _self; ///< Self pointer to implement singleton functionality
- std::vector<SketchSolver_ConstraintGroup*> myGroups; ///< Groups of constraints
-};
-
-
-/** \class SketchSolver_ConstraintGroup
- * \ingroup DataModel
- * \brief Keeps the group of constraints which based on the same entities
- */
-class SketchSolver_ConstraintManager::SketchSolver_ConstraintGroup
-{
-public:
- /** \brief New group based on specified workplane.
- * Throws an exception if theWorkplane is not an object of SketchPlugin_Sketch type
- * \remark Type of theSketch is not verified inside
- */
- SketchSolver_ConstraintGroup(boost::shared_ptr<SketchPlugin_Feature> theWorkplane);
-
- ~SketchSolver_ConstraintGroup();
-
- /// \brief Returns group's unique identifier
- inline const Slvs_hGroup& getId() const
- {return myID;}
-
- /// \brief Returns true if the group has no constraints yet
- inline bool isEmpty() const
- {return myConstraints.empty();}
-
- /** \brief Adds or updates a constraint in the group
- * \param[in] theConstraint constraint to be changed
- * \return \c true if the constraint added or updated successfully
- */
- bool changeConstraint(boost::shared_ptr<SketchPlugin_Constraint> theConstraint);
-
- /** \brief Verifies the constraint uses the objects from this group
- * \param[in] theConstraint constraint for verification of interaction
- * \return \c true if the constrained objects are used in current group
- */
- bool isInteract(boost::shared_ptr<SketchPlugin_Constraint> theConstraint) 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
- * \return \c true if workplanes are the same
- */
- bool isBaseWorkplane(boost::shared_ptr<SketchPlugin_Feature> theWorkplane) const;