Skip to content

Commit dae0d4a

Browse files
m-kuhn3nids
authored andcommitted
Doxymentation
1 parent efcbbfd commit dae0d4a

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

src/gui/qgsmapmouseevent.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ class GUI_EXPORT QgsMapMouseEvent : public QMouseEvent
5050
*/
5151
QgsMapMouseEvent( QgsMapCanvas* mapCanvas, QMouseEvent* event );
5252

53+
/**
54+
* Creates a new QgsMapMouseEvent. Should only be required to be called from the QgsMapCanvas.
55+
*
56+
* @param mapCanvas The map canvas on which the event occured
57+
* @param type The type of the event
58+
* @param pos The pixel position of the mouse
59+
* @param button The pressed button
60+
* @param buttons Further buttons that are pressed
61+
* @param modifiers Keyboard modifiers
62+
*/
5363
QgsMapMouseEvent( QgsMapCanvas* mapCanvas, Type type, const QPoint &pos, Qt::MouseButton button = Qt::NoButton,
5464
Qt::MouseButtons buttons = Qt::NoButton, Qt::KeyboardModifiers modifiers = Qt::NoModifier );
5565

@@ -82,12 +92,34 @@ class GUI_EXPORT QgsMapMouseEvent : public QMouseEvent
8292
*/
8393
inline QgsPoint mapPoint() const { return mMapPoint; }
8494

95+
/**
96+
* Set the (snapped) point this event points to in map coordinates.
97+
* The point in pixel coordinates will be calculated accordingly.
98+
*
99+
* @param point The point in map coordinates
100+
*/
85101
void setMapPoint( const QgsPoint& point );
86102

103+
/**
104+
* Returns the original, unmodified map point of the mouse cursor.
105+
*
106+
* @return The cursor position in map coordinates.
107+
*/
87108
QgsPoint originalMapPoint() const { return mMapPoint; }
88109

110+
/**
111+
* The snapped mouse cursor in pixel coordinates.
112+
*
113+
* @return The snapped mouse cursor position in pixel coordinates.
114+
*/
89115
QPoint pixelPoint() const { return mPixelPoint; }
90116

117+
/**
118+
* The unsnapped, real mouse cursor position in pixel coordinates.
119+
* Alias to pos()
120+
*
121+
* @return Mouse position in pixel coordinates
122+
*/
91123
QPoint originalPixelPoint() const { return pos(); }
92124

93125
private:

src/gui/qgsmaptooladvanceddigitizing.h

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,56 @@ class GUI_EXPORT QgsMapToolAdvancedDigitizing : public QgsMapToolEdit
5454
//! catch the mouse move event, filters it, transforms it to map coordinates and send it to virtual method
5555
void canvasMoveEvent( QgsMapMouseEvent* e ) override;
5656

57+
/**
58+
* The capture mode
59+
*
60+
* @return Capture mode
61+
*/
5762
CaptureMode mode() const { return mCaptureMode; }
5863

64+
/**
65+
* Registers this maptool with the cad dock widget
66+
*/
5967
void activate();
6068

69+
/**
70+
* Unregisters this maptool from the cad dock widget
71+
*/
6172
void deactivate();
6273

6374
QgsAdvancedDigitizingDockWidget* cadDockWidget() const { return mCadDockWidget; }
6475

6576
protected:
77+
/**
78+
* Override this method when subclassing this class.
79+
* This will receive adapted events from the cad system whenever a
80+
* canvasPressEvent is triggered and it's not hidden by the cad's
81+
* construction mode.
82+
*
83+
* @param e Mouse events prepared by the cad system
84+
*/
6685
virtual void cadCanvasPressEvent( QgsMapMouseEvent* e ) { Q_UNUSED( e ) }
86+
87+
88+
/**
89+
* Override this method when subclassing this class.
90+
* This will receive adapted events from the cad system whenever a
91+
* canvasReleaseEvent is triggered and it's not hidden by the cad's
92+
* construction mode.
93+
*
94+
* @param e Mouse events prepared by the cad system
95+
*/
6796
virtual void cadCanvasReleaseEvent( QgsMapMouseEvent* e ) { Q_UNUSED( e ) }
97+
98+
99+
/**
100+
* Override this method when subclassing this class.
101+
* This will receive adapted events from the cad system whenever a
102+
* canvasMoveEvent is triggered and it's not hidden by the cad's
103+
* construction mode.
104+
*
105+
* @param e Mouse events prepared by the cad system
106+
*/
68107
virtual void cadCanvasMoveEvent( QgsMapMouseEvent* e ) { Q_UNUSED( e ) }
69108

70109
CaptureMode mCaptureMode;
@@ -75,6 +114,14 @@ class GUI_EXPORT QgsMapToolAdvancedDigitizing : public QgsMapToolEdit
75114
bool mSnapOnDoubleClick;
76115

77116
private slots:
117+
/**
118+
* Is to be called by the cad system whenever a point changes outside of a
119+
* mouse event. E.g. when additional constraints are triggered.
120+
* The specified point will be used to generate a fake mouse event which will
121+
* be sent as move event to cadCanvasMoveEvent.
122+
*
123+
* @param point The last point known to the cad system.
124+
*/
78125
void cadPointChanged( const QgsPoint& point );
79126

80127
private:

0 commit comments

Comments
 (0)