Skip to content
Permalink
Browse files
Merge pull request #4557 from m-kuhn/expressionModulaizing
Modularizing the expression engine file structure and some cleanup
  • Loading branch information
m-kuhn committed May 19, 2017
2 parents d7b952b + 24b16c5 commit fe2350c50bd92be2c13e4ccb417e1740e7d67c9d
Showing with 11,111 additions and 10,448 deletions.
  1. +2 −0 doc/api_break.dox
  2. +31 −32 python/CMakeLists.txt
  3. +3 −3 python/core/__init__.py
  4. +5 −1 python/core/core.sip
  5. +507 −0 python/core/expression/qgsexpression.sip
  6. +282 −0 python/core/expression/qgsexpressionfunction.sip
  7. +256 −0 python/core/expression/qgsexpressionnode.sip
  8. +357 −0 python/core/expression/qgsexpressionnodeimpl.sip
  9. +0 −1,366 python/core/qgsexpression.sip
  10. +9 −9 python/core/qgsexpressioncontext.sip
  11. +4 −4 python/core/qgsfeaturerequest.sip
  12. +6 −5 src/analysis/CMakeLists.txt
  13. +40 −40 src/app/CMakeLists.txt
  14. +12 −2 src/core/CMakeLists.txt
  15. +10 −0 src/core/annotations/qgsannotation.cpp
  16. +2 −2 src/core/annotations/qgsannotation.h
  17. +30 −0 src/core/composer/qgscomposermapitem.cpp
  18. +6 −6 src/core/composer/qgscomposermapitem.h
  19. +15 −0 src/core/composer/qgscomposermultiframe.cpp
  20. +3 −3 src/core/composer/qgscomposermultiframe.h
  21. +20 −0 src/core/effects/qgsshadoweffect.cpp
  22. +4 −4 src/core/effects/qgsshadoweffect.h
  23. +837 −0 src/core/expression/qgsexpression.cpp
  24. +552 −0 src/core/expression/qgsexpression.h
  25. +4,180 −0 src/core/expression/qgsexpressionfunction.cpp
  26. +456 −0 src/core/expression/qgsexpressionfunction.h
  27. +51 −0 src/core/expression/qgsexpressionnode.cpp
  28. +275 −0 src/core/expression/qgsexpressionnode.h
  29. +1,432 −0 src/core/expression/qgsexpressionnodeimpl.cpp
  30. +372 −0 src/core/expression/qgsexpressionnodeimpl.h
  31. 0 src/core/expression/qgsexpressionnodeutils.cpp
  32. +21 −0 src/core/expression/qgsexpressionutils.cpp
  33. +384 −0 src/core/expression/qgsexpressionutils.h
  34. +29 −0 src/core/geometry/qgsabstractgeometry.cpp
  35. +6 −6 src/core/geometry/qgsabstractgeometry.h
  36. +25 −0 src/core/geometry/qgscurve.cpp
  37. +4 −4 src/core/geometry/qgscurve.h
  38. +27 −0 src/core/geometry/qgsgeometrycollection.cpp
  39. +5 −5 src/core/geometry/qgsgeometrycollection.h
  40. +0 −6,689 src/core/qgsexpression.cpp
  41. +0 −1,564 src/core/qgsexpression.h
  42. +8 −7 src/core/qgsexpressioncontext.cpp
  43. +11 −9 src/core/qgsexpressioncontext.h
  44. +5 −3 src/core/qgsexpressionlexer.ll
  45. +39 −36 src/core/qgsexpressionparser.yy
  46. +2 −1 src/core/qgsexpressionprivate.h
  47. +8 −8 src/core/qgsfeaturerequest.h
  48. +40 −0 src/core/qgsmaplayer.cpp
  49. +8 −8 src/core/qgsmaplayer.h
  50. +124 −122 src/core/qgsogcutils.cpp
  51. +18 −16 src/core/qgsogcutils.h
  52. +11 −10 src/core/qgspropertytransformer.cpp
  53. +56 −48 src/core/qgssqlexpressioncompiler.cpp
  54. +6 −4 src/core/qgssqlexpressioncompiler.h
  55. +6 −5 src/core/qgssqliteexpressioncompiler.cpp
  56. +1 −1 src/core/qgssqliteexpressioncompiler.h
  57. +9 −0 src/core/qgssqlstatement.cpp
  58. +1 −1 src/core/qgssqlstatement.h
  59. +2 −1 src/core/qgsvectorlayer.cpp
  60. +4 −3 src/core/symbology-ng/qgssymbollayerutils.cpp
  61. +13 −12 src/customwidgets/CMakeLists.txt
  62. +27 −26 src/gui/CMakeLists.txt
  63. +3 −1 src/gui/attributetable/qgsattributetablemodel.cpp
  64. +3 −2 src/gui/qgsexpressionbuilderwidget.cpp
  65. +10 −9 src/plugins/coordinate_capture/CMakeLists.txt
  66. +10 −8 src/plugins/evis/CMakeLists.txt
  67. +10 −7 src/plugins/geometry_checker/CMakeLists.txt
  68. +14 −5 src/plugins/georeferencer/CMakeLists.txt
  69. +10 −9 src/plugins/gps_importer/CMakeLists.txt
  70. +1 −1 src/plugins/gps_importer/qgsgpsdevice.h
  71. +17 −15 src/plugins/grass/CMakeLists.txt
  72. +11 −9 src/plugins/offline_editing/CMakeLists.txt
  73. +10 −8 src/plugins/spatialquery/CMakeLists.txt
  74. +10 −5 src/plugins/topology/CMakeLists.txt
  75. +14 −10 src/providers/arcgisrest/CMakeLists.txt
  76. +10 −9 src/providers/db2/CMakeLists.txt
  77. +30 −29 src/providers/db2/qgsdb2expressioncompiler.cpp
  78. +1 −1 src/providers/db2/qgsdb2expressioncompiler.h
  79. +7 −7 src/providers/delimitedtext/CMakeLists.txt
  80. +8 −8 src/providers/gdal/CMakeLists.txt
  81. +5 −3 src/providers/gpx/CMakeLists.txt
  82. +8 −6 src/providers/grass/CMakeLists.txt
  83. +7 −8 src/providers/mssql/CMakeLists.txt
  84. +7 −6 src/providers/mssql/qgsmssqlexpressioncompiler.cpp
  85. +1 −1 src/providers/mssql/qgsmssqlexpressioncompiler.h
  86. +6 −5 src/providers/ogr/CMakeLists.txt
  87. +16 −15 src/providers/ogr/qgsogrexpressioncompiler.cpp
  88. +4 −2 src/providers/ogr/qgsogrexpressioncompiler.h
  89. +7 −9 src/providers/oracle/CMakeLists.txt
  90. +14 −14 src/providers/oracle/qgsoracleexpressioncompiler.cpp
  91. +1 −1 src/providers/oracle/qgsoracleexpressioncompiler.h
  92. +9 −7 src/providers/ows/CMakeLists.txt
  93. +10 −12 src/providers/postgres/CMakeLists.txt
  94. +5 −4 src/providers/postgres/qgspostgresexpressioncompiler.cpp
  95. +1 −1 src/providers/postgres/qgspostgresexpressioncompiler.h
  96. +7 −5 src/providers/spatialite/CMakeLists.txt
  97. +12 −13 src/providers/virtual/CMakeLists.txt
  98. +5 −4 src/providers/virtual/qgsvirtuallayerfeatureiterator.cpp
  99. +3 −2 src/providers/virtual/qgsvirtuallayerfeatureiterator.h
  100. +2 −2 src/providers/virtual/qgsvirtuallayersqlitemodule.cpp
  101. +11 −10 src/providers/wcs/CMakeLists.txt
  102. +10 −8 src/providers/wfs/CMakeLists.txt
  103. +10 −9 src/providers/wms/CMakeLists.txt
  104. +7 −5 src/python/CMakeLists.txt
  105. +17 −16 src/server/CMakeLists.txt
  106. +2 −1 src/server/qgsserverprojectparser.cpp
  107. +5 −1 src/server/services/DummyService/CMakeLists.txt
  108. +1 −0 src/server/services/wcs/CMakeLists.txt
  109. +1 −0 src/server/services/wfs/CMakeLists.txt
  110. +17 −14 src/server/services/wms/CMakeLists.txt
  111. +8 −6 tests/bench/CMakeLists.txt
  112. +2 −0 tests/src/analysis/CMakeLists.txt
  113. +24 −21 tests/src/app/CMakeLists.txt
  114. +1 −0 tests/src/core/CMakeLists.txt
  115. +6 −11 tests/src/core/testqgsexpression.cpp
  116. +1 −1 tests/src/core/testqgsexpressioncontext.cpp
  117. +19 −16 tests/src/gui/CMakeLists.txt
  118. +1 −0 tests/src/providers/CMakeLists.txt
