-// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2021 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 PlaneGCSSolver_Storage_H_
virtual void addConstraint(ConstraintPtr theConstraint,
ConstraintWrapperPtr theSolverConstraint);
- /// \brief Add list of temporary constraints which will be destroyed
+ /// \brief Add a movement constraint which will be destroyed
/// after the next solving of the set of constraints.
/// \param theSolverConstraint [in] solver's constraint
- virtual void addTemporaryConstraint(const ConstraintWrapperPtr& theSolverConstraint);
+ virtual void addMovementConstraint(const ConstraintWrapperPtr& theSolverConstraint);
/// \brief Convert feature to the form applicable for specific solver and map it
/// \return \c true if the constraint and all its parameters are removed successfully
virtual bool removeConstraint(ConstraintPtr theConstraint);
+ /// \brief Verify, the sketch contains degenerated geometry
+ /// after resolving the set of constraints
+ /// \return STATUS_OK if the geometry is valid, STATUS_DEGENERATED otherwise.
+ virtual PlaneGCSSolver_Solver::SolveStatus checkDegeneratedGeometry() const;
+
/// \brief Update SketchPlugin features after resolving constraints
virtual void refresh() const;
/// \brief Check the storage has constraints
virtual bool isEmpty() const
- { return SketchSolver_Storage::isEmpty() && myArcConstraintMap.empty(); }
+ { return SketchSolver_Storage::isEmpty() && myAuxConstraintMap.empty(); }
+
+ /// \brief Make parametrization of arcs consistent.
+ /// Forward arcs should have the last parameter greater than the first parameter.
+ /// Reversed arcs should have the last parameter lesser than the first parameter.
+ virtual void adjustParametrizationOfArcs();
+
+ /// \brief Return list of features which are not fully constrained
+ virtual void getUnderconstrainedGeometry(std::set<ObjectPtr>& theFeatures) const;
private:
/// \brief Convert feature using specified builder.
EntityWrapperPtr createAttribute(const AttributePtr& theAttribute,
PlaneGCSSolver_EntityBuilder* theBuilder);
- void createArcConstraints(const EntityWrapperPtr& theArc);
- void removeArcConstraints(const EntityWrapperPtr& theArc);
+ /// \brief Create additional constaints:
+ /// * for arc to fix extra parameters;
+ /// * for ellipse to keep auxiliary points on their places
+ void createAuxiliaryConstraints(const EntityWrapperPtr& theEntity);
+ void removeAuxiliaryConstraints(const EntityWrapperPtr& theEntity);
private:
ConstraintID myConstraintLastID; ///< identifier of last added constraint
- /// additional constraints for correct processing of the arcs
- std::map<EntityWrapperPtr, ConstraintWrapperPtr> myArcConstraintMap;
+ /// additional constraints for correct processing of the arcs, ellipses, elliptic arcs
+ std::map<EntityWrapperPtr, ConstraintWrapperPtr> myAuxConstraintMap;
/// list of removed constraints to notify solver
std::list<GCSConstraintPtr> myRemovedConstraints;