From 2a1ea255610239ce41c79f9dc1fe5135459c61f5 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 27 Jan 2015 15:05:16 +0300 Subject: [PATCH] Issue #326 Distance constraint on 2 preselected segments problem it should not be possible to select an arc object. --- src/SketchPlugin/SketchPlugin_Validators.cpp | 8 +++++++- src/XGUI/XGUI_SelectionMgr.cpp | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) 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(); -- 2.39.2