From 4cc670477fa518dd1e90c709d28711ffdbc90085 Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 17 Dec 2014 15:11:36 +0300 Subject: [PATCH] Make construction elements correctly selected: points, axes, planes --- src/Model/Model_AttributeSelection.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 -- 2.39.2