QGIS API Documentation  2.99.0-Master (6a61179)
Public Types | Public Member Functions | Protected Attributes | List of all members
QgsVertexMarker Class Reference

A class for marking vertices of features using e.g. More...

#include <qgsvertexmarker.h>

Inheritance diagram for QgsVertexMarker:
Inheritance graph
[legend]

Public Types

enum  IconType {
  ICON_NONE, ICON_CROSS, ICON_X, ICON_BOX,
  ICON_CIRCLE
}
 Icons. More...
 

Public Member Functions

 QgsVertexMarker (QgsMapCanvas *mapCanvas)
 
QRectF boundingRect () const override
 default implementation for canvas items More...
 
void paint (QPainter *p) override
 function to be implemented by derived classes More...
 
void setCenter (const QgsPoint &point)
 
void setColor (const QColor &color)
 
void setIconSize (int iconSize)
 
void setIconType (int iconType)
 
void setPenWidth (int width)
 
virtual void updatePosition () override
 called on changed extent or resize event to update position of the item More...
 
- Public Member Functions inherited from QgsMapCanvasItem
QgsRectangle rect () const
 returns canvas item rectangle in map units More...
 
void setRect (const QgsRectangle &r, bool resetRotation=true)
 sets canvas item rectangle in map units More...
 
QPointF toCanvasCoordinates (const QgsPoint &point) const
 transformation from map coordinates to screen coordinates More...
 
QgsPoint toMapCoordinates (QPoint point) const
 transformation from screen coordinates to map coordinates More...
 

Protected Attributes

QgsPoint mCenter
 coordinates of the point in the center More...
 
QColor mColor
 color of the marker More...
 
int mIconSize
 size More...
 
int mIconType
 icon to be shown More...
 
int mPenWidth
 pen width More...
 
- Protected Attributes inherited from QgsMapCanvasItem
QSizeF mItemSize
 cached size of the item (to return in boundingRect()) More...
 
QgsMapCanvasmMapCanvas
 pointer to map canvas More...
 
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. More...
 
double mRectRotation
 

Additional Inherited Members

- Protected Member Functions inherited from QgsMapCanvasItem
 QgsMapCanvasItem (QgsMapCanvas *mapCanvas)
 protected constructor: cannot be constructed directly More...
 
virtual ~QgsMapCanvasItem ()
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
 paint function called by map canvas More...
 
bool setRenderContextVariables (QPainter *p, QgsRenderContext &context) const
 Sets render context parameters. More...
 
void updateCanvas ()
 schedules map canvas for repaint More...
 

Detailed Description

A class for marking vertices of features using e.g.

circles or 'x'.

Definition at line 27 of file qgsvertexmarker.h.

Member Enumeration Documentation

§ IconType

Icons.

Enumerator
ICON_NONE 
ICON_CROSS 
ICON_X 
ICON_BOX 
ICON_CIRCLE 

Definition at line 32 of file qgsvertexmarker.h.

Constructor & Destructor Documentation

§ QgsVertexMarker()

QgsVertexMarker::QgsVertexMarker ( QgsMapCanvas mapCanvas)

Definition at line 21 of file qgsvertexmarker.cpp.

Member Function Documentation

§ boundingRect()

QRectF QgsVertexMarker::boundingRect ( ) const
overridevirtual

default implementation for canvas items

Reimplemented from QgsMapCanvasItem.

Definition at line 94 of file qgsvertexmarker.cpp.

§ paint()

void QgsVertexMarker::paint ( QPainter *  painter)
overridevirtual

function to be implemented by derived classes

Implements QgsMapCanvasItem.

Definition at line 57 of file qgsvertexmarker.cpp.

§ setCenter()

void QgsVertexMarker::setCenter ( const QgsPoint point)

Definition at line 40 of file qgsvertexmarker.cpp.

§ setColor()

void QgsVertexMarker::setColor ( const QColor &  color)

Definition at line 47 of file qgsvertexmarker.cpp.

§ setIconSize()

void QgsVertexMarker::setIconSize ( int  iconSize)

Definition at line 35 of file qgsvertexmarker.cpp.

§ setIconType()

void QgsVertexMarker::setIconType ( int  iconType)

Definition at line 30 of file qgsvertexmarker.cpp.

§ setPenWidth()

void QgsVertexMarker::setPenWidth ( int  width)

Definition at line 52 of file qgsvertexmarker.cpp.

§ updatePosition()

void QgsVertexMarker::updatePosition ( )
overridevirtual

called on changed extent or resize event to update position of the item

Reimplemented from QgsMapCanvasItem.

Definition at line 100 of file qgsvertexmarker.cpp.

Member Data Documentation

§ mCenter

QgsPoint QgsVertexMarker::mCenter
protected

coordinates of the point in the center

Definition at line 68 of file qgsvertexmarker.h.

§ mColor

QColor QgsVertexMarker::mColor
protected

color of the marker

Definition at line 71 of file qgsvertexmarker.h.

§ mIconSize

int QgsVertexMarker::mIconSize
protected

size

Definition at line 65 of file qgsvertexmarker.h.

§ mIconType

int QgsVertexMarker::mIconType
protected

icon to be shown

Definition at line 62 of file qgsvertexmarker.h.

§ mPenWidth

int QgsVertexMarker::mPenWidth
protected

pen width

Definition at line 74 of file qgsvertexmarker.h.


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