QGIS API Documentation  3.0.2-Girona (307d082)
Public Types | Public Member Functions | Protected Member Functions | List of all members
QgsGeometryRubberBand Class Reference

A rubberband class for QgsAbstractGeometry (considering curved geometries) More...

#include <qgsgeometryrubberband.h>

Inheritance diagram for QgsGeometryRubberBand:
Inheritance graph
[legend]

Public Types

enum  IconType {
  ICON_NONE, ICON_CROSS, ICON_X, ICON_BOX,
  ICON_CIRCLE, ICON_FULL_BOX
}
 

Public Member Functions

 QgsGeometryRubberBand (QgsMapCanvas *mapCanvas, QgsWkbTypes::GeometryType geomType=QgsWkbTypes::LineGeometry)
 
 ~QgsGeometryRubberBand () override
 
const QgsAbstractGeometrygeometry ()
 Returns a pointer to the geometry. More...
 
void moveVertex (QgsVertexId id, const QgsPoint &newPos)
 Moves vertex to new position (in map coordinates) More...
 
void setBrushStyle (Qt::BrushStyle brushStyle)
 Sets brush style. More...
 
void setFillColor (const QColor &c)
 Sets fill color for vertex markers. More...
 
void setGeometry (QgsAbstractGeometry *geom)
 Sets geometry (takes ownership). Geometry is expected to be in map coordinates. More...
 
void setIconType (IconType iconType)
 Sets vertex marker icon type. More...
 
void setLineStyle (Qt::PenStyle penStyle)
 Sets pen style. More...
 
void setStrokeColor (const QColor &c)
 Sets stroke color for vertex markers. More...
 
void setStrokeWidth (int width)
 Sets stroke width. More...
 
- Public Member Functions inherited from QgsMapCanvasItem
QRectF boundingRect () const override
 
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 QgsPointXY &point) const
 transformation from map coordinates to screen coordinates More...
 
QgsPointXY toMapCoordinates (QPoint point) const
 transformation from screen coordinates to map coordinates More...
 
virtual void updatePosition ()
 called on changed extent or resize event to update position of the item More...
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from QgsMapCanvasItem
QSizeF mItemSize
 cached size of the item (to return in boundingRect()) More...
 
QgsMapCanvasmMapCanvas = nullptr
 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
 

Detailed Description

A rubberband class for QgsAbstractGeometry (considering curved geometries)

Definition at line 35 of file qgsgeometryrubberband.h.

Member Enumeration Documentation

◆ IconType

Enumerator
ICON_NONE 

No icon is used.

ICON_CROSS 

A cross is used to highlight points (+)

ICON_X 

A cross is used to highlight points (x)

ICON_BOX 

A box is used to highlight points (□)

ICON_CIRCLE 

A circle is used to highlight points (○)

ICON_FULL_BOX 

A full box is used to highlight points (■)

Definition at line 38 of file qgsgeometryrubberband.h.

Constructor & Destructor Documentation

◆ QgsGeometryRubberBand()

QgsGeometryRubberBand::QgsGeometryRubberBand ( QgsMapCanvas mapCanvas,
QgsWkbTypes::GeometryType  geomType = QgsWkbTypes::LineGeometry 
)

Definition at line 24 of file qgsgeometryrubberband.cpp.

◆ ~QgsGeometryRubberBand()

QgsGeometryRubberBand::~QgsGeometryRubberBand ( )
override

Definition at line 31 of file qgsgeometryrubberband.cpp.

Member Function Documentation

◆ geometry()

const QgsAbstractGeometry* QgsGeometryRubberBand::geometry ( )
inline

Returns a pointer to the geometry.

Definition at line 78 of file qgsgeometryrubberband.h.

◆ moveVertex()

void QgsGeometryRubberBand::moveVertex ( QgsVertexId  id,
const QgsPoint newPos 
)

Moves vertex to new position (in map coordinates)

Definition at line 121 of file qgsgeometryrubberband.cpp.

◆ paint()

void QgsGeometryRubberBand::paint ( QPainter *  painter)
overrideprotectedvirtual

function to be implemented by derived classes

Implements QgsMapCanvasItem.

Definition at line 36 of file qgsgeometryrubberband.cpp.

◆ setBrushStyle()

void QgsGeometryRubberBand::setBrushStyle ( Qt::BrushStyle  brushStyle)

Sets brush style.

Definition at line 150 of file qgsgeometryrubberband.cpp.

◆ setFillColor()

void QgsGeometryRubberBand::setFillColor ( const QColor &  c)

Sets fill color for vertex markers.

Definition at line 130 of file qgsgeometryrubberband.cpp.

◆ setGeometry()

void QgsGeometryRubberBand::setGeometry ( QgsAbstractGeometry geom)

Sets geometry (takes ownership). Geometry is expected to be in map coordinates.

Definition at line 110 of file qgsgeometryrubberband.cpp.

◆ setIconType()

void QgsGeometryRubberBand::setIconType ( IconType  iconType)
inline

Sets vertex marker icon type.

Definition at line 92 of file qgsgeometryrubberband.h.

◆ setLineStyle()

void QgsGeometryRubberBand::setLineStyle ( Qt::PenStyle  penStyle)

Sets pen style.

Definition at line 145 of file qgsgeometryrubberband.cpp.

◆ setStrokeColor()

void QgsGeometryRubberBand::setStrokeColor ( const QColor &  c)

Sets stroke color for vertex markers.

Definition at line 135 of file qgsgeometryrubberband.cpp.

◆ setStrokeWidth()

void QgsGeometryRubberBand::setStrokeWidth ( int  width)

Sets stroke width.

Definition at line 140 of file qgsgeometryrubberband.cpp.


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