]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Launch Sketch with ExtrusionCut
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 9 Jun 2015 16:13:41 +0000 (19:13 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 9 Jun 2015 16:13:41 +0000 (19:13 +0300)
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_WidgetSketchLabel.cpp

index a086aa8685b0dafb1caa80733939b1a2c7697f6b..df93f32a21a0ae428b83e7d427d7e460f7f75f0c 100644 (file)
@@ -716,16 +716,19 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation)
     myPlaneFilter = new ModuleBase_ShapeInPlaneFilter();
 
   myModule->workshop()->viewer()->addSelectionFilter(myPlaneFilter);
+  bool aHasPlane = false;
   if (theOperation->isEditOperation()) {
     // If it is editing of sketch then it means that plane is already defined
     std::shared_ptr<GeomAPI_Pln> aPln = PartSet_Tools::sketchPlane(myCurrentSketch);
-    if (aPln.get())
+    if (aPln.get()) {
       myPlaneFilter->setPlane(aPln->impl<gp_Pln>());
+      aHasPlane = true;
+    }
   }
   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 (theOperation->isEditOperation())
+  if (theOperation->isEditOperation() && aHasPlane)
     aConnector->activateModuleSelectionModes();
 }
 
index 82b234fff5363f5fef6b90dbd1230a2407d6fab8..0d1b2bd2c4112a90aca806c3fce08e0f18da5911 100644 (file)
@@ -354,7 +354,7 @@ std::shared_ptr<GeomAPI_Dir> PartSet_WidgetSketchLabel::setSketchPlane(const Top
 {
   if (theShape.IsNull())
     return std::shared_ptr<GeomAPI_Dir>();
-  int aType = theShape.ShapeType();
+
   // get selected shape
   std::shared_ptr<GeomAPI_Shape> aGShape(new GeomAPI_Shape);
   aGShape->setImpl(new TopoDS_Shape(theShape));