@@ -42,19 +42,19 @@ class QgsMapToPixel;
42
42
class QPainter ;
43
43
class QgsPolygonV2 ;
44
44
45
- /* * polyline is represented as a vector of points */
45
+ /* * Polyline is represented as a vector of points */
46
46
typedef QVector<QgsPoint> QgsPolyline;
47
47
48
- /* * polygon : first item of the list is outer ring, inner rings (if any) start from second item */
48
+ /* * Polygon : first item of the list is outer ring, inner rings (if any) start from second item */
49
49
typedef QVector<QgsPolyline> QgsPolygon;
50
50
51
- /* * a collection of QgsPoints that share a common collection of attributes */
51
+ /* * A collection of QgsPoints that share a common collection of attributes */
52
52
typedef QVector<QgsPoint> QgsMultiPoint;
53
53
54
- /* * a collection of QgsPolylines that share a common collection of attributes */
54
+ /* * A collection of QgsPolylines that share a common collection of attributes */
55
55
typedef QVector<QgsPolyline> QgsMultiPolyline;
56
56
57
- /* * a collection of QgsPolygons that share a common collection of attributes */
57
+ /* * A collection of QgsPolygons that share a common collection of attributes */
58
58
typedef QVector<QgsPolygon> QgsMultiPolygon;
59
59
60
60
class QgsRectangle ;
@@ -78,10 +78,10 @@ class CORE_EXPORT QgsGeometry
78
78
// ! Constructor
79
79
QgsGeometry ();
80
80
81
- /* * copy constructor will prompt a deep copy of the object */
81
+ /* * Copy constructor will prompt a deep copy of the object */
82
82
QgsGeometry ( const QgsGeometry & );
83
83
84
- /* * assignments will prompt a deep copy of the object
84
+ /* * Assignments will prompt a deep copy of the object
85
85
@note not available in python bindings
86
86
*/
87
87
QgsGeometry & operator =( QgsGeometry const & rhs );
@@ -300,61 +300,61 @@ class CORE_EXPORT QgsGeometry
300
300
*/
301
301
double closestSegmentWithContext ( const QgsPoint& point, QgsPoint& minDistPoint, int & afterVertex, double * leftOf = 0 , double epsilon = DEFAULT_SEGMENT_EPSILON ) const ;
302
302
303
- /* *Adds a new ring to this geometry. This makes only sense for polygon and multipolygons.
303
+ /* * Adds a new ring to this geometry. This makes only sense for polygon and multipolygons.
304
304
@return 0 in case of success (ring added), 1 problem with geometry type, 2 ring not closed,
305
305
3 ring is not valid geometry, 4 ring not disjoint with existing rings, 5 no polygon found which contained the ring*/
306
306
int addRing ( const QList<QgsPoint>& ring );
307
307
308
- /* *Adds a new ring to this geometry. This makes only sense for polygon and multipolygons.
308
+ /* * Adds a new ring to this geometry. This makes only sense for polygon and multipolygons.
309
309
@return 0 in case of success (ring added), 1 problem with geometry type, 2 ring not closed,
310
310
3 ring is not valid geometry, 4 ring not disjoint with existing rings, 5 no polygon found which contained the ring*/
311
311
int addRing ( QgsCurveV2* ring );
312
312
313
- /* *Adds a new island polygon to a multipolygon feature
313
+ /* * Adds a new island polygon to a multipolygon feature
314
314
@return 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring
315
315
not disjoint with existing polygons of the feature*/
316
316
int addPart ( const QList<QgsPoint> &points, QGis::GeometryType geomType = QGis::UnknownGeometry );
317
317
318
- /* *Adds a new part to this geometry (takes ownership)
318
+ /* * Adds a new part to this geometry (takes ownership)
319
319
@return 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring
320
320
not disjoint with existing polygons of the feature*/
321
321
int addPart ( QgsAbstractGeometryV2* part );
322
322
323
- /* *Adds a new island polygon to a multipolygon feature
323
+ /* * Adds a new island polygon to a multipolygon feature
324
324
@return 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring
325
325
not disjoint with existing polygons of the feature
326
326
@note not available in python bindings
327
327
*/
328
328
int addPart ( GEOSGeometry *newPart );
329
329
330
- /* *Adds a new island polygon to a multipolygon feature
330
+ /* * Adds a new island polygon to a multipolygon feature
331
331
@return 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring
332
332
not disjoint with existing polygons of the feature
333
333
@note available in python bindings as addPartGeometry (added in 2.2)
334
334
*/
335
335
int addPart ( const QgsGeometry *newPart );
336
336
337
- /* *Translate this geometry by dx, dy
337
+ /* * Translate this geometry by dx, dy
338
338
@return 0 in case of success*/
339
339
int translate ( double dx, double dy );
340
340
341
- /* *Transform this geometry as described by CoordinateTransform ct
341
+ /* * Transform this geometry as described by CoordinateTransform ct
342
342
@return 0 in case of success*/
343
343
int transform ( const QgsCoordinateTransform& ct );
344
344
345
- /* *Transform this geometry as described by QTransform ct
345
+ /* * Transform this geometry as described by QTransform ct
346
346
@note added in 2.8
347
347
@return 0 in case of success*/
348
348
int transform ( const QTransform& ct );
349
349
350
- /* *Rotate this geometry around the Z axis
350
+ /* * Rotate this geometry around the Z axis
351
351
@note added in 2.8
352
352
@param rotation clockwise rotation in degrees
353
353
@param center rotation center
354
354
@return 0 in case of success*/
355
355
int rotate ( double rotation, const QgsPoint& center );
356
356
357
- /* *Splits this geometry according to a given line.
357
+ /* * Splits this geometry according to a given line.
358
358
@param splitLine the line that splits the geometry
359
359
@param[out] newGeometries list of new geometries that have been created with the split
360
360
@param topological true if topological editing is enabled
@@ -365,17 +365,17 @@ class CORE_EXPORT QgsGeometry
365
365
bool topological,
366
366
QList<QgsPoint> &topologyTestPoints );
367
367
368
- /* *Replaces a part of this geometry with another line
368
+ /* * Replaces a part of this geometry with another line
369
369
@return 0 in case of success
370
370
@note: this function was added in version 1.3*/
371
371
int reshapeGeometry ( const QList<QgsPoint>& reshapeWithLine );
372
372
373
- /* *Changes this geometry such that it does not intersect the other geometry
373
+ /* * Changes this geometry such that it does not intersect the other geometry
374
374
@param other geometry that should not be intersect
375
375
@return 0 in case of success*/
376
376
int makeDifference ( const QgsGeometry* other );
377
377
378
- /* *Returns the bounding box of this feature*/
378
+ /* * Returns the bounding box of this feature*/
379
379
QgsRectangle boundingBox () const ;
380
380
381
381
/* * Test for intersection with a rectangle (uses GEOS) */
@@ -522,13 +522,13 @@ class CORE_EXPORT QgsGeometry
522
522
@note added in version 1.1 */
523
523
QList<QgsGeometry*> asGeometryCollection () const ;
524
524
525
- /* *Return contents of the geometry as a QPointF if wkbType is WKBPoint,
525
+ /* * Return contents of the geometry as a QPointF if wkbType is WKBPoint,
526
526
* otherwise returns a null QPointF.
527
527
* @note added in QGIS 2.7
528
528
*/
529
529
QPointF asQPointF () const ;
530
530
531
- /* *Return contents of the geometry as a QPolygonF. If geometry is a linestring,
531
+ /* * Return contents of the geometry as a QPolygonF. If geometry is a linestring,
532
532
* then the result will be an open QPolygonF. If the geometry is a polygon,
533
533
* then the result will be a closed QPolygonF of the geometry's exterior ring.
534
534
* @note added in QGIS 2.7
@@ -587,7 +587,7 @@ class CORE_EXPORT QgsGeometry
587
587
**/
588
588
void validateGeometry ( QList<Error> &errors );
589
589
590
- /* * compute the unary union on a list of geometries. May be faster than an iterative union on a set of geometries.
590
+ /* * Compute the unary union on a list of geometries. May be faster than an iterative union on a set of geometries.
591
591
@param geometryList a list of QgsGeometry* as input
592
592
@returns the new computed QgsGeometry, or null
593
593
*/
@@ -642,19 +642,19 @@ class CORE_EXPORT QgsGeometry
642
642
*/
643
643
int vertexNrFromVertexId ( const QgsVertexId& i ) const ;
644
644
645
- /* * return GEOS context handle
645
+ /* * Return GEOS context handle
646
646
* @note added in 2.6
647
647
* @note not available in Python
648
648
*/
649
649
static GEOSContextHandle_t getGEOSHandler ();
650
650
651
- /* *Construct geometry from a QPointF
651
+ /* * Construct geometry from a QPointF
652
652
* @param point source QPointF
653
653
* @note added in QGIS 2.7
654
654
*/
655
655
static QgsGeometry* fromQPointF ( const QPointF& point );
656
656
657
- /* *Construct geometry from a QPolygonF. If the polygon is closed than
657
+ /* * Construct geometry from a QPolygonF. If the polygon is closed than
658
658
* the resultant geometry will be a polygon, if it is open than the
659
659
* geometry will be a polyline.
660
660
* @param polygon source QPolygonF
@@ -707,7 +707,7 @@ class CORE_EXPORT QgsGeometry
707
707
*/
708
708
static bool compare ( const QgsMultiPolygon& p1, const QgsMultiPolygon& p2, double epsilon = 4 * DBL_EPSILON );
709
709
710
- /* *Smooths a geometry by rounding off corners using the Chaikin algorithm. This operation
710
+ /* * Smooths a geometry by rounding off corners using the Chaikin algorithm. This operation
711
711
* roughly doubles the number of vertices in a geometry.
712
712
* @param iterations number of smoothing iterations to run. More iterations results
713
713
* in a smoother geometry
@@ -718,33 +718,34 @@ class CORE_EXPORT QgsGeometry
718
718
*/
719
719
QgsGeometry* smooth ( const unsigned int iterations = 1 , const double offset = 0.25 ) const ;
720
720
721
- /* *Smooths a polygon using the Chaikin algorithm*/
721
+ /* * Smooths a polygon using the Chaikin algorithm*/
722
722
QgsPolygon smoothPolygon ( const QgsPolygon &polygon, const unsigned int iterations = 1 , const double offset = 0.25 ) const ;
723
- /* *Smooths a polyline using the Chaikin algorithm*/
723
+ /* * Smooths a polyline using the Chaikin algorithm*/
724
724
QgsPolyline smoothLine ( const QgsPolyline &polyline, const unsigned int iterations = 1 , const double offset = 0.25 ) const ;
725
725
726
726
/* * Creates and returns a new geometry engine
727
727
*/
728
728
static QgsGeometryEngine* createGeometryEngine ( const QgsAbstractGeometryV2* geometry );
729
729
730
+ // convert point list from v1 to v2
731
+ static void convertPointList ( const QList<QgsPoint>& input, QList<QgsPointV2>& output );
732
+ static void convertPointList ( const QList<QgsPointV2>& input, QList<QgsPoint>& output );
733
+
730
734
private:
731
735
732
736
QgsGeometryPrivate* d; // implicitely shared data pointer
733
737
734
738
void detach ( bool cloneGeom = true ); // make sure mGeometry only referenced from this instance
735
739
void removeWkbGeos ();
736
740
737
- // convert point list from v1 to v2
738
- static void convertPointList ( const QList<QgsPoint>& input, QList<QgsPointV2>& output );
739
- static void convertPointList ( const QList<QgsPointV2>& input, QList<QgsPoint>& output );
740
741
static void convertToPolyline ( const QList<QgsPointV2>& input, QgsPolyline& output );
741
742
static void convertPolygon ( const QgsPolygonV2& input, QgsPolygon& output );
742
743
743
- /* * try to convert the geometry to a point */
744
+ /* * Try to convert the geometry to a point */
744
745
QgsGeometry* convertToPoint ( bool destMultipart ) const ;
745
- /* * try to convert the geometry to a line */
746
+ /* * Try to convert the geometry to a line */
746
747
QgsGeometry* convertToLine ( bool destMultipart ) const ;
747
- /* * try to convert the geometry to a polygon */
748
+ /* * Try to convert the geometry to a polygon */
748
749
QgsGeometry* convertToPolygon ( bool destMultipart ) const ;
749
750
}; // class QgsGeometry
750
751
0 commit comments