@@ -65,21 +65,21 @@ class QgsGeometry
65
65
bool isEmpty() const;
66
66
67
67
/** Creates a new geometry from a WKT string */
68
- static QgsGeometry* fromWkt( const QString& wkt ) /Factory/ ;
68
+ static QgsGeometry fromWkt( const QString& wkt );
69
69
/** Creates a new geometry from a QgsPoint object*/
70
- static QgsGeometry* fromPoint( const QgsPoint& point ) /Factory/ ;
70
+ static QgsGeometry fromPoint( const QgsPoint& point );
71
71
/** Creates a new geometry from a QgsMultiPoint object */
72
- static QgsGeometry* fromMultiPoint( const QgsMultiPoint& multipoint ) /Factory/ ;
72
+ static QgsGeometry fromMultiPoint( const QgsMultiPoint& multipoint );
73
73
/** Creates a new geometry from a QgsPolyline object */
74
- static QgsGeometry* fromPolyline( const QgsPolyline& polyline ) /Factory/ ;
74
+ static QgsGeometry fromPolyline( const QgsPolyline& polyline );
75
75
/** Creates a new geometry from a QgsMultiPolyline object*/
76
- static QgsGeometry* fromMultiPolyline( const QgsMultiPolyline& multiline ) /Factory/ ;
76
+ static QgsGeometry fromMultiPolyline( const QgsMultiPolyline& multiline );
77
77
/** Creates a new geometry from a QgsPolygon */
78
- static QgsGeometry* fromPolygon( const QgsPolygon& polygon ) /Factory/ ;
78
+ static QgsGeometry fromPolygon( const QgsPolygon& polygon );
79
79
/** Creates a new geometry from a QgsMultiPolygon */
80
- static QgsGeometry* fromMultiPolygon( const QgsMultiPolygon& multipoly ) /Factory/ ;
80
+ static QgsGeometry fromMultiPolygon( const QgsMultiPolygon& multipoly );
81
81
/** Creates a new geometry from a QgsRectangle */
82
- static QgsGeometry* fromRect( const QgsRectangle& rect ) /Factory/ ;
82
+ static QgsGeometry fromRect( const QgsRectangle& rect );
83
83
84
84
/**
85
85
* Set the geometry, feeding in a geometry in GEOS format.
@@ -408,42 +408,42 @@ class QgsGeometry
408
408
bool intersects( const QgsRectangle& r ) const;
409
409
410
410
/** Test for intersection with a geometry (uses GEOS) */
411
- bool intersects( const QgsGeometry* geometry ) const;
411
+ bool intersects( const QgsGeometry& geometry ) const;
412
412
413
413
/** Test for containment of a point (uses GEOS) */
414
414
bool contains( const QgsPoint* p ) const;
415
415
416
416
/** Test for if geometry is contained in another (uses GEOS)
417
417
* @note added in 1.5 */
418
- bool contains( const QgsGeometry* geometry ) const;
418
+ bool contains( const QgsGeometry& geometry ) const;
419
419
420
420
/** Test for if geometry is disjoint of another (uses GEOS)
421
421
* @note added in 1.5 */
422
- bool disjoint( const QgsGeometry* geometry ) const;
422
+ bool disjoint( const QgsGeometry& geometry ) const;
423
423
424
424
/** Test for if geometry equals another (uses GEOS)
425
425
* @note added in 1.5 */
426
- bool equals( const QgsGeometry* geometry ) const;
426
+ bool equals( const QgsGeometry& geometry ) const;
427
427
428
428
/** Test for if geometry touch another (uses GEOS)
429
429
* @note added in 1.5 */
430
- bool touches( const QgsGeometry* geometry ) const;
430
+ bool touches( const QgsGeometry& geometry ) const;
431
431
432
432
/** Test for if geometry overlaps another (uses GEOS)
433
433
* @note added in 1.5 */
434
- bool overlaps( const QgsGeometry* geometry ) const;
434
+ bool overlaps( const QgsGeometry& geometry ) const;
435
435
436
436
/** Test for if geometry is within another (uses GEOS)
437
437
* @note added in 1.5 */
438
- bool within( const QgsGeometry* geometry ) const;
438
+ bool within( const QgsGeometry& geometry ) const;
439
439
440
440
/** Test for if geometry crosses another (uses GEOS)
441
441
* @note added in 1.5 */
442
- bool crosses( const QgsGeometry* geometry ) const;
442
+ bool crosses( const QgsGeometry& geometry ) const;
443
443
444
444
/** Returns a buffer region around this geometry having the given width and with a specified number
445
445
of segments used to approximate curves */
446
- QgsGeometry* buffer( double distance, int segments ) const /Factory/ ;
446
+ QgsGeometry buffer( double distance, int segments ) const;
447
447
448
448
/** Returns a buffer region around the geometry, with additional style options.
449
449
* @param distance buffer distance
@@ -454,44 +454,44 @@ class QgsGeometry
454
454
* @note added in 2.4
455
455
* @note needs GEOS >= 3.3 - otherwise always returns 0
456
456
*/
457
- QgsGeometry* buffer( double distance, int segments, int endCapStyle, int joinStyle, double mitreLimit ) const /Factory/ ;
457
+ QgsGeometry buffer( double distance, int segments, int endCapStyle, int joinStyle, double mitreLimit ) const;
458
458
459
459
/** Returns an offset line at a given distance and side from an input line.
460
460
* See buffer() method for details on parameters.
461
461
* @note added in 2.4
462
462
* @note needs GEOS >= 3.3 - otherwise always returns 0
463
463
*/
464
- QgsGeometry* offsetCurve( double distance, int segments, int joinStyle, double mitreLimit ) const /Factory/ ;
464
+ QgsGeometry offsetCurve( double distance, int segments, int joinStyle, double mitreLimit ) const;
465
465
466
466
/** Returns a simplified version of this geometry using a specified tolerance value */
467
- QgsGeometry* simplify( double tolerance ) const /Factory/ ;
467
+ QgsGeometry simplify( double tolerance ) const;
468
468
469
469
/** Returns the center of mass of a geometry
470
470
* @note for line based geometries, the center point of the line is returned,
471
471
* and for point based geometries, the point itself is returned
472
472
*/
473
- QgsGeometry* centroid() const /Factory/ ;
473
+ QgsGeometry centroid() const;
474
474
475
475
/** Returns a point within a geometry */
476
- QgsGeometry* pointOnSurface() const /Factory/ ;
476
+ QgsGeometry pointOnSurface() const;
477
477
478
478
/** Returns the smallest convex polygon that contains all the points in the geometry. */
479
- QgsGeometry* convexHull() const /Factory/ ;
479
+ QgsGeometry convexHull() const;
480
480
481
481
/**
482
482
* Return interpolated point on line at distance
483
483
* @note added in 1.9
484
484
*/
485
- QgsGeometry* interpolate( double distance ) /Factory/ ;
485
+ QgsGeometry interpolate( double distance );
486
486
487
487
/** Returns a geometry representing the points shared by this geometry and other. */
488
- QgsGeometry* intersection( const QgsGeometry* geometry ) const /Factory/ ;
488
+ QgsGeometry intersection( const QgsGeometry& geometry ) const;
489
489
490
490
/** Returns a geometry representing all the points in this geometry and other (a
491
491
* union geometry operation).
492
492
* @note this operation is not called union since its a reserved word in C++.
493
493
*/
494
- QgsGeometry* combine( const QgsGeometry* geometry ) const /Factory/ ;
494
+ QgsGeometry combine( const QgsGeometry& geometry ) const;
495
495
496
496
/** Merges any connected lines in a LineString/MultiLineString geometry and
497
497
* converts them to single line strings.
@@ -503,10 +503,10 @@ class QgsGeometry
503
503
QgsGeometry mergeLines() const;
504
504
505
505
/** Returns a geometry representing the points making up this geometry that do not make up other. */
506
- QgsGeometry* difference( const QgsGeometry* geometry ) const /Factory/ ;
506
+ QgsGeometry difference( const QgsGeometry& geometry ) const;
507
507
508
508
/** Returns a geometry representing the points making up this geometry that do not make up other. */
509
- QgsGeometry* symDifference( const QgsGeometry* geometry ) const /Factory/ ;
509
+ QgsGeometry symDifference( const QgsGeometry& geometry ) const;
510
510
511
511
/** Returns an extruded version of this geometry. */
512
512
QgsGeometry extrude( double x, double y );
@@ -531,7 +531,7 @@ class QgsGeometry
531
531
* @return the converted geometry or nullptr if the conversion fails.
532
532
* @note added in 2.2
533
533
*/
534
- QgsGeometry* convertToType( Qgis::GeometryType destType, bool destMultipart = false ) const /Factory/ ;
534
+ QgsGeometry convertToType( Qgis::GeometryType destType, bool destMultipart = false ) const;
535
535
536
536
/* Accessor functions for getting geometry data */
537
537
@@ -564,7 +564,7 @@ class QgsGeometry
564
564
565
565
/** Return contents of the geometry as a list of geometries
566
566
@note added in version 1.1 */
567
- QList<QgsGeometry* > asGeometryCollection() const /Factory/ ;
567
+ QList<QgsGeometry> asGeometryCollection() const;
568
568
569
569
/** Return contents of the geometry as a QPointF if wkbType is WKBPoint,
570
570
* otherwise returns a null QPointF.
@@ -643,7 +643,7 @@ class QgsGeometry
643
643
* @param geometryList a list of QgsGeometry* as input
644
644
* @returns the new computed QgsGeometry, or null
645
645
*/
646
- static QgsGeometry * unaryUnion( const QList<QgsGeometry* >& geometryList ) /Factory/ ;
646
+ static QgsGeometry unaryUnion( const QList<QgsGeometry>& geometryList );
647
647
648
648
/** Converts the geometry to straight line segments, if it is a curved geometry type.
649
649
* @note added in QGIS 2.10
@@ -704,15 +704,15 @@ class QgsGeometry
704
704
* @param point source QPointF
705
705
* @note added in QGIS 2.7
706
706
*/
707
- static QgsGeometry* fromQPointF( QPointF point ) /Factory/ ;
707
+ static QgsGeometry fromQPointF( QPointF point );
708
708
709
709
/** Construct geometry from a QPolygonF. If the polygon is closed than
710
710
* the resultant geometry will be a polygon, if it is open than the
711
711
* geometry will be a polyline.
712
712
* @param polygon source QPolygonF
713
713
* @note added in QGIS 2.7
714
714
*/
715
- static QgsGeometry* fromQPolygonF( const QPolygonF& polygon ) /Factory/ ;
715
+ static QgsGeometry fromQPolygonF( const QPolygonF& polygon );
716
716
717
717
/** Creates a QgsPolyline from a QPolygonF.
718
718
* @param polygon source polygon
@@ -768,7 +768,7 @@ class QgsGeometry
768
768
* of the geometry for each iteration. Smaller values result in "tighter" smoothing.
769
769
* @note added in 2.9
770
770
*/
771
- QgsGeometry* smooth( const unsigned int iterations, const double offset ) const;
771
+ QgsGeometry smooth( const unsigned int iterations, const double offset ) const;
772
772
773
773
/** Smooths a polygon using the Chaikin algorithm*/
774
774
QgsPolygon smoothPolygon( const QgsPolygon &polygon, const unsigned int iterations = 1, const double offset = 0.25 ) const;
@@ -794,5 +794,7 @@ class QgsGeometry
794
794
//! Allows direct construction of QVariants from geometry.
795
795
operator QVariant() const;
796
796
797
+ operator bool() const;
798
+
797
799
}; // class QgsGeometry
798
800
0 commit comments