Skip to content
Permalink
Browse files

Merge pull request #3312 from nyalldawson/transfer

Make QgsCoordinateTransform implicitly shared, no longer a QObject
  • Loading branch information
nyalldawson committed Jul 17, 2016
2 parents cd3f540 + e6df492 commit 19438caed9d0501384f5164b3dcd1d0c5c5ccea7
Showing with 1,447 additions and 1,118 deletions.
  1. +80 −0 doc/api_break.dox
  2. +172 −129 python/core/qgscoordinatetransform.sip
  3. +4 −1 python/core/qgscrscache.sip
  4. +4 −2 python/core/qgsdatumtransformstore.sip
  5. +4 −13 python/core/qgsdiagramrendererv2.sip
  6. +4 −1 python/core/qgsmaprenderer.sip
  7. +1 −1 python/core/qgsmaprendererjob.sip
  8. +2 −2 python/core/qgsmapsettings.sip
  9. +5 −5 python/core/qgspallabeling.sip
  10. +7 −3 python/core/qgsrendercontext.sip
  11. +3 −2 python/core/qgsvectorfilewriter.sip
  12. +1 −1 python/core/raster/qgsrasterprojector.sip
  13. +2 −2 src/analysis/network/qgslinevectorlayerdirector.cpp
  14. +6 −6 src/app/nodetool/qgsmaptoolnodetool.cpp
  15. +5 −7 src/app/qgisapp.cpp
  16. +2 −1 src/core/CMakeLists.txt
  17. +1 −1 src/core/composer/qgsatlascomposition.cpp
  18. +1 −1 src/core/composer/qgscomposermapgrid.cpp
  19. +113 −366 src/core/qgscoordinatetransform.cpp
  20. +183 −191 src/core/qgscoordinatetransform.h
  21. +361 −0 src/core/qgscoordinatetransform_p.h
  22. +12 −18 src/core/qgscrscache.cpp
  23. +5 −2 src/core/qgscrscache.h
  24. +3 −3 src/core/qgsdatumtransformstore.cpp
  25. +3 −2 src/core/qgsdatumtransformstore.h
  26. +4 −7 src/core/qgsdiagramrendererv2.cpp
  27. +8 −13 src/core/qgsdiagramrendererv2.h
  28. +19 −23 src/core/qgsdistancearea.cpp
  29. +4 −4 src/core/qgsdistancearea.h
  30. +1 −1 src/core/qgsjsonutils.cpp
  31. +2 −2 src/core/qgslabel.cpp
  32. +2 −2 src/core/qgsmaphittest.cpp
  33. +38 −38 src/core/qgsmaprenderer.cpp
  34. +4 −1 src/core/qgsmaprenderer.h
  35. +4 −5 src/core/qgsmaprenderercustompainterjob.cpp
  36. +13 −13 src/core/qgsmaprendererjob.cpp
  37. +1 −1 src/core/qgsmaprendererjob.h
  38. +23 −17 src/core/qgsmapsettings.cpp
  39. +2 −2 src/core/qgsmapsettings.h
  40. +9 −12 src/core/qgspallabeling.cpp
  41. +5 −5 src/core/qgspallabeling.h
  42. +8 −10 src/core/qgspointlocator.cpp
  43. +2 −3 src/core/qgspointlocator.h
  44. +2 −3 src/core/qgsrendercontext.cpp
  45. +8 −5 src/core/qgsrendercontext.h
  46. +16 −17 src/core/qgsvectorfilewriter.cpp
  47. +5 −4 src/core/qgsvectorfilewriter.h
  48. +9 −9 src/core/qgsvectorlayerdiagramprovider.cpp
  49. +4 −10 src/core/qgsvectorlayerimport.cpp
  50. +10 −10 src/core/qgsvectorlayerlabelprovider.cpp
  51. +4 −4 src/core/qgsvectorlayerrenderer.cpp
  52. +7 −7 src/core/raster/qgsrasterlayerrenderer.cpp
  53. +24 −24 src/core/raster/qgsrasterprojector.cpp
  54. +10 −10 src/core/raster/qgsrasterprojector.h
  55. +3 −3 src/core/symbology-ng/qgsheatmaprenderer.cpp
  56. +5 −5 src/core/symbology-ng/qgsinvertedpolygonrenderer.cpp
  57. +3 −3 src/core/symbology-ng/qgslinesymbollayerv2.cpp
  58. +11 −11 src/core/symbology-ng/qgssymbolv2.cpp
  59. +2 −2 src/core/symbology-ng/qgssymbolv2.h
  60. +4 −4 src/gui/qgshighlight.cpp
  61. +3 −3 src/gui/qgsmaptoolcapture.cpp
  62. +2 −2 src/plugins/coordinate_capture/coordinatecapture.cpp
  63. +3 −0 src/plugins/dxf2shp_converter/CMakeLists.txt
  64. +1 −0 src/plugins/gps_importer/CMakeLists.txt
  65. +2 −2 src/plugins/grass/qgsgrassplugin.cpp
  66. +8 −8 src/plugins/grass/qgsgrassregion.cpp
  67. +2 −2 src/plugins/grass/qgsgrassregion.h
  68. +3 −6 src/plugins/spatialquery/qgsgeometrycoordinatetransform.cpp
  69. +1 −1 src/plugins/spatialquery/qgsgeometrycoordinatetransform.h
  70. +2 −3 src/plugins/spatialquery/qgsspatialquerydialog.cpp
  71. +1 −1 src/providers/grass/qgsgrassimport.cpp
  72. +1 −0 src/providers/mssql/CMakeLists.txt
  73. +3 −0 src/providers/ows/CMakeLists.txt
  74. +4 −16 src/providers/wcs/qgswcsprovider.cpp
  75. +2 −1 src/providers/wcs/qgswcsprovider.h
  76. +8 −12 src/providers/wms/qgswmsprovider.cpp
  77. +0 −3 src/providers/wms/qgswmsprovider.h
  78. +8 −8 src/server/qgswmsserver.cpp
  79. +133 −0 tests/src/core/testqgscoordinatetransform.cpp
@@ -21,8 +21,44 @@ This page tries to maintain a list with incompatible changes that happened in pr
\subsection qgis_api_break_3_0_QgsCoordinateTransform QgsCoordinateTransform

<ul>
<li>QgsCoordinateTransform is no longer a QObject. readXml, writeXml and initialise are all normal public members now,
not slots. The invalidTransformInput() signal has been removed.</li>
<li>QgsCoordinateTransform::clone() has been removed. Just use direct copies instead.</li>
<li>sourceCrs() and destCrs() now return a copy instead of a reference to the CRS. This has no effect on PyQGIS code, but c++
plugins calling these methods will need to be updated.</li>
<li>isInitialised() has been renamed to isValid()</li>
<li>theCRS parameter in setSourceCrs has been renamed to 'crs'</li>
<li>setDestCRS() has been renamed to setDestinationCrs() for consistency</li>
<li>destCRS() has been renamed to destinationCrs() for consistency</li>
<li>theSource, theDest, theSourceSrsId, theDestSrsId, theSourceWkt, theDestWkt, theSourceCRSType parameters in the QgsCoordinateTransform constructors have been renamed to source, destination, sourceSrsId, destinationSrsId, sourceWkt, destinationWkt, sourceCrsType respectively</li>
<li>'p' argument in transform() has been renamed to 'point', 'theRect' to 'rectangle', 'poly' to 'polygon'</li>
<li>setDestCRSID has been removed, use setDestinationCrs() instead</li>
<li>'theNode', 'theDoc' parameters in readXML and writeXML have been renamed to 'node' and 'document' respectively</li>
<li>readXML() and writeXML() have been renamed to readXml() and writeXml() for consistency</li>
</ul>

\subsection qgis_api_break_3_0_QgsCoordinateTransformCache QgsCoordinateTransformCache

<ul>
<li>transform() now returns a QgsCoordinateTransform object, not a pointer. An invalid QgsCoordinateTransform will
be returned in place of a null pointer.</li>
</ul>

\subsection qgis_api_break_3_0_QgsDiagramLayerSettings QgsDiagramLayerSettings

<ul>
<li>coordinateTransform() now returns a QgsCoordinateTransform object, not a pointer. An invalid QgsCoordinateTransform will
be returned in place of a null pointer.</li>
<li>setCoordinateTransform() now takes a QgsCoordinateTransform object, not a pointer. Use an invalid QgsCoordinateTransform in
place of a null pointer.</li>
<li>The ct member has been removed. Use coordinateTransform() and setCoordinateTransform() instead.
</ul>

\subsection qgis_api_break_3_0_QgsDatumTransformStore QgsDatumTransformStore

<ul>
<li>transformation() now returns a QgsCoordinateTransform object, not a pointer. An invalid QgsCoordinateTransform will
be returned in place of a null pointer.</li>
</ul>

\subsection qgis_api_break_3_0_DataProviders Data Providers
@@ -67,6 +103,43 @@ screenUpdateRequested() were removed. These members have had no effect for a num
<li>theError parameter in appendError() and setError() were renamed to 'error'.</li>
</ul>

\subsection qgis_api_break_3_0_QgsMapRenderer QgsMapRenderer

<ul>
<li>transformation() now returns a QgsCoordinateTransform object, not a pointer. An invalid QgsCoordinateTransform will
be returned instead of a null pointer if no transformation is required.</li>
</ul>

\subsection qgis_api_break_3_0_QgsMapRendererJob QgsMapRendererJob

<ul>
<li>reprojectToLayerExtent() now takes a QgsCoordinateTransform reference, not a pointer. An invalid QgsCoordinateTransform should
be used instead of a null pointer if no transformation is required.</li>
</ul>

\subsection qgis_api_break_3_0_QgsMapSettings QgsMapSettings

<ul>
<li>layerTransform() now returns a QgsCoordinateTransform object, not a pointer. An invalid QgsCoordinateTransform will
be returned instead of a null pointer if no transformation is required.</li>
</ul>

\subsection qgis_api_break_3_0_QgsRenderContext QgsRenderContext

<ul>
<li>coordinateTransform() now returns a QgsCoordinateTransform object, not a pointer. An invalid QgsCoordinateTransform will
be returned instead of a null pointer if no transformation is required.</li>
<li>setCoordinateTransform() now takes a QgsCoordinateTransform reference, not a pointer. An invalid QgsCoordinateTransform should be used instead of a null pointer if no transformation is required.</li>
</ul>

\subsection qgis_api_break_3_0_QgsPalLayerSettings QgsPalLayerSettings

<ul>
<li>ct is now a QgsCoordinateTransform object, not a pointer. An invalid QgsCoordinateTransform will
be used instead of a null pointer if no transformation is required.</li>
<li>prepareGeometry() and geometryRequiresPreparation() now take a QgsCoordinateTransform reference, not a pointer. An invalid QgsCoordinateTransform should be used instead of a null pointer if no transformation is required.</li>
</ul>

\subsection qgis_api_break_3_0_QgsJSONExporter QgsJSONExporter

<ul>
@@ -113,13 +186,20 @@ plugins calling this method will need to be updated.</li>
<li>subsetString() was made const. This has no effect on PyQGIS code, but c++ code implementing derived layer classes will need to update the signature of this method to match.</li>
</ul>

\subsection qgis_api_break_3_0_QgsRasterProjector QgsRasterProjector

<ul>
<li>extentSize() now takes a QgsCoordinateTransform reference, not a pointer. An invalid QgsCoordinateTransform should be used instead of a null pointer if no transformation is required.</li>
</ul>

\subsection qgis_api_break_3_0_QgsVectorFileWriter QgsVectorFileWriter

<ul>
<li>QgsVectorFileWriter now takes references instead of pointers to QgsCoordinateReferenceSystem objects. Since
QgsCoordinateReferenceSystem is now implicitly shared, using references to QgsCoordinateReferenceSystem rather than
pointers makes for more robust, safer code. Use an invalid (default constructed) QgsCoordinateReferenceSystem
in code which previously passed a null pointer to QgsVectorFileWriter.</li>
<li>writeAsVectorFormat() now takes a QgsCoordinateTransform reference, not a pointer. An invalid QgsCoordinateTransform should be used instead of a null pointer if no transformation is required.</li>
</ul>

\subsection qgis_api_break_3_0_QgsVectorLayerEditBuffer QgsVectorLayerEditBuffer

1 comment on commit 19438ca

@blazek

This comment has been minimized.

Copy link
Member

@blazek blazek commented on 19438ca Jul 18, 2016

I am getting "proj_api.h file not found" in many providers (i have proj in custom dir). I started to add PROJ_INCLUDE_DIR to each provider's CMakeLists.txt, like I see you did for some providers in this commit, but I hesitate if it is the right solution, if the provider does not include proj_api.h directly, but via qgscoordinatetransform.h -> qgscoordinatetransform_p.h.

Should not we have some QGIS_CORE_DEPS_INCLUDE_DIRS?

Please sign in to comment.
You can’t perform that action at this time.