Salome HOME
Issue #2741: Undo of distance argument change produces crash
[modules/shaper.git] / src / SketchSolver / SketchSolver_Manager.h
index 4d2e30c7e5479d7ace46bb81a3f058a5b942c710..105cc0e97ae1b503195b9efddd7b7969107ffbd9 100644 (file)
@@ -14,7 +14,8 @@
 // License along with this library; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 //
 
 #ifndef SketchSolver_Manager_H_
 #include <SketchSolver_Group.h>
 
 #include <Events_Listener.h>
-#include <SketchPlugin_Constraint.h>
 
 #include <list>
 #include <set>
 
+class GeomAPI_Pnt2d;
+class GeomDataAPI_Point2D;
+class SketchPlugin_Constraint;
+
 /** \class   SketchSolver_Manager
  *  \ingroup Plugins
  *  \brief   Listens the changes of SketchPlugin features and transforms the Constraint
@@ -60,10 +64,29 @@ protected:
 
   /** \brief Adds or updates a constraint or an entity in the suitable group
    *  \param[in] theFeature sketch feature to be changed
-   *  \param[in] theMoved   \c true if the feature has been moved in the viewer
    *  \return \c true if the feature changed successfully
    */
-  bool updateFeature(std::shared_ptr<SketchPlugin_Feature> theFeature, bool theMoved = false);
+  bool updateFeature(const std::shared_ptr<SketchPlugin_Feature>& theFeature);
+
+  /** \brief Move feature
+   *  \param[in] theMovedFeature dragged sketch feature
+   *  \param[in] theFromPoint    original position of the feature
+   *  \param[in] theToPoint      prefereble position of the feature (current position of the mouse)
+   *  \return \c true if the feature has been changed successfully
+   */
+  bool moveFeature(const std::shared_ptr<SketchPlugin_Feature>& theMovedFeature,
+                   const std::shared_ptr<GeomAPI_Pnt2d>& theFromPoint,
+                   const std::shared_ptr<GeomAPI_Pnt2d>& theToPoint);
+
+  /** \brief Move feature using its moved attribute
+   *  \param[in] theMovedAttribute dragged point attribute of sketch feature
+   *  \param[in] theFromPoint      original position of the moved point
+   *  \param[in] theToPoint        prefereble position (current position of the mouse)
+   *  \return \c true if the attribute owner has been changed successfully
+   */
+  bool moveAttribute(const std::shared_ptr<GeomDataAPI_Point2D>& theMovedAttribute,
+                     const std::shared_ptr<GeomAPI_Pnt2d>& theFromPoint,
+                     const std::shared_ptr<GeomAPI_Pnt2d>& theToPoint);
 
   /** \brief Removes a constraint from the manager
    *  \param[in] theConstraint constraint to be removed