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;
202 const T *sl =
dynamic_cast<const T *
>( originalSl );
203 return sl ?
new QgsRenderedPointsSymbolLayer( sl,
mPoints ) :
nullptr;
211 class QgsRenderedPointsSymbolLayer :
public T
218 QgsRenderedPointsSymbolLayer(
const T *original, FeaturePoints &points )
219 : T( original->rotateSymbols(), original->interval() )
222 original->copyTemplateSymbolProperties(
this );
225 void renderPolyline(
const QPolygonF &points, QgsSymbolRenderContext &context )
override
228 if ( iPart < 0 || QgsRenderedPointsSymbolLayer::mRingIndex < 0 )
231 if ( iPart >= mPoints.count() )
232 mPoints.resize( iPart + 1 );
234 QVector<QPolygonF> &rings = mPoints[iPart];
235 if ( QgsRenderedPointsSymbolLayer::mRingIndex >= rings.count() )
236 rings.resize( QgsRenderedPointsSymbolLayer::mRingIndex + 1 );
238 rings[QgsRenderedPointsSymbolLayer::mRingIndex] = points;
242 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