X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_SketcherReentrantMgr.cpp;h=3f9b4a393db4ac1e4c6de851ee165ecb4d86d381;hb=fc72d43b677baa05ae7fd317346fd8b723b799ed;hp=767df1296c5e2e6156a1debf02ed6c4e2a7e0fc5;hpb=46c0759fa291dad10b713cf02b341d6e9e60c1a4;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_SketcherReentrantMgr.cpp b/src/PartSet/PartSet_SketcherReentrantMgr.cpp index 767df1296..3f9b4a393 100644 --- a/src/PartSet/PartSet_SketcherReentrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReentrantMgr.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2020 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 @@ -75,7 +75,8 @@ PartSet_SketcherReentrantMgr::PartSet_SketcherReentrantMgr(ModuleBase_IWorkshop* myIsFlagsBlocked(false), myIsInternalEditOperation(false), myNoMoreWidgetsAttribute(""), - myIsAutoConstraints(true) + myIsAutoConstraints(true), + myLastAutoConstraint(0) { } @@ -869,16 +870,24 @@ void PartSet_SketcherReentrantMgr::addConstraints(const FeaturePtr& theFeature) double aTolerance = Config_PropManager::real(SKETCH_TAB_NAME, "angular_tolerance"); CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch(); FeaturePtr aFeature; - if (aHorAngle < aTolerance) + if (aHorAngle < aTolerance) { // Add horizontal constraint aFeature = aSketch->addFeature(SketchPlugin_ConstraintHorizontal::ID()); - else if (aVertAngle < aTolerance) + } + else if (aVertAngle < aTolerance) { // Add vertical constraint aFeature = aSketch->addFeature(SketchPlugin_ConstraintVertical::ID()); - + } if (aFeature.get()) { aFeature->refattr(SketchPlugin_Constraint::ENTITY_A())->setObject( theFeature->firstResult()); + myLastAutoConstraint = aFeature.get(); } } } + + +bool PartSet_SketcherReentrantMgr::isLastAutoConstraint(const ObjectPtr& theObj) const +{ + return theObj.get() == myLastAutoConstraint; +}