QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
QgsMapToolShapeAbstract Class Referenceabstract

QgsMapToolShapeAbstract is a base class for shape map tools to be used by QgsMapToolCapture. More...

#include <qgsmaptoolshapeabstract.h>

Inheritance diagram for QgsMapToolShapeAbstract:
Inheritance graph
[legend]

Public Types

enum class  ShapeCategory {
  Curve , Circle , Ellipse , Rectangle ,
  RegularPolygon
}
 List of different shapes. More...
 

Public Member Functions

 QgsMapToolShapeAbstract (const QString &id, QgsMapToolCapture *parentTool)
 Constructor.
 
virtual ~QgsMapToolShapeAbstract ()
 
virtual void activate (QgsMapToolCapture::CaptureMode mode, const QgsPoint &lastCapturedMapPoint)
 Activates the map tool with the last captured map point.
 
virtual void cadCanvasMoveEvent (QgsMapMouseEvent *e, QgsMapToolCapture::CaptureMode mode)=0
 Called for a mouse move event.
 
virtual bool cadCanvasReleaseEvent (QgsMapMouseEvent *e, QgsMapToolCapture::CaptureMode mode)=0
 Called for a mouse release event Must return true if the digitization has ended and the geometry is correctly set.
 
virtual void clean ()
 Called to clean the map tool (after canceling the operation or when the digitization has finished)
 
virtual void deactivate ()
 Deactivates the map tool.
 
QString id () const
 Returns the id of the shape tool (equivalent to the one from the metadata)
 
virtual void keyPressEvent (QKeyEvent *e)
 Filters a key press event Ignores the event in default implementation.
 
virtual void keyReleaseEvent (QKeyEvent *e)
 Filters a key release event Ignores the event in default implementation.
 
virtual void undo ()
 Called to undo last action (last point added)
 

Protected Attributes

QgsMapToolCapturemParentTool = nullptr
 
QgsPointSequence mPoints
 points (in map coordinates)
 
QgsGeometryRubberBandmTempRubberBand = nullptr
 

Detailed Description

QgsMapToolShapeAbstract is a base class for shape map tools to be used by QgsMapToolCapture.

Since
QGIS 3.26

Definition at line 40 of file qgsmaptoolshapeabstract.h.

Member Enumeration Documentation

◆ ShapeCategory

List of different shapes.

Enumerator
Curve 

Curve.

Circle 

Circle.

Ellipse 

Ellipse.

Rectangle 

Rectangle.

RegularPolygon 

RegularPolygon (e.g pentagons or hexagons)

Definition at line 46 of file qgsmaptoolshapeabstract.h.

Constructor & Destructor Documentation

◆ QgsMapToolShapeAbstract()

QgsMapToolShapeAbstract::QgsMapToolShapeAbstract ( const QString &  id,
QgsMapToolCapture parentTool 
)
inline

Constructor.

Definition at line 57 of file qgsmaptoolshapeabstract.h.

◆ ~QgsMapToolShapeAbstract()

QgsMapToolShapeAbstract::~QgsMapToolShapeAbstract ( )
virtual

Definition at line 25 of file qgsmaptoolshapeabstract.cpp.

Member Function Documentation

◆ activate()

virtual void QgsMapToolShapeAbstract::activate ( QgsMapToolCapture::CaptureMode  mode,
const QgsPoint lastCapturedMapPoint 
)
inlinevirtual

Activates the map tool with the last captured map point.

Definition at line 91 of file qgsmaptoolshapeabstract.h.

◆ cadCanvasMoveEvent()

virtual void QgsMapToolShapeAbstract::cadCanvasMoveEvent ( QgsMapMouseEvent e,
QgsMapToolCapture::CaptureMode  mode 
)
pure virtual

Called for a mouse move event.

◆ cadCanvasReleaseEvent()

virtual bool QgsMapToolShapeAbstract::cadCanvasReleaseEvent ( QgsMapMouseEvent e,
QgsMapToolCapture::CaptureMode  mode 
)
pure virtual

Called for a mouse release event Must return true if the digitization has ended and the geometry is correctly set.

◆ clean()

void QgsMapToolShapeAbstract::clean ( )
virtual

Called to clean the map tool (after canceling the operation or when the digitization has finished)

Definition at line 40 of file qgsmaptoolshapeabstract.cpp.

◆ deactivate()

virtual void QgsMapToolShapeAbstract::deactivate ( )
inlinevirtual

Deactivates the map tool.

Definition at line 94 of file qgsmaptoolshapeabstract.h.

◆ id()

QString QgsMapToolShapeAbstract::id ( ) const
inline

Returns the id of the shape tool (equivalent to the one from the metadata)

Definition at line 67 of file qgsmaptoolshapeabstract.h.

◆ keyPressEvent()

void QgsMapToolShapeAbstract::keyPressEvent ( QKeyEvent *  e)
virtual

Filters a key press event Ignores the event in default implementation.

Definition at line 30 of file qgsmaptoolshapeabstract.cpp.

◆ keyReleaseEvent()

void QgsMapToolShapeAbstract::keyReleaseEvent ( QKeyEvent *  e)
virtual

Filters a key release event Ignores the event in default implementation.

Definition at line 35 of file qgsmaptoolshapeabstract.cpp.

◆ undo()

void QgsMapToolShapeAbstract::undo ( )
virtual

Called to undo last action (last point added)

Definition at line 51 of file qgsmaptoolshapeabstract.cpp.

Member Data Documentation

◆ mParentTool

QgsMapToolCapture* QgsMapToolShapeAbstract::mParentTool = nullptr
protected

Definition at line 106 of file qgsmaptoolshapeabstract.h.

◆ mPoints

QgsPointSequence QgsMapToolShapeAbstract::mPoints
protected

points (in map coordinates)

Definition at line 109 of file qgsmaptoolshapeabstract.h.

◆ mTempRubberBand

QgsGeometryRubberBand* QgsMapToolShapeAbstract::mTempRubberBand = nullptr
protected

Definition at line 111 of file qgsmaptoolshapeabstract.h.


The documentation for this class was generated from the following files: