1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_WidgetSubShapeSelector.h
4 // Created: 21 Jul 2016
5 // Author: Natalia ERMOLAEVA
8 #ifndef PartSet_WidgetSubShapeSelector_H
9 #define PartSet_WidgetSubShapeSelector_H
13 #include <PartSet_WidgetShapeSelector.h>
14 #include <PartSet_MouseProcessor.h>
21 class ModuleBase_IWorkshop;
22 class Config_WidgetAPI;
23 class ModuleBase_IViewWindow;
24 class ModuleBase_ViewerPrs;
31 * Customosation of PartSet_WidgetSubShapeSelector in order to visualize sub-shape
32 * by mouse move over shape in the viewer. Split of the object is performed by
33 * coincident points to the object. Segment between nearest coincidence is highlighted
35 class PARTSET_EXPORT PartSet_WidgetSubShapeSelector: public PartSet_WidgetShapeSelector,
36 public PartSet_MouseProcessor
41 /// \param theParent the parent object
42 /// \param theWorkshop instance of workshop interface
43 /// \param theData the widget configuation. The attribute of the model widget is obtained from
44 PartSet_WidgetSubShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
45 const Config_WidgetAPI* theData);
47 virtual ~PartSet_WidgetSubShapeSelector();
49 /// The methiod called when widget is deactivated
50 virtual void deactivate();
52 /// Processing the mouse move event in the viewer
53 /// \param theWindow a view window
54 /// \param theEvent a mouse event
55 virtual void mouseMoved(ModuleBase_IViewWindow* theWindow, QMouseEvent* theEvent);
57 /// Returns values which should be highlighted when the whidget is active
58 /// \param theValues a list of presentations
59 virtual void getHighlighted(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues);
62 /// Checks the widget validity. By default, it returns true.
63 /// \param thePrs a selected presentation in the view
64 /// \return a boolean value
65 //virtual bool isValidSelectionCustom(const std::shared_ptr<ModuleBase_ViewerPrs>& thePrs);
67 /// Return an object and geom shape by the viewer presentation
68 /// \param thePrs a selection
69 /// \param theObject an output object
70 /// \param theShape a shape of the selection
71 //virtual void getGeomSelection(const std::shared_ptr<ModuleBase_ViewerPrs>& thePrs,
72 // ObjectPtr& theObject,
73 // GeomShapePtr& theShape);
74 void fillObjectShapes(const ObjectPtr& theObject);
77 /// The methiod called when widget is activated
78 virtual void activateCustom();
81 std::shared_ptr<ModuleBase_ViewerPrs> myCurrentSubShape;
82 std::map<ObjectPtr, std::set<GeomShapePtr> > myCashedShapes;