X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_Manager.h;h=04a87d2b6d1a6e64a3c85e4742fc5f3c1463fd93;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=45c1a4284bbaff4df86690f1669785e1dd0cb923;hpb=87b6a30a3afb8fb32e7e43ade8d9c947d9eb1684;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_Manager.h b/src/SketchSolver/SketchSolver_Manager.h index 45c1a4284..04a87d2b6 100644 --- a/src/SketchSolver/SketchSolver_Manager.h +++ b/src/SketchSolver/SketchSolver_Manager.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SketchSolver_Manager_H_ @@ -24,11 +23,15 @@ #include #include -#include #include #include +class GeomAPI_Pnt2d; +class GeomDataAPI_Point2D; +class ModelAPI_CompositeFeature; +class SketchPlugin_Constraint; + /** \class SketchSolver_Manager * \ingroup Plugins * \brief Listens the changes of SketchPlugin features and transforms the Constraint @@ -61,10 +64,37 @@ 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 theFeature, bool theMoved = false); + bool updateFeature(const std::shared_ptr& theFeature); + + /** \brief Updates the sketch and related constraints, if the sketch plane is changed + * \param[in] theSketch sketch to be updated + * \return \c true if the sketch plane is changed + */ + bool updateSketch(const std::shared_ptr& theSketch); + + /** \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& theMovedFeature, + const std::shared_ptr& theFromPoint, + const std::shared_ptr& theToPoint); + + /** \brief Move feature using its moved attribute + * \param[in] theMovedAttribute dragged point (array of points) attribute of sketch feature + * \param[in] theMovedPointIndex index of dragged point in an array (-1 otherwise) + * \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& theMovedAttribute, + const int theMovedPointIndex, + const std::shared_ptr& theFromPoint, + const std::shared_ptr& theToPoint); /** \brief Removes a constraint from the manager * \param[in] theConstraint constraint to be removed @@ -84,6 +114,11 @@ private: * \return Pointer to corresponding group or NULL if the group cannot be created. */ SketchGroupPtr findGroup(std::shared_ptr theFeature); + /** \brief Searches group related to specified composite feature + * \param[in] theSketch sketch to be found + * \return Pointer to corresponding group or NULL if the group cannot be created. + */ + SketchGroupPtr findGroup(std::shared_ptr theSketch); /// \brief Stop sending the Update event until all features updated /// \return \c true, if the last flushed event is Update