SHAPER  9.15.0
PartSet_MouseProcessor Class Reference

Interface for mouse events processing. More...

Inheritance diagram for PartSet_MouseProcessor:
Inheritance graph

Public Member Functions

virtual void mouseMoved (ModuleBase_IViewWindow *theWindow, QMouseEvent *theEvent)
 Processing the mouse move event in the viewer. More...
 
virtual void mousePressed (ModuleBase_IViewWindow *theWindow, QMouseEvent *theEvent)
 Processing the mouse press event in the viewer. More...
 
virtual void mouseReleased (ModuleBase_IViewWindow *theWindow, QMouseEvent *theEvent)
 Processing the mouse release event in the viewer. More...
 
virtual void mouseDoubleClick (ModuleBase_IViewWindow *theWindow, QMouseEvent *theEvent)
 Processing the mouse double click event in the viewer. More...
 
virtual void setPreSelection (const std::shared_ptr< ModuleBase_ViewerPrs > &thePreSelected, ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent)
 Fill preselection used in mouseReleased. More...
 

Static Public Member Functions

static bool convertPointToLocal (ModuleBase_IWorkshop *theWorkshop, const std::shared_ptr< ModelAPI_CompositeFeature > &theSketch, ModuleBase_IViewWindow *theWindow, const QPoint &theEventPos, double &theX, double &theY, bool theSnap=true, bool theHighlight=false, bool theAddOffset=false)
 Converts position of mouse cursor to local coordinates on sketch plane. More...
 

Detailed Description

Interface for mouse events processing.

Member Function Documentation

◆ mouseMoved()

virtual void PartSet_MouseProcessor::mouseMoved ( ModuleBase_IViewWindow theWindow,
QMouseEvent *  theEvent 
)
inlinevirtual

Processing the mouse move event in the viewer.

Parameters
theWindowa view window
theEventa mouse event

Reimplemented in PartSet_WidgetPoint2D, PartSet_WidgetFeaturePointSelector, and PartSet_WidgetBSplinePoints.

◆ mousePressed()

virtual void PartSet_MouseProcessor::mousePressed ( ModuleBase_IViewWindow theWindow,
QMouseEvent *  theEvent 
)
inlinevirtual

Processing the mouse press event in the viewer.

Parameters
theWindowa view window
theEventa mouse event

◆ mouseReleased()

virtual void PartSet_MouseProcessor::mouseReleased ( ModuleBase_IViewWindow theWindow,
QMouseEvent *  theEvent 
)
inlinevirtual

Processing the mouse release event in the viewer.

Parameters
theWindowa view window
theEventa mouse event

Reimplemented in PartSet_WidgetPoint2D, PartSet_WidgetFeaturePointSelector, and PartSet_WidgetBSplinePoints.

◆ mouseDoubleClick()

virtual void PartSet_MouseProcessor::mouseDoubleClick ( ModuleBase_IViewWindow theWindow,
QMouseEvent *  theEvent 
)
inlinevirtual

Processing the mouse double click event in the viewer.

Parameters
theWindowa view window
theEventa mouse event

◆ setPreSelection()

virtual void PartSet_MouseProcessor::setPreSelection ( const std::shared_ptr< ModuleBase_ViewerPrs > &  thePreSelected,
ModuleBase_IViewWindow theWnd,
QMouseEvent *  theEvent 
)
inlinevirtual

Fill preselection used in mouseReleased.

Reimplemented in PartSet_WidgetPoint2D, and PartSet_WidgetFeaturePointSelector.

◆ convertPointToLocal()

bool PartSet_MouseProcessor::convertPointToLocal ( ModuleBase_IWorkshop theWorkshop,
const std::shared_ptr< ModelAPI_CompositeFeature > &  theSketch,
ModuleBase_IViewWindow theWindow,
const QPoint &  theEventPos,
double &  theX,
double &  theY,
bool  theSnap = true,
bool  theHighlight = false,
bool  theAddOffset = false 
)
static

Converts position of mouse cursor to local coordinates on sketch plane.

Snaps on-sketch-plane-coordinates to closest construction grid node.

Parameters
theEventPosis position of mouse cursor.
theXand
theYare local coordinates on sketch plane.
theSnaptheX and theY are snapped to construction grid if both theSnap == true and snapping is enabled.
theHighlightIf point is snapped, highlight grid point.
theAddOffsetIf true, serves as a remedy for odd crash during drawing of a line on a sketch.
Returns
true on success.