16#ifndef QGSMAPTOOLEDITBLANKSEGMENTS_H
17#define QGSMAPTOOLEDITBLANKSEGMENTS_H
31class QgsMapToolBlankSegmentRubberBand;
86 QPair<double, double> startEndDistance()
const;
91 void updateAttribute();
96 void loadFeaturePoints();
110 int closestBlankSegmentIndex(
const QPointF &point,
double &distance )
const;
120 QPointF closestPoint(
const QPointF &point,
double &distance,
int &partIndex,
int &ringIndex,
int &pointIndex )
const;
126 void updateStartEndRubberBand();
131 void updateHoveredBlankSegment(
const QPoint &pos );
136 void setCurrentBlankSegment(
int currentBlankSegmentIndex );
157 BlankSegmentSelected,
158 BlankSegmentModificationStarted,
159 BlankSegmentCreationStarted
162 std::vector<QObjectUniquePtr<QgsBlankSegmentRubberBand>> mBlankSegments;
164 std::unique_ptr<QgsSymbol> mSymbol;
168 int mBlankSegmentsFieldIndex = -1;
171 State mState = State::SelectFeature;
172 int mCurrentBlankSegmentIndex = -1;
173 int mHoveredBlankSegmentIndex = -1;
207 const T *sl =
dynamic_cast<const T *
>( originalSl );
208 return sl ?
new QgsRenderedPointsSymbolLayer( sl,
mPoints ) :
nullptr;
216 class QgsRenderedPointsSymbolLayer :
public T
223 QgsRenderedPointsSymbolLayer(
const T *original, FeaturePoints &points )
224 : T( original->rotateSymbols(), original->interval() )
227 original->copyTemplateSymbolProperties(
this );
230 void renderPolyline(
const QPolygonF &points, QgsSymbolRenderContext &context )
override
233 if ( iPart < 0 || QgsRenderedPointsSymbolLayer::mRingIndex < 0 )
236 if ( iPart >= mPoints.count() )
237 mPoints.resize( iPart + 1 );
239 QVector<QPolygonF> &rings = mPoints[iPart];
240 if ( QgsRenderedPointsSymbolLayer::mRingIndex >= rings.count() )
241 rings.resize( QgsRenderedPointsSymbolLayer::mRingIndex + 1 );
243 rings[QgsRenderedPointsSymbolLayer::mRingIndex] = points;
247 FeaturePoints &mPoints;
Keeps a pointer to a QObject and deletes it whenever this object is deleted.
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