|
QGIS API Documentation 3.99.0-Master (d270888f95f)
|
Rubber band used to draw blank segments on edition. More...

Public Member Functions | |
| QgsBlankSegmentRubberBand (int partIndex, int ringIndex, int startIndex, int endIndex, QPointF startPt, QPointF endPt, QgsMapCanvas *canvas, const FeaturePoints &points) | |
| Constructor. | |
| QgsBlankSegmentRubberBand (QgsMapCanvas *canvas, const FeaturePoints &points) | |
| void | copyFrom (const QgsBlankSegmentRubberBand &blankSegment) |
| Copy blankSegment rubber band information into this one. | |
| int | getEndIndex () const |
| Returns end index. | |
| const QPointF & | getEndPoint () const |
| Returns end point. | |
| int | getPartIndex () const |
| Returns part index. | |
| int | getRingIndex () const |
| Returns ring index. | |
| QPair< double, double > | getStartEndDistance (Qgis::RenderUnit unit) const |
| Returns start and end distance from the first rendered point expressed in unit units. | |
| int | getStartIndex () const |
| Returns start index. | |
| const QPointF & | getStartPoint () const |
| Returns start point. | |
| const QPointF & | pointAt (int index) const |
| Returns blank segments point at index. | |
| int | pointsCount () const |
| Returns blank segment points count. | |
| void | setHighlighted (bool highlighted) |
| Set highligh state according to highlighted. | |
| void | setPoints (int partIndex, int ringIndex, int startIndex, int endIndex, QPointF startPt, QPointF endPt) |
| Initialize blank segment rubber band points. | |
| Public Member Functions inherited from QgsRubberBand | |
| QgsRubberBand (QgsMapCanvas *mapCanvas, Qgis::GeometryType geometryType=Qgis::GeometryType::Line) | |
| Creates a new RubberBand. | |
| ~QgsRubberBand () override | |
| void | addGeometry (const QgsGeometry &geometry, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem(), bool doUpdate=true) |
| Adds a geometry to the rubberband. | |
| void | addGeometry (const QgsGeometry &geometry, QgsMapLayer *layer, bool doUpdate=true) |
| Adds the geometry of an existing feature to a rubberband This is useful for multi feature highlighting. | |
| void | addPoint (const QgsPointXY &p, bool doUpdate=true, int geometryIndex=0, int ringIndex=0) |
| Adds a vertex to the rubberband and update canvas. | |
| QgsGeometry | asGeometry () const |
| Returns the rubberband as a Geometry. | |
| void | closePoints (bool doUpdate=true, int geometryIndex=0, int ringIndex=0) |
| Ensures that a polygon geometry is closed and that the last vertex equals the first vertex. | |
| void | copyPointsFrom (const QgsRubberBand *other) |
| Copies the points from another rubber band. | |
| QColor | fillColor () const |
| Returns the current fill color. | |
| const QgsPointXY * | getPoint (int i, int j=0, int ringIndex=0) const |
| Returns a vertex. | |
| IconType | icon () const |
| Returns the current icon type to highlight point geometries. | |
| double | iconSize () const |
| Returns the current icon size of the point icons. | |
| void | movePoint (const QgsPointXY &p, int geometryIndex=0, int ringIndex=0) |
| Moves the rubber band point specified by index. | |
| void | movePoint (int index, const QgsPointXY &p, int geometryIndex=0, int ringIndex=0) |
| Moves the rubber band point specified by index. | |
| int | numberOfVertices () const |
| Returns count of vertices in all lists of mPoint. | |
| int | partSize (int geometryIndex) const |
| Returns number of vertices in feature part. | |
| void | removeLastPoint (int geometryIndex=0, bool doUpdate=true, int ringIndex=0) |
| Removes the last point. | |
| void | removePoint (int index=0, bool doUpdate=true, int geometryIndex=0, int ringIndex=0) |
| Removes a vertex from the rubberband and (optionally) updates canvas. | |
| void | reset (Qgis::GeometryType geometryType=Qgis::GeometryType::Line) |
| Clears all the geometries in this rubberband. | |
| QColor | secondaryStrokeColor () const |
| Returns the current secondary stroke color. | |
| void | setBrushStyle (Qt::BrushStyle brushStyle) |
| Sets the style of the brush. | |
| void | setColor (const QColor &color) |
| Sets the color for the rubberband. | |
| void | setFillColor (const QColor &color) |
| Sets the fill color for the rubberband. | |
| void | setIcon (IconType icon) |
| Sets the icon type to highlight point geometries. | |
| void | setIconSize (double iconSize) |
| Sets the size of the point icons. | |
| void | setLineStyle (Qt::PenStyle penStyle) |
| Sets the style of the line. | |
| void | setSecondaryStrokeColor (const QColor &color) |
| Sets a secondary stroke color for the rubberband which will be drawn under the main stroke color. | |
| void | setStrokeColor (const QColor &color) |
| Sets the stroke color for the rubberband. | |
| void | setSvgIcon (const QString &path, QPoint drawOffset) |
| Set the path to the svg file to use to draw points. | |
| void | setSymbol (QgsSymbol *symbol) |
| Sets the symbol used for rendering the rubberband. | |
| void | setToCanvasRectangle (QRect rect) |
| Sets this rubber band to a map canvas rectangle. | |
| void | setToGeometry (const QgsGeometry &geom, QgsVectorLayer *layer) |
| Sets this rubber band to geom. | |
| void | setToGeometry (const QgsGeometry &geometry, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem()) |
| Sets this rubber band to geometry. | |
| void | setTranslationOffset (double dx, double dy) |
| Adds translation to original coordinates (all in map coordinates). | |
| void | setWidth (double width) |
| Sets the width of the line. | |
| int | size () const |
| Returns number of geometries. | |
| QColor | strokeColor () const |
| Returns the current stroke color. | |
| QgsSymbol * | symbol () const |
| Returns the symbol used for rendering the rubberband, if set. | |
| void | updatePosition () override |
| called on changed extent or resize event to update position of the item | |
| int | width () const |
| Returns the current width of the line or stroke width for polygon. | |
| 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 | |
| Public Types inherited from QgsRubberBand | |
| enum | IconType { ICON_NONE , ICON_CROSS , ICON_X , ICON_BOX , ICON_CIRCLE , ICON_FULL_BOX , ICON_DIAMOND , ICON_FULL_DIAMOND , ICON_SVG } |
| Icons. More... | |
| Protected Member Functions inherited from QgsRubberBand | |
| void | drawShape (QPainter *p, const QVector< QPointF > &pts) |
| Draws shape of the rubber band. | |
| void | drawShape (QPainter *p, const QVector< QPolygonF > &rings) |
| Draws shape of the rubber band. | |
| void | paint (QPainter *p) override |
| Paints the rubber band in response to an update event. | |
| void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override |
| void | updateRect () |
| Recalculates needed rectangle. | |
| 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 = 0.0 |
| Properties inherited from QgsRubberBand | |
| QColor | fillColor |
| int | iconSize |
| QColor | secondaryStrokeColor |
| QColor | strokeColor |
| int | width |
Rubber band used to draw blank segments on edition.
Definition at line 205 of file qgsmaptooleditblanksegments.cpp.
| QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::QgsBlankSegmentRubberBand | ( | int | partIndex, |
| int | ringIndex, | ||
| int | startIndex, | ||
| int | endIndex, | ||
| QPointF | startPt, | ||
| QPointF | endPt, | ||
| QgsMapCanvas * | canvas, | ||
| const FeaturePoints & | points ) |
Constructor.
Initialize blank segment rubber band points
| partIndex | geometry part index of the blank segment |
| ringIndex | geometry ring index of the blank segment |
| startIndex | rendered points index of the blank segment start point |
| endIndex | rendered points index of the blank segment end point |
| startPt | blank segment start point |
| endPt | blank segment end point |
| canvas | map canvas |
| points | feature rendered points |
Definition at line 966 of file qgsmaptooleditblanksegments.cpp.
| QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::QgsBlankSegmentRubberBand | ( | QgsMapCanvas * | canvas, |
| const FeaturePoints & | points ) |
| canvas | map canvas |
| points | feature rendered points |
Definition at line 958 of file qgsmaptooleditblanksegments.cpp.
| void QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::copyFrom | ( | const QgsBlankSegmentRubberBand & | blankSegment | ) |
Copy blankSegment rubber band information into this one.
Definition at line 1026 of file qgsmaptooleditblanksegments.cpp.
| int QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::getEndIndex | ( | ) | const |
Returns end index.
Definition at line 1053 of file qgsmaptooleditblanksegments.cpp.
| const QPointF & QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::getEndPoint | ( | ) | const |
Returns end point.
Definition at line 1043 of file qgsmaptooleditblanksegments.cpp.
| int QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::getPartIndex | ( | ) | const |
Returns part index.
Definition at line 1058 of file qgsmaptooleditblanksegments.cpp.
| int QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::getRingIndex | ( | ) | const |
Returns ring index.
Definition at line 1063 of file qgsmaptooleditblanksegments.cpp.
| QPair< double, double > QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::getStartEndDistance | ( | Qgis::RenderUnit | unit | ) | const |
Returns start and end distance from the first rendered point expressed in unit units.
Definition at line 606 of file qgsmaptooleditblanksegments.cpp.
| int QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::getStartIndex | ( | ) | const |
Returns start index.
Definition at line 1048 of file qgsmaptooleditblanksegments.cpp.
| const QPointF & QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::getStartPoint | ( | ) | const |
Returns start point.
Definition at line 1038 of file qgsmaptooleditblanksegments.cpp.
| const QPointF & QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::pointAt | ( | int | index | ) | const |
Returns blank segments point at index.
Definition at line 1073 of file qgsmaptooleditblanksegments.cpp.
| int QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::pointsCount | ( | ) | const |
Returns blank segment points count.
Definition at line 1068 of file qgsmaptooleditblanksegments.cpp.
| void QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::setHighlighted | ( | bool | highlighted | ) |
Set highligh state according to highlighted.
Definition at line 1031 of file qgsmaptooleditblanksegments.cpp.
| void QgsMapToolEditBlankSegmentsBase::QgsBlankSegmentRubberBand::setPoints | ( | int | partIndex, |
| int | ringIndex, | ||
| int | startIndex, | ||
| int | endIndex, | ||
| QPointF | startPt, | ||
| QPointF | endPt ) |
Initialize blank segment rubber band points.
| partIndex | geometry part index of the blank segment |
| ringIndex | geometry ring index of the blank segment |
| startIndex | rendered points index of the blank segment start point |
| endIndex | rendered points index of the blank segment end point |
| startPt | blank segment start point |
| endPt | blank segment end point |
Definition at line 972 of file qgsmaptooleditblanksegments.cpp.