]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1343. Improvement of Extrusion and Revolution operations: correction for case...
authornds <nds@opencascade.com>
Thu, 7 Apr 2016 10:11:14 +0000 (13:11 +0300)
committernds <nds@opencascade.com>
Thu, 7 Apr 2016 10:11:38 +0000 (13:11 +0300)
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_Tools.cpp

index 5aefe05ee09867a0d55cbd4829162f558a5f6ce3..22c4b653a1c586ccf11b1a317a6da2db49a12372 100755 (executable)
@@ -891,18 +891,13 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation)
   myModule->workshop()->viewer()->addSelectionFilter(myPlaneFilter);
   bool aHasPlane = false;
   std::shared_ptr<GeomAPI_Pln> aPln;
-  if (aFOperation->isEditOperation()) {
-    // If it is editing of sketch then it means that plane is already defined
-    aPln = PartSet_Tools::sketchPlane(myCurrentSketch);
-    if (aPln.get())
-      aHasPlane = true;
-  }
+  aPln = PartSet_Tools::sketchPlane(myCurrentSketch);
   myPlaneFilter->setPlane(aPln);
 
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
-  // all sketch objects should be activated in the sketch selection modes by edit operation start
-  // in case of creation operation, there is an active widget, which activates own selection mode
-  if (aFOperation->isEditOperation() && aHasPlane)
+  // all displayed objects should be activated in current selection modes according to switched
+  // plane filter
+  if (aPln.get())
     aConnector->activateModuleSelectionModes();
 }
 
index 96e50d7ac6c979b4abe48c8cb5bb5bc3a1397708..48a5c6a1cdc3cc0d2ba7014d0d52b385d4190315 100755 (executable)
@@ -397,7 +397,8 @@ std::shared_ptr<GeomAPI_Pln> PartSet_Tools::sketchPlane(CompositeFeaturePtr theS
         aData->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
     std::shared_ptr<GeomDataAPI_Dir> aNormal = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
         aData->attribute(SketchPlugin_Sketch::NORM_ID()));
-    if (aNormal && anOrigin) {
+    if (aNormal.get() && aNormal->isInitialized() &&
+        anOrigin.get() && anOrigin->isInitialized()) {
       double adX = aNormal->x();
       double adY = aNormal->y();
       double adZ = aNormal->z();