QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
|
A class for marking vertices of features using e.g. More...
#include <qgsvertexmarker.h>
Public Types | |
enum | IconType { ICON_NONE , ICON_CROSS , ICON_X , ICON_BOX , ICON_CIRCLE , ICON_DOUBLE_TRIANGLE , ICON_TRIANGLE , ICON_RHOMBUS , ICON_INVERTED_TRIANGLE } |
Icons. More... | |
Public Member Functions | |
QgsVertexMarker (QgsMapCanvas *mapCanvas) | |
QRectF | boundingRect () const override |
QgsPointXY | center () const |
Returns the center point of the marker, in map coordinates. | |
QColor | color () const |
Returns the stroke color for the marker. | |
QColor | fillColor () const |
Returns the fill color for the marker. | |
void | paint (QPainter *p) override |
function to be implemented by derived classes | |
void | setCenter (const QgsPointXY &point) |
Sets the center point of the marker, in map coordinates. | |
void | setColor (const QColor &color) |
Sets the stroke color for the marker. | |
void | setFillColor (const QColor &color) |
Sets the fill color for the marker. | |
void | setIconSize (int iconSize) |
void | setIconType (int iconType) |
void | setPenWidth (int width) |
void | updatePosition () override |
called on changed extent or resize event to update position of the item | |
Public Member Functions inherited from QgsMapCanvasItem | |
QRectF | boundingRect () const override |
QgsRectangle | rect () const |
returns canvas item rectangle in map units | |
void | setRect (const QgsRectangle &r, bool resetRotation=true) |
sets canvas item rectangle in map units | |
QPointF | toCanvasCoordinates (const QgsPointXY &point) const |
transformation from map coordinates to screen coordinates | |
QgsPointXY | toMapCoordinates (QPoint point) const |
transformation from screen coordinates to map coordinates | |
Additional Inherited Members | |
Protected Member Functions inherited from QgsMapCanvasItem | |
QgsMapCanvasItem (QgsMapCanvas *mapCanvas) | |
protected constructor: cannot be constructed directly | |
~QgsMapCanvasItem () override | |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override |
bool | setRenderContextVariables (QPainter *p, QgsRenderContext &context) const |
Sets render context parameters. | |
void | updateCanvas () |
schedules map canvas for repaint | |
Protected Attributes inherited from QgsMapCanvasItem | |
QSizeF | mItemSize |
cached size of the item (to return in boundingRect()) | |
QgsMapCanvas * | mMapCanvas = nullptr |
pointer to map canvas | |
QgsRectangle | mRect |
cached canvas item rectangle in map coordinates encodes position (xmin,ymax) and size (width/height) used to re-position and re-size the item on zoom/pan while waiting for the renderer to complete. | |
double | mRectRotation |
A class for marking vertices of features using e.g.
circles or 'x'.
Definition at line 36 of file qgsvertexmarker.h.
Icons.
Definition at line 50 of file qgsvertexmarker.h.
QgsVertexMarker::QgsVertexMarker | ( | QgsMapCanvas * | mapCanvas | ) |
Definition at line 21 of file qgsvertexmarker.cpp.
|
override |
Definition at line 138 of file qgsvertexmarker.cpp.
|
inline |
Returns the center point of the marker, in map coordinates.
Definition at line 78 of file qgsvertexmarker.h.
|
inline |
Returns the stroke color for the marker.
Definition at line 96 of file qgsvertexmarker.h.
|
inline |
Returns the fill color for the marker.
This setting only applies to some icon types.
Definition at line 112 of file qgsvertexmarker.h.
|
overridevirtual |
function to be implemented by derived classes
Implements QgsMapCanvasItem.
Definition at line 63 of file qgsvertexmarker.cpp.
void QgsVertexMarker::setCenter | ( | const QgsPointXY & | point | ) |
Sets the center point of the marker, in map coordinates.
Definition at line 39 of file qgsvertexmarker.cpp.
void QgsVertexMarker::setColor | ( | const QColor & | color | ) |
Sets the stroke color for the marker.
Definition at line 46 of file qgsvertexmarker.cpp.
void QgsVertexMarker::setFillColor | ( | const QColor & | color | ) |
Sets the fill color for the marker.
This setting only applies to some icon types.
Definition at line 52 of file qgsvertexmarker.cpp.
void QgsVertexMarker::setIconSize | ( | int | iconSize | ) |
Definition at line 33 of file qgsvertexmarker.cpp.
void QgsVertexMarker::setIconType | ( | int | iconType | ) |
Definition at line 27 of file qgsvertexmarker.cpp.
void QgsVertexMarker::setPenWidth | ( | int | width | ) |
Definition at line 58 of file qgsvertexmarker.cpp.
|
overridevirtual |
called on changed extent or resize event to update position of the item
Reimplemented from QgsMapCanvasItem.
Definition at line 144 of file qgsvertexmarker.cpp.