87 Commits

Author SHA1 Message Date
Denis Rouzaud
af1fee525a Move feature now benefits from Advanced Digitizing
QgsMapToolMoveFeature now inherits QgsMapToolAdvancedDigitizing
this allows to specify distance, angles, complex and multiple moves at once
it is now a click and click operation (similarly to the rotate feature map tool): so it can be cancelled once enabled with the right click
2016-08-11 08:06:43 +02:00
Juergen E. Fischer
3f22a7a77f another scripts/replacev2.sh with minor manual fixes 2016-08-10 12:12:28 +02:00
Juergen E. Fischer
0688621046 scripts/replacev2.sh run 2016-08-10 12:08:52 +02:00
Matthias Kuhn
bb79d13e82 Remove deprecated Qgis::WKBType and API cleanup (#3325)
* Remove deprecated Qgis::WKBType and API cleanup

Renames QgsWKBTypes to QgsWkbTypes

Replaces usage of the enums:

* Qgis::WKBType with QgsWkbTypes::Type
* Qgis::GeometryType with QgsWkbTypes::GeometryType

Their values should be forward compatible (a fact that was already
explited up to now by casting between the types)

Renames some SSLxxx to SslXxx and URIxxx to UriXxx

* Fix build warnings and simplify type handling

* Add a fixer to rewrite imports

* The forgotten rebase conflictThe forgotten rebase conflicts

* QgsDataSourcURI > QgsDataSourceUri

* QgsWKBTypes > QgsWkbTypes

* Qgis.WKBGeom > QgsWkbTypes.Geom

* Further python fixes

* Guess what... Qgis::wkbDimensions != QgsWkbTypes::wkbDimensions

* Fix tests

* Python 3 updates

* [travis] pull request caching cannot be disabled

so at least use it in r/w mode

* Fix python3 print in plugins
2016-08-04 09:10:08 +02: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
Martin Dobias
ab4a83b49b Goodbye to QgsMapRenderer (#3333)
For the time being the class is kept in the server code while it is still being used there.
2016-07-24 22:40:52 +02:00
Nyall Dawson
1a2231f10c Rename QGis class to Qgis, for capitalisation consistency 2016-07-21 22:01:38 +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
Nyall Dawson
adafeda82a Avoid all use of QgsCoordinateTransform pointers, replace with
copies or references

Makes the code more robust, fixes leaks and avoids potential
null pointer dereferencing
2016-07-16 20:36:45 +10:00
Juergen E. Fischer
e503c705a1 change QgsAbstractGeometryV2::coordinateSequence() to return a
implicitly shared copy of an internal cache instead of recreating the
coordinate sequence again and again.

Improves performance of the nodetool on large features a lot (refs #13963)

Also introduce Qgs(Coordinate|Ring|Point)SequenceV2 typedefs.
2016-02-21 21:49:51 +01:00
Hugo Mercier
bcded3c2d4 Keep Z/M information when digitizing from a snapped point (fixes #14318) 2016-02-18 08:59:35 +01:00
Daan Goedkoop
384da5665e Fix floating point inaccuracies when digitizing (to fix bug #13745) 2016-02-11 21:05:34 +01:00
Hugo Mercier
e2123c79e5 Fix addFeature and addPart maptool for layers with a Z 2016-02-09 10:44:41 +01:00
Nyall Dawson
c3a57434d9 Fix clazy 'pass small and trivially-copyable type by value' warnings 2016-02-02 19:47:21 +11:00
Martin Dobias
06932d98de [tracer] If tracing is not possible, simply use a straight line like usual
Until now the tracing was quite strict and it would show error messages
if something went wrong with start/end-points and would not allow creation
of points outside the tracing graph. It is however more user-friendly
to allow capturing points outside of the graph, so the user does not need
to enable/disable tracing whenever capturing some extra points is needed.

Also, the warning "too many features" is hidden immediately when there
is reasonable amount of features (before it would stick there until timeout).
2016-01-20 10:39:19 +01:00
Martin Dobias
7a5df7ada6 Move tracing action creation to qgis app 2016-01-19 18:03:15 +01:00
Nyall Dawson
23fc3cf9cc Fix invalid rubber band when digitising polygon and layer CRS
is not the same as map CRS (fix #14117)
2016-01-19 10:50:17 +11:00
Martin Dobias
e7d277fd86 [tracer] improved reporting of warnings 2016-01-11 19:40:58 +01:00
Martin Dobias
2c414ce058 [tracer] Disable tracing if there are too many features displayed
This ensures that building of tracing graph never takes too long.
(The most expensive part is noding of linestrings to ensure they
only touch at the ends)
2016-01-11 18:27:00 +01:00
Martin Dobias
33ea60d741 [tracer] Fix reprojection, limit tracing graph to visible extent 2016-01-11 15:55:56 +01:00
Martin Dobias
bf8571dde5 [tracer] Skip duplicate points in the path (to avoid geometry errors) 2016-01-10 20:32:01 +01:00
Martin Dobias
70c5fe5553 [tracer] Fix issues with rubber bands 2016-01-10 20:25:32 +01:00
Martin Dobias
bbe359867a [tracer] Integration of tracing into GUI
Checking the new 'enable tracing' button will switch capture tools
to tracing mode. Tracing can be turned on/off even while digitizing
is in progress
2016-01-10 18:47:42 +01:00
Denis Rouzaud
b0bbfc7c86 Merge pull request #2584 from SebDieBln/MapCanvas_EnterLeave
UI improvement for digitizing maptools
2015-12-23 15:47:28 +01:00
Sebastian Dietrich
c28c493b65 fix all occurrences of multiple statements in a single line
This was accomplished by running scripts/astyle-all.sh.
2015-12-21 01:21:06 +01:00
Sebastian Dietrich
e8ef77e781 Hide temporary rubberband when maptool is not active. 2015-12-16 20:19:26 +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
ee720796a3 Change size()/count() == 0 and count() > 0 to isEmpty() checks
Because:
- easier to read
- follows recommendations by clazy/KDAB
- potentially performance benefits
2015-12-08 22:45:06 +11:00
Nyall Dawson
9cc9d424ce Add extra check for deprecations to documentation test
This check tests that if a function has been declared deprecated
with either Q_DECL_DEPRECATED or has a @deprecated Doxygen note
then it MUST have both the Q_DECL_DEPRECATD and @deprecated note.

It's important that both are used, as Q_DECL_DEPRECATED allows
throwing a warning if that method is used in code, while the
@deprecated doxygen note gives an indication to devs/PyQGIS users
of why it's deprecated and what should be used instead.

Ideally we'd also test for SIP /Deprecated/ tags, but I can't
find any reliable way to do this.
2015-12-07 21:55:36 +11:00
Matthias Kuhn
0826290c8e Fix crash on exit (Fix #13369) 2015-09-16 21:09:20 +02:00
Marco Hugentobler
c54ea43c36 Show validation message only in case of errors 2015-09-16 16:47:58 +02:00
Matthias Kuhn
9bd4276014 Repaint layer when a maptool changes it
Refs #13347
2015-09-14 12:48:48 +02:00
Juergen E. Fischer
bd86697b6e fix windows build 2015-09-11 17:38:03 +02:00
Denis Rouzaud
69e53df66b do not send event to adv. digit. when no selection 2015-09-11 12:02:44 +02:00
Matthias Kuhn
3831668f2e Sip bindings for editing and cad map tools 2015-09-11 12:02:25 +02:00
Matthias Kuhn
efcbbfdaeb Move maptools from app->gui 2015-09-11 12:02:25 +02:00