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 ) const override
SIP_FACTORY;
263 bool removeDuplicateNodes(
double epsilon = 4 * std::numeric_limits<
double>::epsilon(),
bool useZValues = false ) override;
265 void draw( QPainter &p ) const override;
267 void transform( const QTransform &t,
double zTranslate = 0.0,
double zScale = 1.0,
double mTranslate = 0.0,
double mScale = 1.0 ) override;
268 void addToPainterPath( QPainterPath &path ) const override;
269 void drawAsPolygon( QPainter &p ) const override;
272 bool deleteVertex(
QgsVertexId position ) override;
274 bool pointAt(
int node,
QgsPoint &point,
Qgis::VertexType &type ) const override;
275 void sumUpArea(
double &sum
SIP_OUT ) const override;
276 bool hasCurvedSegments() const override;
277 double vertexAngle(
QgsVertexId vertex ) const override;
278 double segmentLength(
QgsVertexId startVertex ) const override;
282 bool addZValue(
double zValue = 0 ) override;
283 bool addMValue(
double mValue = 0 ) override;
284 bool dropZValue() override;
285 bool dropMValue() override;
286 void swapXy() override;
287 double xAt(
int index ) const override
SIP_HOLDGIL;
288 double yAt(
int index ) const override
SIP_HOLDGIL;
289 double zAt(
int index ) const override
SIP_HOLDGIL;
290 double mAt(
int index ) const override
SIP_HOLDGIL;
293 void scroll(
int firstVertexIndex ) final;
298 std::tuple< std::unique_ptr< QgsCurve >, std::unique_ptr< QgsCurve > >
splitCurveAtVertex(
int index )
const final;
317 SIP_PYOBJECT __repr__();
319 QString wkt = sipCpp->asWkt();
320 if ( wkt.length() > 1000 )
321 wkt = wkt.left( 1000 ) + QStringLiteral(
"..." );
322 QString
str = QStringLiteral(
"<QgsCircularString: %1>" ).arg( wkt );
323 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
339 static void arcTo( QPainterPath &path, QPointF pt1, QPointF pt2, QPointF pt3 );
343 static QgsPointSequence compassPointsOnSegment(
double p1Angle,
double p2Angle,
double p3Angle,
double centerX,
double centerY,
double radius );
344 static double closestPointOnArc(
double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
346 void insertVertexBetween(
int after,
int before,
int pointOnCircle );