Salome HOME
updated copyright message
[modules/shaper.git] / src / SketchSolver / SketchSolver_Group.h
index 9a78d9a2c6fa8404c7883067af9742b15d38297e..8422b32ffddabd7a359755df30d6a201853ceb61 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  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
 //
 // 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
+// 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
 //
 
 #ifndef SketchSolver_Group_H_
 #include <memory>
 #include <map>
 
+class GeomAPI_Dir;
+class GeomAPI_Pnt;
+class GeomAPI_Pnt2d;
+
 typedef std::map<ConstraintPtr, SolverConstraintPtr> ConstraintConstraintMap;
 
 /** \class   SketchSolver_Group
@@ -66,17 +69,37 @@ class SketchSolver_Group
    */
   bool changeConstraint(std::shared_ptr<SketchPlugin_Constraint> theConstraint);
 
+  /** \brief Updates the sketch feature
+   */
+  bool updateSketch(CompositeFeaturePtr theSketch);
+
   /** \brief Updates the data corresponding the specified feature
    *  \param[in] theFeature the feature to be updated
    */
   bool updateFeature(FeaturePtr theFeature);
 
   /** \brief Updates the data corresponding the specified feature moved in GUI.
-   *         Additional Fixed constraints are created.
+   *         Special kind of Fixed constraints is created.
    *  \param[in] theFeature the feature to be updated
-   *  \return \c true, if the feature is moved
+   *  \param[in] theFrom    start point of the movement
+   *  \param[in] theTo      final point of the movement
+   *  \return \c true, if the feature is really moved
    */
-  bool moveFeature(FeaturePtr theFeature);
+  bool moveFeature(FeaturePtr theFeature,
+                   const std::shared_ptr<GeomAPI_Pnt2d>& theFrom,
+                   const std::shared_ptr<GeomAPI_Pnt2d>& theTo);
+  /** \brief Updates the data corresponding the specified point moved in GUI.
+   *         Special kind of Fixed constraints is created.
+   *  \param[in] thePointOrArray the attribute to be updated
+   *  \param[in] thePointIndex   index of moved point in array
+   *  \param[in] theFrom         start point of the movement
+   *  \param[in] theTo           destination point of the movement
+   *  \return \c true, if the attribute is really moved
+   */
+  bool movePoint(AttributePtr thePointOrArray,
+                 const int thePointIndex,
+                 const std::shared_ptr<GeomAPI_Pnt2d>& theFrom,
+                 const std::shared_ptr<GeomAPI_Pnt2d>& theTo);
 
   /// Returns the current workplane
   inline const CompositeFeaturePtr& getWorkplane() const
@@ -94,6 +117,9 @@ class SketchSolver_Group
    */
   bool resolveConstraints();
 
+  /// \brief Find the list of features, which are not fully constrained.
+  void underconstrainedFeatures(std::set<ObjectPtr>& theFeatures) const;
+
   /// \brief Block or unblock events sent by features in this group
   void blockEvents(bool isBlocked);
 
@@ -117,6 +143,10 @@ private:
 
 private:
   CompositeFeaturePtr mySketch; ///< Sketch for this group
+  std::shared_ptr<GeomAPI_Pnt> mySketchOrigin;
+  std::shared_ptr<GeomAPI_Dir> mySketchNormal;
+  std::shared_ptr<GeomAPI_Dir> mySketchXDir;
+
   ConstraintConstraintMap myConstraints; ///< List of constraints
   std::set<SolverConstraintPtr> myTempConstraints; ///< List of temporary constraints