68 const QVector<double> &z = QVector<double>(),
69 const QVector<double> &m = QVector<double>() )
SIP_HOLDGIL;
85 bool useShortestArc =
true );
89 bool fuzzyHelper(
double epsilon,
93 std::function<
bool(
double,
double,
double,
double,
double,
double,
double,
double,
double )> comparator3DMeasure,
94 std::function<
bool(
double,
double,
double,
double,
double,
double,
double )> comparator3D,
95 std::function<
bool(
double,
double,
double,
double,
double,
double,
double )> comparatorMeasure,
96 std::function<
bool(
double,
double,
double,
double,
double )> comparator2D )
const
98 const QgsCircularString *otherLine = qgsgeometry_cast< const QgsCircularString * >( &other );
102 if ( mWkbType != otherLine->
mWkbType )
105 const int size = mX.count();
106 if ( size != otherLine->mX.count() )
110 const double *xData = mX.constData();
111 const double *yData = mY.constData();
112 const double *zData = is3DFlag ? mZ.constData() :
nullptr;
113 const double *mData = isMeasureFlag ? mM.constData() :
nullptr;
114 const double *otherXData = otherLine->mX.constData();
115 const double *otherYData = otherLine->mY.constData();
116 const double *otherZData = is3DFlag ? otherLine->mZ.constData() :
nullptr;
117 const double *otherMData = isMeasureFlag ? otherLine->mM.constData() :
nullptr;
118 for (
int i = 0; i < size; ++i )
120 if ( is3DFlag && isMeasureFlag )
122 result &= comparator3DMeasure( epsilon, *xData++, *yData++, *zData++, *mData++,
123 *otherXData++, *otherYData++, *otherZData++, *otherMData++ );
127 result &= comparator3D( epsilon, *xData++, *yData++, *zData++,
128 *otherXData++, *otherYData++, *otherZData++ );
130 else if ( isMeasureFlag )
132 result &= comparatorMeasure( epsilon, *xData++, *yData++, *mData++,
133 *otherXData++, *otherYData++, *otherMData++ );
137 result &= comparator2D( epsilon, *xData++, *yData++,
138 *otherXData++, *otherYData++ );
158 [](
double epsilon,
double x1,
double y1,
double z1,
double m1,
159 double x2,
double y2,
double z2,
double m2 )
163 [](
double epsilon,
double x1,
double y1,
double z1,
164 double x2,
double y2,
double z2 )
168 [](
double epsilon,
double x1,
double y1,
double m1,
169 double x2,
double y2,
double m2 )
173 [](
double epsilon,
double x1,
double y1,
174 double x2,
double y2 )
187 [](
double epsilon,
double x1,
double y1,
double z1,
double m1,
188 double x2,
double y2,
double z2,
double m2 )
192 [](
double epsilon,
double x1,
double y1,
double z1,
193 double x2,
double y2,
double z2 )
197 [](
double epsilon,
double x1,
double y1,
double m1,
198 double x2,
double y2,
double m2 )
202 [](
double epsilon,
double x1,
double y1,
203 double x2,
double y2 )
218 void clear() override;
221 bool fromWkt( const QString &wkt ) override;
225 QString asWkt(
int precision = 17 ) const override;
230 bool isValid( QString &error
SIP_OUT,
Qgis::GeometryValidityFlags flags =
Qgis::GeometryValidityFlags() ) const override;
232 int indexOf( const
QgsPoint &point ) const final;
258 double length() const override;
261 QgsLineString *curveToLine(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override
SIP_FACTORY;
262 QgsCircularString *snappedToGrid(
double hSpacing,
double vSpacing,
double dSpacing = 0,
double mSpacing = 0,
bool removeRedundantPoints = false ) const override
SIP_FACTORY;
264 bool removeDuplicateNodes(
double epsilon = 4 * std::numeric_limits<
double>::epsilon(),
bool useZValues = false ) override;
266 void draw( QPainter &p ) const override;
268 void transform( const QTransform &t,
double zTranslate = 0.0,
double zScale = 1.0,
double mTranslate = 0.0,
double mScale = 1.0 ) override;
269 void addToPainterPath( QPainterPath &path ) const override;
270 void drawAsPolygon( QPainter &p ) const override;
273 bool deleteVertex(
QgsVertexId position ) override;
275 bool pointAt(
int node,
QgsPoint &point,
Qgis::VertexType &type ) const override;
276 void sumUpArea(
double &sum
SIP_OUT ) const override;
277 bool hasCurvedSegments() const override;
278 double vertexAngle(
QgsVertexId vertex ) const override;
279 double segmentLength(
QgsVertexId startVertex ) const override;
283 bool addZValue(
double zValue = 0 ) override;
284 bool addMValue(
double mValue = 0 ) override;
285 bool dropZValue() override;
286 bool dropMValue() override;
287 void swapXy() override;
288 double xAt(
int index ) const override
SIP_HOLDGIL;
289 double yAt(
int index ) const override
SIP_HOLDGIL;
290 double zAt(
int index ) const override
SIP_HOLDGIL;
291 double mAt(
int index ) const override
SIP_HOLDGIL;
294 void scroll(
int firstVertexIndex ) final;
299 std::tuple< std::unique_ptr< QgsCurve >, std::unique_ptr< QgsCurve > >
splitCurveAtVertex(
int index )
const final;
318 SIP_PYOBJECT __repr__();
320 QString wkt = sipCpp->asWkt();
321 if ( wkt.length() > 1000 )
322 wkt = wkt.left( 1000 ) + QStringLiteral(
"..." );
323 QString
str = QStringLiteral(
"<QgsCircularString: %1>" ).arg( wkt );
324 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
340 static void arcTo( QPainterPath &path, QPointF pt1, QPointF pt2, QPointF pt3 );
344 static QgsPointSequence compassPointsOnSegment(
double p1Angle,
double p2Angle,
double p3Angle,
double centerX,
double centerY,
double radius );
345 static double closestPointOnArc(
double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
347 void insertVertexBetween(
int after,
int before,
int pointOnCircle );