16#ifndef QGSMAPTOOLEDITBLANKSEGMENTS_H
17#define QGSMAPTOOLEDITBLANKSEGMENTS_H
29class QgsMapToolBlankSegmentRubberBand;
84 QPair<double, double> startEndDistance()
const;
89 void updateAttribute();
94 void loadFeaturePoints();
108 int closestBlankSegmentIndex(
const QPointF &point,
double &distance )
const;
118 QPointF closestPoint(
const QPointF &point,
double &distance,
int &partIndex,
int &ringIndex,
int &pointIndex )
const;
124 void updateStartEndRubberBand();
129 void updateHoveredBlankSegment(
const QPoint &pos );
134 void setCurrentBlankSegment(
int currentBlankSegmentIndex );
150 BlankSegmentSelected,
151 BlankSegmentModificationStarted,
152 BlankSegmentCreationStarted
155 std::vector<QObjectUniquePtr<QgsBlankSegmentRubberBand>> mBlankSegments;
157 std::unique_ptr<QgsSymbol> mSymbol;
158 const QString mSymbolLayerId;
161 int mBlankSegmentsFieldIndex = -1;
164 State mState = State::SelectFeature;
165 int mCurrentBlankSegmentIndex = -1;
166 int mHoveredBlankSegmentIndex = -1;
201 const T *sl =
dynamic_cast<const T *
>( originalSl );
202 return sl ?
new QgsRenderedPointsSymbolLayer( sl,
mPoints ) :
nullptr;
210 class QgsRenderedPointsSymbolLayer :
public T
217 QgsRenderedPointsSymbolLayer(
const T *original, FeaturePoints &points )
218 : T( original->rotateSymbols(), original->interval() )
221 original->copyTemplateSymbolProperties(
this );
224 void renderPolyline(
const QPolygonF &points, QgsSymbolRenderContext &context )
override
227 if ( iPart < 0 || QgsRenderedPointsSymbolLayer::mRingIndex < 0 )
230 if ( iPart >= mPoints.count() )
231 mPoints.resize( iPart + 1 );
233 QVector<QPolygonF> &rings = mPoints[iPart];
234 if ( QgsRenderedPointsSymbolLayer::mRingIndex >= rings.count() )
235 rings.resize( QgsRenderedPointsSymbolLayer::mRingIndex + 1 );
237 rings[QgsRenderedPointsSymbolLayer::mRingIndex] = points;
241 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