251 Commits

Author SHA1 Message Date
Nyall Dawson
947b0cc49e Safer memory management in geos
Also speed up avoid intersections by removing unnecessary geometry
cloning
2017-10-13 19:55:57 +10:00
Nyall Dawson
c3fdaa950d Some safer memory management for geos 2017-10-13 19:54:00 +10:00
Nyall Dawson
b922166d6e Rework internal geometry memory management
Use unique_ptrs wherever possible, and cleanup geometry
detachments
2017-10-13 19:18:55 +10:00
Etienne Trimaille
098611c3f6 add helper to build a QgsRectangle from a WKT string 2017-10-12 06:32:02 +10:00
Matthias Kuhn
6b418decd6 Spelling: use vertices rather than vertexes
... because that's what's used almost consistently throughout the codebase.
2017-10-09 10:13:13 +02:00
Denis Rouzaud
6e14854f90 [sipify] remove redundant private sections 2017-10-09 09:51:40 +02:00
Nyall Dawson
4f34f9442c Added better version info to QgsRectangle::buffered 2017-10-04 09:05:21 +10:00
Nyall Dawson
92af1dacaf Replace default constructors/destructors with = default 2017-10-01 06:52:14 +10:00
Nyall Dawson
a87d352bd7 Run clang-tidy modernize-use-default-member-init to move member
initialization to headers (c++11 style)
2017-09-27 05:02:34 +10:00
Nyall Dawson
9518c90a8b Fix multipolygon allowing insertion of non polygon geometries 2017-09-26 12:05:04 +10:00
Nyall Dawson
5ed6605225 Fix multisurface allowing insertion of non surface geometries 2017-09-26 11:28:51 +10:00
Nyall Dawson
4d989f8fb6 Fix clearing multisurface should reset dimensionality 2017-09-26 10:58:32 +10:00
Nyall Dawson
31730f43be Ensure multisurface dimensionality is respected when adding new surfaces 2017-09-26 10:48:12 +10:00
Nyall Dawson
ed90bf4ded Fix multicurve allowing insertion of non curve geometries 2017-09-26 10:12:52 +10:00
Nyall Dawson
c9117fc585 Fix clearing multicurve should reset dimensionality 2017-09-26 09:03:28 +10:00
Nyall Dawson
f5004ed7ef Fix multi line string allowing insertion of non line geometries 2017-09-26 08:33:47 +10:00
Nyall Dawson
ed72e37f0b Fix clearing multilinestring should reset dimensionality 2017-09-26 06:29:36 +10:00
Nyall Dawson
ba50bf043b Fix multi point allowing insertion of non point geometries 2017-09-25 21:20:32 +10:00
Nyall Dawson
97930d13e2 Fix clearing multipoint should reset z/m status 2017-09-25 21:20:06 +10:00
Nyall Dawson
ffbf93a657 Fix incorrect /Transfer/ for geometry collection 2017-09-25 21:19:43 +10:00
Nyall Dawson
d704163884 Rename QgsRectangle::buffer to buffered and mark as const 2017-09-25 17:20:36 +10:00
Nyall Dawson
01d34ede9d Sip sync 2017-09-25 17:12:03 +10:00
Nyall Dawson
e7b08d520e Expand geometry test coverage 2017-09-22 09:54:23 +10:00
Nyall Dawson
9e61cd63df Move overriden methods from headers to cpp files
Since they can't be inlined anyway
2017-09-19 17:22:33 +10:00
Nyall Dawson
f387210e4a Move QgsPolygonV2 equality operators up to QgsCurvePolygon 2017-09-19 17:22:33 +10:00
Nyall Dawson
bb425e4540 Cleaner signature for QgsAbstractGeometry::closestSegment 2017-09-19 17:22:33 +10:00
Nyall Dawson
54c988f918 Make QgsAbstractGeometry::toCurveType pure virtual, and implement
for all geometry types

Previously this method would return nullptrs for many geometry
types
2017-09-19 17:22:33 +10:00
Nyall Dawson
5bb359db90 Boost test coverage of geometry classes 2017-09-19 17:22:33 +10:00
Nyall Dawson
9b6e79cd18 Expand QgsTriangle test coverage 2017-09-19 17:22:32 +10:00
Nyall Dawson
a15340fc2c Extend geometry test coverage 2017-09-19 17:22:32 +10:00
Nyall Dawson
d3db082cd2 Extend unit tests for QgsPolygonV2, QgsPoint 2017-09-19 17:22:32 +10:00
Nyall Dawson
328fc9cb8d Consistently use unsigned int for QgsRegularPolygon 2017-09-19 17:22:32 +10:00
Nyall Dawson
92d739619d Fix memory leak in QgsEllipse 2017-09-19 17:22:32 +10:00
lbartoletti
5c3a72014a fix qgsgeometry sip 2017-09-08 08:06:21 +02:00
lbartoletti
629f46d308 add overload methods 2017-09-08 08:06:21 +02:00
Nyall Dawson
f1313af914 Add some more unit tests 2017-09-06 11:25:17 +10:00
Nyall Dawson
f12bb74b58 Add missing docs 2017-09-06 11:25:16 +10:00
Nyall Dawson
6ab7ebadec Metatype Qgs(Referenced)Rectangle/PointXY 2017-09-06 11:25:16 +10:00
Nyall Dawson
1194b5abea Use inheritance rather than composition for QgsReferencedGeometries
See https://github.com/qgis/QGIS/pull/4720#issuecomment-308652392
for discussion of the rationale
2017-09-06 11:25:16 +10:00
Denis Rouzaud
8053b96ec0 fix constructor and skip method with same python signature 2017-09-06 11:25:16 +10:00
Nyall Dawson
1a961e8045 Template based referenced geometry class 2017-09-06 11:25:16 +10:00
lbartoletti
e30f7044c9 [FEATURE][Processing] Minimal enclosing circle 2017-09-03 07:37:53 +10:00
Nyall Dawson
c2f8a8224b Geometry error string is not shared
Instead move it to a private QgsGeometry member. It's copied
with QgsGeometry, but not the underlying private geometry
data.

This means the error string can be changed without detaching
(and copying) the geometry data.

Also make greater use of error string for all use of GEOS
functions.
2017-08-31 08:36:01 +10:00
Nyall Dawson
d8607222e0 Expose GEOS Hausdorff distance calculations to QgsGeometry 2017-08-31 08:02:44 +10:00
Matthias Kuhn
0683528d9a
More doxymentation 2017-08-14 10:52:43 +02:00
Matthias Kuhn
a4dac6ace2
Define params as /Out/ 2017-08-14 08:58:59 +02:00
Denis Rouzaud
86e8da74cb
Return enum instead of int from QgsGeometry operations 2017-08-13 23:08:45 +02:00
Matthias Kuhn
b51a5f7b6f Simplify QgsGeometryEngine code 2017-08-13 20:19:32 +02:00
Matthias Kuhn
e3787effc6 Doxymentation 2017-08-13 20:19:32 +02:00
Matthias Kuhn
581b89e0ec Use pointers and not references to QgsAbstractGeometry
because using this more consistently throughout the codebase makes it
easier to maintain code.
We also do not want to call the copy constructor on them, using pointers
just makes this more obvious. Further, casting is also something
that's commonly done on pointers and not references.

And if you want a value or a reference, just use QgsGeometry, it's meant
to be handled like this.
2017-08-13 20:19:32 +02:00