]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
authornds <natalia.donis@opencascade.com>
Wed, 25 Jun 2014 17:15:07 +0000 (21:15 +0400)
committernds <natalia.donis@opencascade.com>
Wed, 25 Jun 2014 17:15:07 +0000 (21:15 +0400)
1. Show editor just by click on the constraint text.

src/PartSet/PartSet_OperationFeatureEdit.cpp

index 091595a6487c211c659cd2377118a918c94184fa..dc7f99ddf77024c10f6fc1f441d8a40280cd218f 100644 (file)
@@ -26,6 +26,8 @@
 #include <SketchPlugin_Line.h>
 
 #include <V3d_View.hxx>
+#include <AIS_DimensionOwner.hxx>
+#include <AIS_DimensionSelectionMode.hxx>
 
 #ifdef _DEBUG
 #include <QDebug>
@@ -134,13 +136,19 @@ void PartSet_OperationFeatureEdit::mouseDoubleClick(QMouseEvent* theEvent, Handl
                                                     const std::list<XGUI_ViewerPrs>& theSelected,
                                                     const std::list<XGUI_ViewerPrs>& 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();
+        }
+      }
     }
   }
 }