20 Commits

Author SHA1 Message Date
Sandro Mani
31cc65df49 [Geometry checker] Initial multi-layer support 2017-10-23 17:25:06 +02:00
Nyall Dawson
891d612e95 Remove unused qmath.h includes 2017-08-25 03:42:03 +10:00
Denis Rouzaud
2e7de50b42 run astyle on src/* 2017-03-03 09:09:37 +01:00
Nyall Dawson
b5480633e4 Standardise names for static variables
All non-const variables are prefixed with "s", all const
statics are ALL_CAPS
2017-01-14 16:40:24 +10:00
Nyall Dawson
e656c63ab7 Remove duplicate QgsFeature::setFeatureId method
Leave just QgsFeature::setId and document api break
2017-01-11 10:05:31 +01:00
Harrissou Sant-anna
f9578bf60b Replace selectedFeaturesIds by selectedFeatureIds 2016-12-07 00:19:11 +01:00
Sandro Mani
97eb0f742f [Geometry Checker] Don't add geometry-less features to feature-pool 2016-12-06 13:29:55 +01:00
Nyall Dawson
cea47427d0 Optimise creation of spatial indexes
Use constructor which takes an iterator instead of manually
adding features, and don't request attributes for spatial
index features
2016-10-19 08:38:11 +10:00
Nyall Dawson
bd7d913379 Refine QgsFeature geometry getters/setters
All pointer based methods have been removed.

Now we have only:

  void setGeometry( const QgsGeometry& geom )

and

  QgsGeometry geometry() const

Benefits include avoiding a whole lot of tricky pointer lifetime
issues, potential memory leaks, and finally closing #777, which
has survived for over 9 years!...

Impacts on PyQGIS code:
- no more need for the messy
  g = QgsGeometry( feature.geometry() )
  workaround, just use g = feature.geometry() instead
- IMPORTANT: you can no longer test whether a feature has geometry
 using `if f.geometry():`, since QgsFeature::geometry() will
 *always* return an object. Instead, use
 `if not f.geometry().isEmpty():`, or preferably the new method
 `if not f.hasGeometry():`

Fix #777
2016-08-01 16:25:46 +10:00
Nyall Dawson
aceddae65a QgsFeature cleanup, part 1
Deprecate some QgsFeature methods which take or return pointers,
update other classes as required
2016-07-31 21:23:07 +10:00
Nyall Dawson
c628c0f434 Rework includes to forward declare as much as possible
Should speed up recompilation when headers change
2016-07-18 19:10:19 +10:00
Sandro Mani
54e424faf7 [Geometry checker] QgsGeomUtils -> QgsGeometryCheckerUtils 2016-07-14 16:41:35 +02:00
Nyall Dawson
23a3a7717e Cleaner API for selecting features in QgsVectorLayer
- add selectByRect( QgsRectangle&, SelectBehaviour) and
selectByIds( QgsFeatureIds, SelectBehaviour) for selecting
by rect and ids respectively, with options to add to selection/
remove from selection/intersect with current selection
- deprecate select( QgsRectangle ) and setSelectedFeatures in
favour of new methods
- add unit tests
2016-05-19 12:30:32 +10:00
Nyall Dawson
ccebd83aa4 Standardise format of initializer lists 2016-05-03 09:38:04 +10:00
Nyall Dawson
bc89bdb170 Fix coverity issues:
- possible use after free
- uninitialized member
2016-01-10 17:36:07 +11:00
Nyall Dawson
566dd4bd43 Always pass QgsFeatureId by value, not reference
Since it's just a int64, it's faster to pass by value
2015-12-30 22:51:32 +11:00
Juergen E. Fischer
8214608169 more nullptr updates (folloup 320c696) 2015-12-16 16:29:29 +01:00
Nyall Dawson
576875e998 Followup 320c696 use clang-modernize to replace 0/NULL use with nullptr 2015-12-15 11:24:51 +11:00
Nyall Dawson
9a94132fb4 Clazy issues:
- use at() instead of [] for temporary containers (at() returns
const reference, so it avoids the detach which occurs with [])
- use at( 0 ) rather than first() for containers, because first()
detaches (Qt5 introduced constFirst()/constLast() to overcome this)
2015-10-20 20:36:08 +11:00
Sandro Mani
e9e638f6f4 Geometry Checker and Geometry Snapper plugins 2015-09-21 10:03:24 +02:00