]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchSolver/SketchSolver_ConstraintRigid.h
Salome HOME
Do not allow user to move fixed entities (issue #1043)
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintRigid.h
index 22f4c6dd50e3c794fae2554b20df0d19e96fd679..adac8c6a30a3ab42fdacdd1d22eec49ef6dde6e9 100644 (file)
  *  \brief   Stores data of Rigid (Fixed) constraint
  *
  *  Rigid constraint may have NULL basic SketchPlugin constraint,
- *  because the Rigid constraint may be temporary for correct moving of objects
+ *  because the Rigid constraint may be temporary for correct moving of objects.
+ *
+ *  Rigid constraint does not create a constraint, but builds the entities in separate group,
+ *  so they will not be moved while resolving the set of constraints.
  */
 class SketchSolver_ConstraintRigid : public SketchSolver_Constraint
 {
@@ -27,6 +30,9 @@ public:
   /// Creates temporary constraint based on feature
   SketchSolver_ConstraintRigid(FeaturePtr theFeature);
 
+  /// \brief Update constraint
+  virtual void update(ConstraintPtr theConstraint = ConstraintPtr());
+
   /// \brief Tries to remove constraint
   /// \return \c false, if current constraint contains another SketchPlugin constraints (like for multiple coincidence)
   virtual bool remove(ConstraintPtr theConstraint = ConstraintPtr());
@@ -44,17 +50,16 @@ 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.
-  ///        E.g. the distance between line and point may be signed.
-  virtual void adjustConstraint();
-
   /// \brief Fixed feature basing on its type
-  void fixFeature();
+  virtual void fixFeature();
 
   /// \brief Fix given point
-  void fixPoint(const Slvs_hEntity& thePointID);
+  /// \return ID of the Fixed constraint
+  Slvs_hConstraint fixPoint(const Slvs_hEntity& thePointID);
+
+  /// \brief Returns ID of fixed entity
+  Slvs_hEntity fixedEntity() const;
 
-private:
   /// \brief Fixing line position (start and end points)
   void fixLine(const Slvs_Entity& theLine);
   /// \brief Fixing circle (center and radius)