Skip to content
Permalink
Browse files

Doxymentation

  • Loading branch information
m-kuhn authored and 3nids committed Sep 11, 2015
1 parent efcbbfd commit dae0d4a1a2a58f7d31ee0ad42ac8746b3e04df88
Showing with 79 additions and 0 deletions.
  1. +32 −0 src/gui/qgsmapmouseevent.h
  2. +47 −0 src/gui/qgsmaptooladvanceddigitizing.h
@@ -50,6 +50,16 @@ class GUI_EXPORT QgsMapMouseEvent : public QMouseEvent
*/
QgsMapMouseEvent( QgsMapCanvas* mapCanvas, QMouseEvent* event );

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

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

/**
* Set the (snapped) point this event points to in map coordinates.
* The point in pixel coordinates will be calculated accordingly.
*
* @param point The point in map coordinates
*/
void setMapPoint( const QgsPoint& point );

/**
* Returns the original, unmodified map point of the mouse cursor.
*
* @return The cursor position in map coordinates.
*/
QgsPoint originalMapPoint() const { return mMapPoint; }

/**
* The snapped mouse cursor in pixel coordinates.
*
* @return The snapped mouse cursor position in pixel coordinates.
*/
QPoint pixelPoint() const { return mPixelPoint; }

/**
* The unsnapped, real mouse cursor position in pixel coordinates.
* Alias to pos()
*
* @return Mouse position in pixel coordinates
*/
QPoint originalPixelPoint() const { return pos(); }

private:
@@ -54,17 +54,56 @@ class GUI_EXPORT QgsMapToolAdvancedDigitizing : public QgsMapToolEdit
//! catch the mouse move event, filters it, transforms it to map coordinates and send it to virtual method
void canvasMoveEvent( QgsMapMouseEvent* e ) override;

/**
* The capture mode
*
* @return Capture mode
*/
CaptureMode mode() const { return mCaptureMode; }

/**
* Registers this maptool with the cad dock widget
*/
void activate();

/**
* Unregisters this maptool from the cad dock widget
*/
void deactivate();

QgsAdvancedDigitizingDockWidget* cadDockWidget() const { return mCadDockWidget; }

protected:
/**
* Override this method when subclassing this class.
* This will receive adapted events from the cad system whenever a
* canvasPressEvent is triggered and it's not hidden by the cad's
* construction mode.
*
* @param e Mouse events prepared by the cad system
*/
virtual void cadCanvasPressEvent( QgsMapMouseEvent* e ) { Q_UNUSED( e ) }


/**
* Override this method when subclassing this class.
* This will receive adapted events from the cad system whenever a
* canvasReleaseEvent is triggered and it's not hidden by the cad's
* construction mode.
*
* @param e Mouse events prepared by the cad system
*/
virtual void cadCanvasReleaseEvent( QgsMapMouseEvent* e ) { Q_UNUSED( e ) }


/**
* Override this method when subclassing this class.
* This will receive adapted events from the cad system whenever a
* canvasMoveEvent is triggered and it's not hidden by the cad's
* construction mode.
*
* @param e Mouse events prepared by the cad system
*/
virtual void cadCanvasMoveEvent( QgsMapMouseEvent* e ) { Q_UNUSED( e ) }

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

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

private:

0 comments on commit dae0d4a

Please sign in to comment.
You can’t perform that action at this time.