From: nds Date: Wed, 25 Jun 2014 17:15:07 +0000 (+0400) Subject: refs #80 - Sketch base GUI: create/draw point, circle and arc X-Git-Tag: V_0.4.4~230 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=018f478bb2dc8e86cd7d7f3906ad890b66b1e21a;p=modules%2Fshaper.git refs #80 - Sketch base GUI: create/draw point, circle and arc 1. Show editor just by click on the constraint text. --- diff --git a/src/PartSet/PartSet_OperationFeatureEdit.cpp b/src/PartSet/PartSet_OperationFeatureEdit.cpp index 091595a64..dc7f99ddf 100644 --- a/src/PartSet/PartSet_OperationFeatureEdit.cpp +++ b/src/PartSet/PartSet_OperationFeatureEdit.cpp @@ -26,6 +26,8 @@ #include #include +#include +#include #ifdef _DEBUG #include @@ -134,13 +136,19 @@ void PartSet_OperationFeatureEdit::mouseDoubleClick(QMouseEvent* theEvent, Handl const std::list& theSelected, const std::list& theHighlighted) { - // changed + // TODO the functionality is important only for constraint feature. Should be moved in another place if (!theSelected.empty()) { - bool isValid; - double aValue = PartSet_Tools::featureValue(feature(), CONSTRAINT_ATTR_VALUE, isValid); - if (isValid) { - ModuleBase_WidgetEditor::editFeatureValue(feature(), CONSTRAINT_ATTR_VALUE); - flushUpdated(); + XGUI_ViewerPrs aFeaturePrs = theSelected.front(); + if (!aFeaturePrs.owner().IsNull()) { + Handle(AIS_DimensionOwner) anOwner = Handle(AIS_DimensionOwner)::DownCast(aFeaturePrs.owner()); + if (!anOwner.IsNull() && anOwner->SelectionMode() == AIS_DSM_Text) { + bool isValid; + double aValue = PartSet_Tools::featureValue(feature(), CONSTRAINT_ATTR_VALUE, isValid); + if (isValid) { + ModuleBase_WidgetEditor::editFeatureValue(feature(), CONSTRAINT_ATTR_VALUE); + flushUpdated(); + } + } } } }