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>();
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());
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();