34 Commits

Author SHA1 Message Date
Nyall Dawson
aaca87ca06 Move curve orientation enum (Clockwise/CounterClockwise) to Qgis and
generalise the name

These values are useful for more than just curve orientations
2021-11-10 18:42:42 +11:00
Juergen E. Fischer
c6008b7ee1 fix MSVC build: reverts fee62e4, dff05dd and e3a77b9484c effectivly
reverting 3fb0f66 (followup #45348)

Using --no-public-is-protected (default on Windows) also works on Linux
and fixes #45331 too
2021-10-21 23:03:48 +02:00
nirvn
ef84e48a09 Run sipify_all.sh 2021-10-12 16:34:05 +10:00
Denis Rouzaud
ec16736306 run sipify 2021-10-12 16:34:05 +10:00
Nyall Dawson
e733b517b3 Split QgsVertexId out to own file, promote type to enum class 2021-10-12 14:54:26 +10:00
Nyall Dawson
01e3e1dddc [api] Move QgsGeometry enums to Qgis, promote to enum classes 2021-08-04 09:54:32 +10:00
Loïc Bartoletti
17d1443ace is2DClosed -> isClosed2D and fix a typo 2021-06-08 14:26:20 +10:00
Loïc Bartoletti
df02c00f13 sipify 2021-06-08 14:26:20 +10:00
Nyall Dawson
1c11a91811 Add QgsGeometry::normalize()
A port of the equivalent method from GEOS, but with added support
for curved geometries and M values

Reorganizes the geometry into a normalized form (or "canonical" form).

Polygon rings will be rearranged so that their starting vertex is
the lower left and ring orientation follows the right hand rule, collections
are ordered by geometry type, and other normalization techniques are applied.
The resultant geometry will be geometrically equivalent to the original geometry.
2021-04-29 05:33:25 +10:00
Nyall Dawson
e3a73a1ac5 Add method to "scroll" the vertices of a closed curve geometry,
so that a particular vertex is the first one
2021-04-29 05:33:25 +10:00
Nyall Dawson
36e52f8514 Add method to split QgsCurve geometries into two parts at a specific
vertex index
2021-04-27 19:15:51 +10:00
Nyall Dawson
729792d981 Add QgsCurve::indexOf to retrieve index of a specified QgsPoint
within the curve
2021-04-27 11:26:49 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Nyall Dawson
7c410120e3 Super-optimised version of geometry bounding box intersects test
Apply some fancy logic to make this test as cheap as possible
to run
2021-03-12 05:46:14 +10:00
Nyall Dawson
4ee9feb56b Sipify 2020-10-09 11:20:09 +10:00
Nyall Dawson
fe5615ea44 Hold the GIL for more geometry related methods 2020-09-18 11:50:27 +10:00
Nyall Dawson
f496173bd7 Fix messy doxygen blocks which mess with sipify script
Fixes #38291
2020-08-20 17:01:35 +10:00
Nyall Dawson
205273e7cd Add method to QgsAbstractGeometry to convert geometry to QPainterPath
Unlike QgsGeometry::asQPolygonF, this allows for correct handling
of multipolygons and rings, etc.

And potentially, the generated QPainterPaths could use arc segments
instead of segmentizing geometries. In fact, there's been disabled
code which seems to do this in place since the new geometry engine
was introduced back in 2.10! TODO: check if this code works correctly...
2020-07-03 15:24:32 +10:00
Nyall Dawson
81a9db9f57 [sipify] Fix creation of cross references 2020-06-15 13:43:58 +10:00
Sandro Mani
6c32a6ae85 Add QgsAbstractGeometry::asKml 2020-01-16 14:36:31 +01:00
Nyall Dawson
75697d77ed Cache validity check results
For non-point geometry subclasses (points are always valid!) we
now cache the results of a geometry validity check. Subsequent
checks utilise the cached result wherever possible.

Because QgsGeometry/QgsFeature objects are implicitly shared, this
means that we avoid a *lot* of duplicate validity checks as
features and geometries are thrown around during processing model
execution.
2019-03-01 08:06:31 +10:00
Nyall Dawson
107b48a430 Add NULLPTR macro for use in doxygen comments
For the c++ api dox this expands to "\c nullptr" (the
\c directive indicates a code literal value), and for sipify/Python
it expands to ``None`` (`` is sphinx annotation for literal values)

Makes for nicer dox for both c++ and Python!
2019-02-27 09:41:11 +10:00
Nyall Dawson
b6d66becab Sipify 2019-02-27 09:41:11 +10:00
Nyall Dawson
384d310233 Minor improvements to PyQGIS returns for SIP_OUT params 2019-02-05 04:55:34 +11:00
Denis Rouzaud
166e952c33 run sipify 2018-12-19 08:04:27 -04:00
Denis Rouzaud
edfb7e1465 run sipify 2018-12-18 17:17:25 -04:00
Nyall Dawson
1e5479964f [FEATURE][API] Add some nice PyQGIS methods and exceptions to QgsLineString
- len(QgsCurve) returns number of points in curve
- raise IndexErrors when calling pointN, xAt, yAt, zAt, mAt, setXAt, setYAt,
setMAt, setZAt with invalid vertex indices
- Add [] getter for retrieving specific vertices, eg. ls[0] returns QgsPoint(...)
- Add [] setter for setting specific (existing) vertices, e.g. ls[1] = QgsPoint(1,2)
- Add del support for removing vertices, e.g. del ls[1] removes the second vertex
2018-11-27 09:29:13 +10:00
Nyall Dawson
c22364d45e Add method to determine orientation of closed curves 2018-11-09 19:06:48 +10:00
Nyall Dawson
c6a91dab09 [FEATURE] Use native interpolate point method instead of GEOS method
Because:
- Exactly follows curves and doesn't require segmentizing input geometry
- Also interpolates z/m values if they are present in input geometry
- Is faster
2018-08-15 14:01:59 +10:00
Nyall Dawson
513bcb68e4 [FEATURE] New geometry API call to return a curve substring
Returns a new curve representing a substring of a curve, from
a start distance and end distance.

If z or m values are present, the output z and m will be interpolated using
the existing vertices' z or m values.

Handles curved geometries without loss.
2018-08-15 14:01:59 +10:00
Nyall Dawson
0c7df170e1 Optimise QgsCurve::asQPolygonF for linestring geometries 2018-05-30 05:01:40 +10:00
Nyall Dawson
f8bc97030b Remove extra space added before first line of docstring 2018-05-28 08:22:11 +10:00
Nyall Dawson
2cb8a33884 Fix broken see also links 2018-05-25 11:16:18 +10:00
Denis Rouzaud
7df2593caf move auto generated sip file in dedicated folder 2018-05-14 10:23:37 -04:00