@@ -1066,6 +1066,8 @@ version instead.
- acceptVisitor() has been removed
- QgsExpression::referencedColumns() returns QSet<QString> instead of QStringList
- QgsExpression::Node::referencedColumns() returns QSet<QString> instead of QStringList
- `QgsExpression::Node` was renamed to `QgsExpressionNode`
- `QgsExpression::Function` was renamed to `QgsExpressionFunction`


QgsExpression::Function {#qgis_api_break_3_0_QgsExpression_Function}
@@ -93,38 +93,37 @@ INCLUDE_DIRECTORIES(SYSTEM
${SQLITE3_INCLUDE_DIR}
)
INCLUDE_DIRECTORIES(
../src/core
../src/core/annotations
../src/core/auth
../src/core/pal
../src/core/composer
../src/core/diagram
../src/core/effects
../src/core/fieldformatter
../src/core/dxf
../src/core/geometry
../src/core/gps
../src/core/layertree
../src/core/metadata
../src/core/processing
../src/core/providers
../src/core/providers/memory
../src/core/raster
../src/core/scalebar
../src/core/symbology-ng

../src/gui
../src/gui/symbology-ng
../src/gui/raster
../src/gui/attributetable
../src/gui/auth
../src/gui/editorwidgets
../src/gui/editorwidgets/core
../src/gui/effects
../src/gui/layertree
../src/gui/locator

../src/plugins
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/annotations
${CMAKE_SOURCE_DIR}/src/core/auth
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/core/pal
${CMAKE_SOURCE_DIR}/src/core/composer
${CMAKE_SOURCE_DIR}/src/core/diagram
${CMAKE_SOURCE_DIR}/src/core/effects
${CMAKE_SOURCE_DIR}/src/core/fieldformatter
${CMAKE_SOURCE_DIR}/src/core/dxf
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/gps
${CMAKE_SOURCE_DIR}/src/core/layertree
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/processing
${CMAKE_SOURCE_DIR}/src/core/providers
${CMAKE_SOURCE_DIR}/src/core/providers/memory
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/core/scalebar
${CMAKE_SOURCE_DIR}/src/core/symbology-ng
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/symbology-ng
${CMAKE_SOURCE_DIR}/src/gui/raster
${CMAKE_SOURCE_DIR}/src/gui/attributetable
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets/core
${CMAKE_SOURCE_DIR}/src/gui/effects
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/gui/locator
${CMAKE_SOURCE_DIR}/src/plugins

${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
${CMAKE_BINARY_DIR}/src/core
@@ -71,10 +71,10 @@ def myfunc(values, *args):
:param usesgeometry:
:return:
"""
class QgsExpressionFunction(QgsExpression.Function):
class QgsPyExpressionFunction(QgsExpressionFunction):

def __init__(self, func, name, args, group, helptext='', usesGeometry=True, referencedColumns=QgsFeatureRequest.ALL_ATTRIBUTES, expandargs=False):
QgsExpression.Function.__init__(self, name, args, group, helptext)
QgsExpressionFunction.__init__(self, name, args, group, helptext)
self.function = func
self.expandargs = expandargs
self.uses_geometry = usesGeometry
@@ -132,7 +132,7 @@ def referencedColumns(self, node):

function.__name__ = name
helptext = helptemplate.safe_substitute(name=name, doc=helptext)
f = QgsExpressionFunction(function, name, arg_count, group, helptext, usesgeometry, referenced_columns, expandargs)
f = QgsPyExpressionFunction(function, name, arg_count, group, helptext, usesgeometry, referenced_columns, expandargs)

# This doesn't really make any sense here but does when used from a decorator context
# so it can stay.
@@ -49,7 +49,6 @@
%Include qgseditorwidgetsetup.sip
%Include qgsellipsoidutils.sip
%Include qgserror.sip
%Include qgsexpression.sip
%Include qgsexpressioncontext.sip
%Include qgsexpressioncontextgenerator.sip
%Include qgsfeature.sip
@@ -403,3 +402,8 @@
%Include geometry/qgstriangle.sip
%Include geometry/qgswkbtypes.sip
%Include geometry/qgswkbptr.sip

%Include expression/qgsexpression.sip
%Include expression/qgsexpressionnodeimpl.sip
%Include expression/qgsexpressionnode.sip
%Include expression/qgsexpressionfunction.sip

0 comments on commit fe2350c

Please sign in to comment.