From: nds Date: Tue, 31 Mar 2015 11:56:51 +0000 (+0300) Subject: Preselection of two points for distance operation. X-Git-Tag: V_1.1.0~70^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c97d43b7eb01000c13b064da2d4119801fc3fb71;p=modules%2Fshaper.git Preselection of two points for distance operation. The selected object is empty, so the first condition is not correct. All this checks should be done in the attribute validator. --- diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index ef46fa062..1721da469 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -407,16 +407,17 @@ bool ModuleBase_WidgetShapeSelector::setSelection(const Handle_SelectMgr_EntityO ModuleBase_ViewerPrs aPrs; myWorkshop->selection()->fillPresentation(aPrs, theOwner); + // It should be checked by corresponded validator ObjectPtr aObject = aPrs.object(); - ObjectPtr aCurrentObject = GeomValidators_Tools::getObject(myFeature->attribute(attributeID())); + /*ObjectPtr aCurrentObject = GeomValidators_Tools::getObject(myFeature->attribute(attributeID())); if ((!aCurrentObject) && (!aObject)) - return false; + return false;*/ + // It should be checked by corresponded validator // Check that the selected object is result (others can not be accepted) - ResultPtr aRes = std::dynamic_pointer_cast(aObject); + /*ResultPtr aRes = std::dynamic_pointer_cast(aObject); if (!aRes) return false; - if (myFeature) { // We can not select a result of our feature const std::list>& aResList = myFeature->results(); @@ -426,16 +427,21 @@ bool ModuleBase_WidgetShapeSelector::setSelection(const Handle_SelectMgr_EntityO return false; } } + */ + // It should be checked by corresponded validator + /* // Check that object belongs to active document or PartSet DocumentPtr aDoc = aRes->document(); SessionPtr aMgr = ModelAPI_Session::get(); if (!(aDoc == aMgr->activeDocument()) && !(aDoc == aMgr->moduleDocument())) - return false; + return false;*/ + // It should be checked by corresponded validator // Check that the result has a shape - GeomShapePtr aShape = ModelAPI_Tools::shape(aRes); + GeomShapePtr aShape; + /*aShape = ModelAPI_Tools::shape(aRes); if (!aShape) - return false; + return false;*/ // Get sub-shapes from local selection if (!aPrs.shape().IsNull()) {