Salome HOME
Using test for testing number of sub-shapes.
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMovement.h
index dd2b0df741368b380db0aa2459d789dc89cd649e..63211fa4fb6262ec8c0f5462bedb468127c84603 100644 (file)
@@ -8,25 +8,30 @@
 #define SketchSolver_ConstraintMovement_H_
 
 #include "SketchSolver.h"
-#include <SketchSolver_ConstraintRigid.h>
-
-#include <GeomDataAPI_Point2D.h>
+#include <SketchSolver_ConstraintFixed.h>
 
 /** \class   SketchSolver_ConstraintMovement
  *  \ingroup Plugins
- *  \brief   Stores data of Rigid (Fixed) constraint for the moved feature only
+ *  \brief   Stores data to the Fixed constraint for the moved feature only
  */
-class SketchSolver_ConstraintMovement : public SketchSolver_ConstraintRigid
+class SketchSolver_ConstraintMovement : public SketchSolver_ConstraintFixed
 {
 private:
   /// Creates constraint to manage the given constraint from plugin
   SketchSolver_ConstraintMovement(ConstraintPtr theConstraint)
-    : SketchSolver_ConstraintRigid(theConstraint)
+    : SketchSolver_ConstraintFixed(theConstraint)
   {}
 
 public:
   /// Creates temporary constraint based on feature
-  SketchSolver_ConstraintMovement(FeaturePtr theFeature);
+  SketchSolver_ConstraintMovement(FeaturePtr theFeature)
+    : SketchSolver_ConstraintFixed(theFeature)
+  {}
+
+  /// \brief Tries to remove constraint
+  /// \return \c false, if current constraint contains another SketchPlugin
+  /// constraints (like for multiple coincidence)
+  virtual bool remove();
 
 protected:
   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
@@ -35,12 +40,12 @@ protected:
   /// \brief Generate list of attributes of constraint in order useful for SolveSpace constraints
   /// \param[out] theValue        numerical characteristic of constraint (e.g. distance)
   /// \param[out] theAttributes   list of attributes to be filled
-  /// \param[out] theIsFullyMoved shows that the feature is moved, in other case only one point of the feature is shifted
-  virtual void getAttributes(double& theValue, std::vector<Slvs_hEntity>& theAttributes, bool& theIsFullyMoved);
+  /// (list of moved entities or attributes)
+  virtual void getAttributes(ParameterWrapperPtr& theValue,
+                             std::vector<EntityWrapperPtr>& theAttributes);
 
 private:
-  /// \brief Check the coordinates of point are differ than coordinates of correponding SolveSpace entity
-  bool isMoved(std::shared_ptr<GeomDataAPI_Point2D> thePoint, Slvs_hEntity theEntity);
+  std::vector<EntityWrapperPtr> myMovedEntities; ///< list of entities that are moved
 };
 
 #endif