X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_Group.h;h=8422b32ffddabd7a359755df30d6a201853ceb61;hb=fc72d43b677baa05ae7fd317346fd8b723b799ed;hp=53c881c7067cc0717268d2c1b89c4bdfabbe5771;hpb=1b7956c2807a6b4f19edbfdf9e6a7872b9ab5302;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_Group.h b/src/SketchSolver/SketchSolver_Group.h index 53c881c70..8422b32ff 100644 --- a/src/SketchSolver/SketchSolver_Group.h +++ b/src/SketchSolver/SketchSolver_Group.h @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: SketchSolver_Group.h -// Created: 27 May 2014 -// Author: Artem ZHIDKOV +// 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 +// 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 +// #ifndef SketchSolver_Group_H_ #define SketchSolver_Group_H_ @@ -17,6 +30,10 @@ #include #include +class GeomAPI_Dir; +class GeomAPI_Pnt; +class GeomAPI_Pnt2d; + typedef std::map ConstraintConstraintMap; /** \class SketchSolver_Group @@ -52,17 +69,37 @@ class SketchSolver_Group */ bool changeConstraint(std::shared_ptr 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& theFrom, + const std::shared_ptr& 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& theFrom, + const std::shared_ptr& theTo); /// Returns the current workplane inline const CompositeFeaturePtr& getWorkplane() const @@ -80,6 +117,9 @@ class SketchSolver_Group */ bool resolveConstraints(); + /// \brief Find the list of features, which are not fully constrained. + void underconstrainedFeatures(std::set& theFeatures) const; + /// \brief Block or unblock events sent by features in this group void blockEvents(bool isBlocked); @@ -98,14 +138,15 @@ private: /// \brief Append given constraint to the group of temporary constraints void setTemporary(SolverConstraintPtr theConstraint); - /// \brief Update dependent (copied) features created by Mirror and other "Multi" constraints - void updateMultiConstraints(); - /// \brief Compute DoF of the sketch and set corresponding field void computeDoF(); private: CompositeFeaturePtr mySketch; ///< Sketch for this group + std::shared_ptr mySketchOrigin; + std::shared_ptr mySketchNormal; + std::shared_ptr mySketchXDir; + ConstraintConstraintMap myConstraints; ///< List of constraints std::set myTempConstraints; ///< List of temporary constraints