From: mpv Date: Wed, 17 Dec 2014 12:11:36 +0000 (+0300) Subject: Make construction elements correctly selected: points, axes, planes X-Git-Tag: before_slalome_7.5.1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4cc670477fa518dd1e90c709d28711ffdbc90085;p=modules%2Fshaper.git Make construction elements correctly selected: points, axes, planes --- diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 79b87dc2d..d708eecd4 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -76,6 +76,12 @@ std::shared_ptr Model_AttributeSelection::value() TopoDS_Shape aSelShape = aSelection->Get(); aResult = std::shared_ptr(new GeomAPI_Shape); aResult->setImpl(new TopoDS_Shape(aSelShape)); + } else { // for simple construction element: just shape of this construction element + ResultConstructionPtr aConstr = + std::dynamic_pointer_cast(context()); + if (aConstr) { + return aConstr->shape(); + } } } return aResult; @@ -115,7 +121,7 @@ bool Model_AttributeSelection::update() std::shared_ptr aWirePtr = std::dynamic_pointer_cast( std::dynamic_pointer_cast(aContext)->shape()); - if (aWirePtr && aWirePtr->hasPlane()) { + if (aWirePtr && aWirePtr->hasPlane()) { // sketch sub-element TDF_Label aLab = myRef.myRef->Label(); // getting a type of selected shape Handle(TDataStd_Integer) aTypeAttr; @@ -266,6 +272,9 @@ bool Model_AttributeSelection::update() } } } + } else { // simple construction element: the selected is that needed + owner()->data()->sendAttributeUpdated(this); + return true; } } return false; // unknown case