Salome HOME
Issue #2440 Can't validate coincidence between a line and an imported line
authornds <nds@opencascade.com>
Thu, 15 Feb 2018 08:05:25 +0000 (11:05 +0300)
committernds <nds@opencascade.com>
Thu, 15 Feb 2018 08:05:25 +0000 (11:05 +0300)
Coincidence to exported line will create invalid projection feature which does not allow validating of the sketch. The projection should be removed.

src/PartSet/PartSet_Tools.cpp
src/XGUI/XGUI_Workshop.cpp

index 4430699bbc02829dd5bd88eebc410cf04d0573e9..4d00067fe084ec46420f2b670291c89d69ce9143 100755 (executable)
@@ -374,7 +374,13 @@ ResultPtr PartSet_Tools::createFixedObjectByExternal(
   AttributeRefAttrPtr aRefAttr = aProjectionFeature->data()->refattr(
     SketchPlugin_Projection::PROJECTED_FEATURE_ID());
   if (!aRefAttr || !aRefAttr->isInitialized())
+  {
+    // remove external feature if the attribute is not filled
+    std::set<FeaturePtr> aFeatures;
+    aFeatures.insert(aProjectionFeature);
+    ModelAPI_Tools::removeFeaturesAndReferences(aFeatures);
     return ResultPtr();
+  }
 
   FeaturePtr aProjection = ModelAPI_Feature::feature(aRefAttr->object());
   if (aProjection.get() && aProjection->lastResult().get())
index db264ad2b9692a920a7f7c0aec80633dae47293b..4ff214d084a3bc23046df4c383c8f206b65f5c31 100755 (executable)
@@ -1923,7 +1923,6 @@ void XGUI_Workshop::moveObjects()
 //**************************************************************
 bool XGUI_Workshop::deleteFeatures(const QObjectPtrList& theObjects)
 {
-  std::map<FeaturePtr, std::set<FeaturePtr> > aReferences;
   std::set<FeaturePtr> aFeatures;
   ModuleBase_Tools::convertToFeatures(theObjects, aFeatures);