Salome HOME
A crash fix for creation a coincidence constraint with using an external point; an...
authornds <natalia.donis@opencascade.com>
Wed, 15 Apr 2015 18:55:44 +0000 (21:55 +0300)
committernds <natalia.donis@opencascade.com>
Wed, 15 Apr 2015 18:55:44 +0000 (21:55 +0300)
src/PartSet/PartSet_WidgetShapeSelector.cpp
src/SketchPlugin/plugin-Sketch.xml

index 089bd98a6ccf1cc1794b3d8cd0da43b06a6d416b..5174050ff8fd50f5998a7ebf7dd840df7ede06f5 100644 (file)
@@ -119,6 +119,11 @@ void PartSet_WidgetShapeSelector::removeExternal()
       // the external feature should be removed with all references, sketch feature should be ignored
       std::set<FeaturePtr> anIgnoredFeatures;
       anIgnoredFeatures.insert(sketch());
+      // the current feature should be ignored, because it can use the external feature in the
+      // attributes and, therefore have a references to it. So, the delete functionality tries
+      // to delete this feature. Test case is creation of a constraint on external point,
+      // use in this control after an external point, the point of the sketch.
+      anIgnoredFeatures.insert(myFeature);
       XGUI_Workshop::deleteFeatures(anObjects, anIgnoredFeatures);
     }
     myExternalObject = ObjectPtr();
index 13fd7bfcf4b915247bfa6b6d7d1e532ecedbbda7..6d73ae8165369ccf3985d6439b23599fc6e3477f 100644 (file)
 
       <!--  SketchConstraintCoincedence  -->
       <feature id="SketchConstraintCoincidence" title="Coincident" tooltip="Create constraint for the coincidence of two points" icon=":icons/coincedence.png">
-        <sketch_shape_selector id="ConstraintEntityA" label="First point" tooltip="Select a first point" shape_types="vertex"/>
+        <sketch_shape_selector id="ConstraintEntityA" label="First point" tooltip="Select a first point" shape_types="vertex">
+          <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityB"/>
+        </sketch_shape_selector>
         <sketch_shape_selector id="ConstraintEntityB" label="Second point" tooltip="Select a second point" shape_types="vertex">
           <validator id="PartSet_DifferentObjects"/>
+          <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityA"/>
         </sketch_shape_selector>
         <validator id="PartSet_CoincidentSelection"/>
       </feature>
         icon=":icons/equal.png">
         <sketch_shape_selector id="ConstraintEntityA" 
             label="First object" tooltip="Select line, circle or arc" shape_types="edge">
+          <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityB"/>
         </sketch_shape_selector>
         
         <sketch_shape_selector id="ConstraintEntityB"
             label="Second object" tooltip="Select line, circle or arc" shape_types="edge">
           <validator id="SketchPlugin_EqualAttr" parameters="ConstraintEntityA"/>
           <validator id="PartSet_DifferentObjects"/>
+          <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityA"/>
         </sketch_shape_selector>
       </feature>