]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1220 Crash when creating an arc passing through the arc connected to both...
authornds <nds@opencascade.com>
Wed, 12 Apr 2017 13:13:55 +0000 (16:13 +0300)
committernds <nds@opencascade.com>
Wed, 12 Apr 2017 13:14:14 +0000 (16:14 +0300)
src/PartSet/PartSet_SketcherReentrantMgr.cpp
src/PartSet/PartSet_WidgetPoint2d.cpp
src/PartSet/PartSet_WidgetPoint2d.h

index 23e759020ed5c723cf7f434759177d40bfdd3b8a..7006876a4dfd44aad1d85b479908334d8662c1a3 100644 (file)
@@ -233,8 +233,16 @@ bool PartSet_SketcherReentrantMgr::processMouseReleased(ModuleBase_IViewWindow*
 
       myClickedSketchPoint = PartSet_Tools::getPnt2d(theEvent, theWindow,
                                                      module()->sketchMgr()->activeSketch());
-      if (!aPreSelected.empty())
-        module()->getGeomSelection(aPreSelected.first(), mySelectedObject, mySelectedAttribute);
+      if (!aPreSelected.empty()) {
+        ModuleBase_ViewerPrsPtr aValue = aPreSelected.first();
+        module()->getGeomSelection(aValue, mySelectedObject, mySelectedAttribute);
+
+        PartSet_WidgetPoint2D* aPointWidget = dynamic_cast<PartSet_WidgetPoint2D*>(anActiveWidget);
+        if (aPointWidget) {
+          GeomShapePtr aShape;
+          aPointWidget->getGeomSelection_(aValue, mySelectedObject, aShape);
+        }
+      }
 
       restartOperation();
       myClickedSketchPoint = std::shared_ptr<GeomAPI_Pnt2d>();
index ceb12eff04c64c8767666493eedfb52fb7c56e9c..56b1e9852ff693f9ec2861186092d655f31269db 100644 (file)
@@ -704,6 +704,13 @@ void PartSet_WidgetPoint2D::setPreSelection(
   myPreSelected = ModuleBase_ViewerPrsPtr();
 }
 
+void PartSet_WidgetPoint2D::getGeomSelection_(const std::shared_ptr<ModuleBase_ViewerPrs>& theValue,
+                                              ObjectPtr& theObject,
+                                              GeomShapePtr& theShape)
+{
+  myExternalObjectMgr->getGeomSelection(theValue, theObject, theShape, myWorkshop, sketch(), true);
+}
+
 void PartSet_WidgetPoint2D::mouseMoved(ModuleBase_IViewWindow* theWindow, QMouseEvent* theEvent)
 {
   PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
index 06b8e4a3771b6180909f003f7a8902e15fe9ef9f..4c7659deb88888dac7ab06cd339ac94baeb8037a 100755 (executable)
@@ -132,6 +132,14 @@ Q_OBJECT
                                ModuleBase_IViewWindow* theWnd,
                                QMouseEvent* theEvent);
 
+  /// Return an object and geom shape by the viewer presentation
+  /// \param thePrs a selection
+  /// \param theObject an output object
+  /// \param theShape a shape of the selection
+  void getGeomSelection_(const std::shared_ptr<ModuleBase_ViewerPrs>& theValue,
+                         std::shared_ptr<ModelAPI_Object>& theObject,
+                         std::shared_ptr<GeomAPI_Shape>& theShape);
+
 signals:
   /// Signal about selection of an existing vertex from an object
   void vertexSelected();