Salome HOME
Fix compilation on Debian
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMovement.h
index 59fa2a198d9e152da5a47b094c99661cb0970b5f..8614f309ac064177045d915bad8d86d234c199fb 100644 (file)
@@ -1,4 +1,22 @@
-// Copyright (C) 2015-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2017  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// 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>
+//
 
 // File:    SketchSolver_ConstraintMovement.h
 // Created: 15 Jun 2015
@@ -25,8 +43,7 @@ public:
   SketchSolver_ConstraintMovement(AttributePtr thePoint);
 
   /// \brief Set coordinates of the start point of the movement
-  void startPoint(const std::shared_ptr<GeomAPI_Pnt2d>& theStartPoint)
-  { myStartPoint = theStartPoint; }
+  void startPoint(const std::shared_ptr<GeomAPI_Pnt2d>& theStartPoint);
 
   /// \brief Set coordinates of fixed feature to the values where it has been dragged.
   ///        Useful when the feature is being moved.
@@ -43,13 +60,22 @@ protected:
   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
   virtual void process();
 
-  /// \brief Obtain entity to be fixed
-  virtual EntityWrapperPtr entityToFix();
+  /// \brief Create Fixed constraint for the feature basing on its type and moved point
+  /// \return Fixed constraint
+  ConstraintWrapperPtr initMovement();
+
+  /// \brief Create constraint to fix moved arc extremity
+  ConstraintWrapperPtr fixArcExtremity(const EntityWrapperPtr& theArcExtremity);
+
+  /// \brief Creat constraint to fix moved point on circle/arc
+  ConstraintWrapperPtr fixPointOnCircle(const EntityWrapperPtr& theCircular);
 
 private:
   FeaturePtr       myMovedFeature; ///< fixed feature (if set, myBaseConstraint should be NULL)
   AttributePtr     myDraggedPoint; ///< one of the feature points which has been moved
   std::shared_ptr<GeomAPI_Pnt2d> myStartPoint; ///< start point of the movement
+
+  bool mySimpleMove; ///< simple move, thus all parameters should be increased by movement delta
 };
 
 #endif