Salome HOME
Sort constraints before adding it to the solver (issue #911)
[modules/shaper.git] / src / SketchSolver / SketchSolver_Constraint.h
index 134263412da5574997e456bb728db825191de3ef..8589dc19bb7d5b3d2e23e48a71950db084f71e5b 100644 (file)
@@ -51,7 +51,7 @@ public:
   /// \brief Returns the type of constraint
   virtual int getType() const = 0;
 
-  /// \brief The constraint is made temoparary
+  /// \brief The constraint is made temporary
   void makeTemporary() const;
 
   /// \brief Checks the constraint is used by current object
@@ -66,6 +66,9 @@ public:
   /// \brief Return identifier of SolveSpace entity relating to the attribute
   Slvs_hEntity getId(AttributePtr theAttribute) const;
 
+  /// \brief Adds a feature to constraint and create its analogue in SolveSpace
+  virtual void addFeature(FeaturePtr theFeature);
+
   /// \brief Shows error message
   const std::string& error() const
   { return myErrorMsg; }
@@ -79,7 +82,12 @@ protected:
   /// \param[out] theAttributes list of attributes to be filled
   virtual void getAttributes(double& theValue, std::vector<Slvs_hEntity>& theAttributes);
 
-  /// \brief This method is used in derived objects to check consistence of constraint.
+  /// \brief Verify the attributes of constraint are changed (and constraint need to rebuild)
+  /// \param[in] theConstraint constraint, which attributes should be checked (if NULL, the myBaseConstraint is used)
+  /// \return \c true if some attributes are changed
+  virtual bool checkAttributesChanged(ConstraintPtr theConstraint);
+
+  /// \brief This method is used in derived objects to check consistency of constraint.
   ///        E.g. the distance between line and point may be signed.
   virtual void adjustConstraint()
   {}