From: nds Date: Tue, 27 Jan 2015 12:05:16 +0000 (+0300) Subject: Issue #326 Distance constraint on 2 preselected segments problem X-Git-Tag: V_1.0.0~17^2~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2a1ea255610239ce41c79f9dc1fe5135459c61f5;p=modules%2Fshaper.git Issue #326 Distance constraint on 2 preselected segments problem it should not be possible to select an arc object. --- diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index d8d056f46..b53102af2 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -25,7 +25,13 @@ bool SketchPlugin_DistanceAttrValidator::isValid(const FeaturePtr& theFeature, // If the object is not a line then it is accepted const ModelAPI_ResultValidator* aLineValidator = dynamic_cast(aFactory->validator("SketchPlugin_ResultLine")); - if (!aLineValidator->isValid(theObject)) + bool aLineValid = aLineValidator->isValid(theObject); + + const ModelAPI_ResultValidator* anArcValidator = + dynamic_cast(aFactory->validator("SketchPlugin_ResultArc")); + bool anArcValid = anArcValidator->isValid(theObject); + + if (!aLineValid && !anArcValid) return true; // If it is a line then we have to check that first attribute id not a line diff --git a/src/XGUI/XGUI_SelectionMgr.cpp b/src/XGUI/XGUI_SelectionMgr.cpp index 9eb43d499..830417972 100644 --- a/src/XGUI/XGUI_SelectionMgr.cpp +++ b/src/XGUI/XGUI_SelectionMgr.cpp @@ -60,7 +60,6 @@ void XGUI_SelectionMgr::setSelectedOwners(const SelectMgr_IndexedMapOfOwner& the } //************************************************************** -#include void XGUI_SelectionMgr::updateSelectedOwners(bool isUpdateViewer) { Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();