]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #711 Fatal error when Create extrusion cut
authornds <natalia.donis@opencascade.com>
Fri, 10 Jul 2015 15:20:45 +0000 (18:20 +0300)
committernds <natalia.donis@opencascade.com>
Fri, 10 Jul 2015 15:20:45 +0000 (18:20 +0300)
Chash by mpv: in sketch of Extrusion cut try to move over external edge, result is crash. It is caused by recursive delete of referenced features to the external edge. The extrusion cut was in the list of deleted features.

src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp
src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp
src/PartSet/PartSet_ExternalObjectsMgr.cpp
src/PartSet/PartSet_MenuMgr.cpp
src/PartSet/PartSet_Module.cpp
src/XGUI/XGUI_Workshop.h

index cc0b7b783e2eacf370bfa191a056ea2a4889f706..a89523b886c2c91b7652bf1ad78aa50371fbea71 100755 (executable)
@@ -79,7 +79,8 @@ void FeaturesPlugin_ExtrusionBoolean::makeSolids(const ListOfShape& theFaces,
                                                                                         aFromShape, aFromSize);
 
     // Checking that the algorithm worked properly.
-    if(!aPrismAlgo->isDone() || aPrismAlgo->shape()->isNull() || !aPrismAlgo->isValid()) {
+    if(!aPrismAlgo->isDone() || !aPrismAlgo->shape().get() || aPrismAlgo->shape()->isNull() ||
+       !aPrismAlgo->isValid()) {
       setError("Extrusion algorithm failed");
       theResults.clear();
       return;
index 7fd3e44cdfbebd936661899d0c745375dac657a6..d2ec7bd664ad679eb88279426951997be4081d59 100644 (file)
@@ -96,7 +96,8 @@ void FeaturesPlugin_RevolutionBoolean::makeSolids(const ListOfShape& theFaces,
                                                                                                   aFromShape, aFromAngle);
 
     // Checking that the algorithm worked properly.
-    if(!aRevolAlgo->isDone() || aRevolAlgo->shape()->isNull() || !aRevolAlgo->isValid()) {
+    if(!aRevolAlgo->isDone()  || !aRevolAlgo->shape().get() || aRevolAlgo->shape()->isNull() ||
+       !aRevolAlgo->isValid()) {
       setError("Revolution algorithm failed");
       theResults.clear();
       return;
index e171f43b5e8189444b015d49792d39c4eb6e6c70..2cdcd24bf149c737ff892b8532d21d23684088df 100644 (file)
@@ -90,7 +90,6 @@ void PartSet_ExternalObjectsMgr::removeExternal(const CompositeFeaturePtr& theSk
         anObjects.append(aFeature);
         // the external feature should be removed with all references, sketch feature should be ignored
         std::set<FeaturePtr> anIgnoredFeatures;
-        anIgnoredFeatures.insert(theSketch);
         // 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,
@@ -149,7 +148,6 @@ void PartSet_ExternalObjectsMgr::removeExternalObject(const ObjectPtr& theObject
       anObjects.append(aFeature);
       // the external feature should be removed with all references, sketch feature should be ignored
       std::set<FeaturePtr> anIgnoredFeatures;
-      anIgnoredFeatures.insert(theSketch);
       // 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,
index e09654f96a5b21e1ba5a4fc312e9f2d567c50c4b..dfc184a42646b09abc8555f9331ea3d1b767ec12 100644 (file)
@@ -283,12 +283,10 @@ void PartSet_MenuMgr::onLineDetach(QAction* theAction)
       anOperation->abort();
 
     SessionPtr aMgr = ModelAPI_Session::get();
-    std::set<FeaturePtr> anIgnoredFeatures;
-    anIgnoredFeatures.insert(myModule->sketchMgr()->activeSketch());
 
     QString aName = tr("Detach %1").arg(aLine->data()->name().c_str());
     aMgr->startOperation(aName.toStdString());
-    aWorkshop->deleteFeatures(aToDelFeatures, anIgnoredFeatures);
+    aWorkshop->deleteFeatures(aToDelFeatures);
     aMgr->finishOperation();
   }
   myCoinsideLines.clear();
index 9559e6bb5d7d74c9016dcae054f9bc466391242b..018ae1706ad55270e23d222796e6103b1d838f39 100644 (file)
@@ -605,10 +605,7 @@ bool PartSet_Module::deleteObjects()
     // 4. delete features
     // sketch feature should be skipped, only sub-features can be removed
     // when sketch operation is active
-    std::set<FeaturePtr> anIgnoredFeatures;
-    anIgnoredFeatures.insert(mySketchMgr->activeSketch());
-    aWorkshop->deleteFeatures(aSketchObjects, anIgnoredFeatures);
-  
+    aWorkshop->deleteFeatures(aSketchObjects);
     // 5. stop operation
     aWorkshop->displayer()->updateViewer();
     aMgr->finishOperation();
index 92be69c9d8c708ac15f9530581e804959510db68..eda29c115794bb86a3c44e329817bad647b6da35 100644 (file)
@@ -219,7 +219,7 @@ Q_OBJECT
   //! objects features appear. If the user chose do not continue, the deletion is not performed
   //! \return the success of the delete 
   bool deleteFeatures(const QObjectPtrList& theList,
-                      const std::set<FeaturePtr>& theIgnoredFeatures,
+                      const std::set<FeaturePtr>& theIgnoredFeatures = std::set<FeaturePtr>(),
                       QWidget* theParent = 0,
                       const bool theAskAboutDeleteReferences = false);