16#ifndef QGSMAPTOOLEDITBLANKSEGMENTS_H
17#define QGSMAPTOOLEDITBLANKSEGMENTS_H
30class QgsMapToolBlankSegmentRubberBand;
85 QPair<double, double> startEndDistance()
const;
90 void updateAttribute();
95 void loadFeaturePoints();
109 int closestBlankSegmentIndex(
const QPointF &point,
double &distance )
const;
119 QPointF closestPoint(
const QPointF &point,
double &distance,
int &partIndex,
int &ringIndex,
int &pointIndex )
const;
125 void updateStartEndRubberBand();
130 void updateHoveredBlankSegment(
const QPoint &pos );
135 void setCurrentBlankSegment(
int currentBlankSegmentIndex );
151 BlankSegmentSelected,
152 BlankSegmentModificationStarted,
153 BlankSegmentCreationStarted
156 std::vector<QObjectUniquePtr<QgsBlankSegmentRubberBand>> mBlankSegments;
158 std::unique_ptr<QgsSymbol> mSymbol;
159 const QString mSymbolLayerId;
162 int mBlankSegmentsFieldIndex = -1;
165 State mState = State::SelectFeature;
166 int mCurrentBlankSegmentIndex = -1;
167 int mHoveredBlankSegmentIndex = -1;
200 const T *sl =
dynamic_cast<const T *
>( originalSl );
201 return sl ?
new QgsRenderedPointsSymbolLayer( sl,
mPoints ) :
nullptr;
209 class QgsRenderedPointsSymbolLayer :
public T
216 QgsRenderedPointsSymbolLayer(
const T *original, FeaturePoints &points )
217 : T( original->rotateSymbols(), original->interval() )
220 original->copyTemplateSymbolProperties(
this );
223 void renderPolyline(
const QPolygonF &points, QgsSymbolRenderContext &context )
override
226 if ( iPart < 0 || QgsRenderedPointsSymbolLayer::mRingIndex < 0 )
229 if ( iPart >= mPoints.count() )
230 mPoints.resize( iPart + 1 );
232 QVector<QPolygonF> &rings = mPoints[iPart];
233 if ( QgsRenderedPointsSymbolLayer::mRingIndex >= rings.count() )
234 rings.resize( QgsRenderedPointsSymbolLayer::mRingIndex + 1 );
236 rings[QgsRenderedPointsSymbolLayer::mRingIndex] = points;
240 FeaturePoints &mPoints;
Keeps a pointer to a QObject and deletes it whenever this object is deleted.
Abstract base class for line symbol layers.
A mouse event which is the result of a user interaction with a QgsMapCanvas.
A rectangle specified with double values.
Abstract base class for symbol layers.
int geometryPartNum() const
Part number of current geometry.
Abstract base class for all rendered symbols.
Base class for templated line symbols, e.g.
Represents a vector layer which manages a vector based dataset.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features