#include <ModelAPI_Feature.h>
#include <SketchPlugin_Constraint.h>
-
+class SketchSolver_ConstraintDistance;
+class SketchSolver_ConstraintFixedArcRadius;
typedef std::map<EntityWrapperPtr, std::set<EntityWrapperPtr> > CoincidentPointsMap;
/// \brief Remove all features became invalid
SKETCHSOLVER_EXPORT void removeInvalidEntities();
-//// /// \brief Mark specified constraint as temporary
-//// virtual void setTemporary(ConstraintPtr theConstraint) = 0;
-//// /// \brief Returns number of temporary constraints
-//// virtual size_t nbTemporary() const = 0;
-//// /// \brief Remove temporary constraints
-//// /// \param theNbConstraints [in] number of temporary constraints to be deleted
-//// /// \return number of remaining temporary constraints
-//// virtual size_t removeTemporary(size_t theNbConstraints = 1) = 0;
-
/// \brief Check whether the feature or its attributes are used by this storage
/// \param theFeature [in] feature to be checked
/// \return \c true if the feature interacts with the storage
/// \brief Check the features is not removed
bool isConsistent() const;
+ /// \brief Check the storage has constraints
+ bool isEmpty() const
+ { return myConstraintMap.empty(); }
+
/// \brief Check the entity is fixed.
/// If the point is under verification, all coincident points are checked too.
SKETCHSOLVER_EXPORT bool isFixed(EntityWrapperPtr theEntity) const;
/// \brief Initialize solver by constraints, entities and parameters
virtual void initializeSolver(SolverPtr theSolver) = 0;
+ /// \brief Return list of conflicting constraints
+ std::set<ObjectPtr> getConflictingConstraints(SolverPtr theSolver) const;
/// \brief Update SketchPlugin features after resolving constraints
/// \param theFixedOnly [in] if \c true the fixed points will be updated only
std::map<AttributePtr, EntityWrapperPtr> myAttributeMap;
CoincidentPointsMap myCoincidentPoints; ///< lists of coincident points (first is a master point, second is a set of slaves)
+
+ // to be able to update entities from constraints
+ friend class SketchSolver_ConstraintDistance;
+ friend class SketchSolver_ConstraintFixedArcRadius;
};
typedef std::shared_ptr<SketchSolver_Storage> StoragePtr;