]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #851 Show only action should not hide sketch entities when the sketch operation...
authornds <nds@opencascade.com>
Fri, 28 Aug 2015 11:30:37 +0000 (14:30 +0300)
committernds <nds@opencascade.com>
Fri, 28 Aug 2015 11:31:04 +0000 (14:31 +0300)
src/FeaturesPlugin/movement_widget.xml
src/FeaturesPlugin/placement_widget.xml
src/FeaturesPlugin/rotation_widget.xml
src/GeomValidators/GeomValidators_PartSet.cpp
src/ModuleBase/ModuleBase_Tools.cpp
src/PartSet/PartSet_SketcherMgr.cpp
src/XGUI/XGUI_Displayer.cpp

index 421a8851d4c311c1e46a157234424652a529e7f8..e7e162d0a80d341d6f0350e635413ae7e8e6c057 100644 (file)
@@ -5,7 +5,7 @@
     label="Main objects"
     icon=":icons/cut_shape.png"
     tooltip="Select a solid objects"
-    type_choice="Compounds Solids"
+    type_choice="Objects Solids"
     use_choice="false"
     concealment="true">
     <validator id="GeomValidators_PartSet"/>
index 1989fb3a99f13969ba09268a8491a0c687df280b..cefe7672e6a68140be7be11b8906c1b338ffd4b4 100644 (file)
@@ -5,8 +5,9 @@
     label="Select a solid objects"
     icon=":icons/cut_shape.png"
     tooltip="Select a solid objects"
-    type_choice="Solids"
+    type_choice="Objects Solids"
     concealment="true" >
+    <validator id="GeomValidators_PartSet"/>
   </multi_selector>
   <shape_selector id="placement_start_face"
     label="Select an object" 
index 85bd5ee99d2bf632406dd1987d8f3c1938a5faa5..aaf5ad8cb63578567a39effd0b0ef9491fe1c533 100755 (executable)
@@ -5,8 +5,9 @@
     label="Main objects"
     icon=":icons/cut_shape.png"
     tooltip="Select a solid objects"
-    type_choice="Solids"
+    type_choice="Objects Solids"
     concealment="true">
+    <validator id="GeomValidators_PartSet"/>
   </multi_selector>
   <shape_selector id="axis_object"
                   icon=":icons/axis.png"
index 9521b181e7587f2909c8b4a3587c907eeca8abf0..32f2bb1662cb0f08db142a9389acd656cfc4c319 100755 (executable)
@@ -21,30 +21,17 @@ bool GeomValidators_PartSet::isValid(const AttributePtr& theAttribute,
   bool aValid = false;
   SessionPtr aMgr = ModelAPI_Session::get();
   bool isPartSetDocument = aMgr->activeDocument() == aMgr->moduleDocument();
-
-  if (theAttribute->attributeType() == ModelAPI_AttributeSelectionList::typeId()) {
-    AttributeSelectionListPtr aSelectionListAttr = 
-                      std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
-    // all context objects should be sketch entities
-    for (int i = 0, aSize = aSelectionListAttr->size(); i < aSize; i++) {
-      AttributeSelectionPtr aSelectAttr = aSelectionListAttr->value(i);
-
-      GeomShapePtr aShape = aSelectAttr->value();
-      if (!aShape.get()) {
-        ResultPtr aResult = aSelectAttr->context();
-        if (aResult.get())
-          aShape = aResult->shape();
-      }
-      TopoDS_Shape aTopoShape = aShape->impl<TopoDS_Shape>();
-      TopAbs_ShapeEnum aShapeType = aTopoShape.ShapeType();
-
-      if (isPartSetDocument)
-        aValid = aShapeType == TopAbs_COMPOUND;
-      else {
-        TopoDS_Shape aTopoShape = aShape->impl<TopoDS_Shape>();
-        aShapeType = GeomValidators_Tools::getCompoundSubType(aTopoShape);
-
-        aValid = aShapeType == TopAbs_SOLID;
+  if (!isPartSetDocument)
+    aValid = true;
+  else {
+    // only hole objects should be selected in PartSet document, there is no decomposition
+    if (theAttribute->attributeType() == ModelAPI_AttributeSelectionList::typeId()) {
+      AttributeSelectionListPtr aSelectionListAttr = 
+                        std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+      for (int i = 0, aSize = aSelectionListAttr->size(); i < aSize; i++) {
+        AttributeSelectionPtr aSelectAttr = aSelectionListAttr->value(i);
+        GeomShapePtr aShape = aSelectAttr->value();
+        aValid = !aShape.get();
       }
     }
   }
index b0ee536de63e6a1895e294c734241e9ee15ae3bc..a3cfca0a6089175d18a72f338a33b2ccc0d7c753 100755 (executable)
@@ -216,7 +216,7 @@ TopAbs_ShapeEnum shapeType(const QString& theType)
     MyShapeTypes["shell"] = TopAbs_SHELL;
     MyShapeTypes["solid"] = TopAbs_SOLID;
     MyShapeTypes["solids"] = TopAbs_SOLID;
-    MyShapeTypes["compounds"] = TopAbs_COMPOUND;
+    MyShapeTypes["objects"] = TopAbs_SHAPE;
   }
   QString aType = theType.toLower();
   if (MyShapeTypes.contains(aType))
index 0bea2148a29ec20002f796e62c54e3d36e8b3332..b7a89b356788e65e553f59bc3477b163a6b50717 100644 (file)
@@ -192,7 +192,9 @@ void PartSet_SketcherMgr::onEnterViewPort()
   // redisplayed before this update, the feature presentation jumps from reset value to current.
   myIsMouseOverWindow = true;
   myIsResetCurrentValue = false;
-  operationMgr()->onValidateOperation();
+  // it is important to validate operation here only if sketch entity create operation is active
+  // because at this operation we reacts to the mouse leave/enter view port
+  //operationMgr()->onValidateOperation();
 #ifdef DEBUG_MOUSE_OVER_WINDOW_FLAGS
   qDebug(QString("onEnterViewPort: %1").arg(mouseOverWindowFlagsInfo()).toStdString().c_str());
 #endif
@@ -203,6 +205,8 @@ void PartSet_SketcherMgr::onEnterViewPort()
 
   if (!isNestedCreateOperation(getCurrentOperation()))
     return;
+    operationMgr()->onValidateOperation();
+
   // we need change displayed state of the current operation feature
   // if the feature is presentable, e.g. distance construction. It has no results, so workshop does
   // not accept a signal about the result created. Nothing is shown until mouse is moved out/in view
index f91e8fa082e307d497e471feb7524cef706fb24f..ff4127e2f2c1cae1504cf837b3960f531759c1ac 100644 (file)
@@ -354,7 +354,7 @@ void XGUI_Displayer::activateObjects(const QIntList& theModes, const QObjectPtrL
   // Convert shape types to selection types
   QIntList aModes;
   foreach(int aType, theModes) {
-    if (aType > TopAbs_SHAPE) 
+    if (aType >= TopAbs_SHAPE) 
       aModes.append(aType);
     else
       aModes.append(AIS_Shape::SelectionMode((TopAbs_ShapeEnum)aType));