Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable UNITY_BUILD=ON on qgis_core (37% to 50% faster builds), qgis_gui (50% faster builds), qgis_analysis (3.7x faster) #59669

Merged
merged 27 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a16c9be
[OGR provider] Fix inappropriate use of OGREnvelope3D
rouault Nov 30, 2024
db65e95
qgsgml/qgsgmlshema: avoid redefining same constant
rouault Nov 30, 2024
820e75e
src/core/mesh: factor a common method
rouault Nov 30, 2024
2c953ff
src/core/geocoding: avoid same name for global constant
rouault Nov 30, 2024
e72088e
src/core/numericformats: avoid potential one-definition-rule violation
rouault Nov 30, 2024
37c43d7
qgspointcloudrequest.cpp: add explicit cast for qHash() to avoid a qH…
rouault Nov 30, 2024
a51d03e
Add missing #define CPL_SUPRESS_CPLUSPLUS
rouault Nov 30, 2024
eaeaae8
Undefine #define at end of compilation units to avoid conflicts
rouault Nov 30, 2024
87b0b2f
qgis.cpp: namespace str() and xstr() macros
rouault Nov 30, 2024
f786afd
QgsLayoutItemLabel: remove unused private member
rouault Nov 30, 2024
ab2767d
src/core/CMakeLists.txt: enable UNITY_BUILD
rouault Nov 30, 2024
30d5f2e
Make unity builds conditioned by ENABLE_UNITY_BUILDS that defaults to…
rouault Nov 30, 2024
3bb704f
src/gui/auth: factor common code to make it unity builds friendly
rouault Nov 30, 2024
6d20384
QgsMapLayerConfigWidget/QgsRendererRasterPropertiesWidget: suppress -…
rouault Nov 30, 2024
9d3a9b0
src/gui/editorwidgets: remove unused private members
rouault Nov 30, 2024
6015f50
src/gui: use unity builds if ENABLE_UNITY_BUILDS
rouault Nov 30, 2024
19509bb
CI: set ENABLE_UNITY_BUILDS=ON for run-test.yml
rouault Nov 30, 2024
a43a076
windows-qt6.yml: enable ENABLE_UNITY_BUILDS=ON
rouault Nov 30, 2024
878ac1e
src/analysis: changes to allow unity builds
rouault Nov 30, 2024
2469d0b
src/analysis: use unity builds if ENABLE_UNITY_BUILDS
rouault Nov 30, 2024
057b51d
src/3d: use unity builds if ENABLE_UNITY_BUILDS
rouault Nov 30, 2024
3ac1228
qgsdwgimporter.h: add import guard
rouault Nov 30, 2024
5d8302b
src/app: use unity builds if ENABLE_UNITY_BUILDS
rouault Nov 30, 2024
cb3fec0
src/server: use unity builds if ENABLE_UNITY_BUILDS
rouault Nov 30, 2024
a656e4d
Due to the introduction of precompiled headers, ccache builds require…
rouault Dec 1, 2024
27b5360
Fix issue with .gch ccach'ing not working with QT6 and gcc
rouault Dec 2, 2024
b546472
Do not enable pre-compiled headers when ccache is available and with …
rouault Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ci/ogc/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ ccache -M 2.0G
# export CCACHE_LOGFILE=/tmp/cache.debug
ccache -z

# To make ccache work properly with precompiled headers
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime

cmake -GNinja \
-DUSE_CCACHE=ON \
-DWITH_QUICK=OFF \
Expand Down
4 changes: 4 additions & 0 deletions .docker/docker-qgis-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ ccache -M 2.0G
# export CCACHE_LOGFILE=/tmp/cache.debug
ccache -z

# To make ccache work properly with precompiled headers
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime

##############################
# Variables for output styling
##############################
Expand Down Expand Up @@ -89,6 +92,7 @@ cmake \
-DENABLE_MSSQLTEST=${WITH_QT5} \
-DENABLE_HANATEST=${WITH_QT5} \
-DENABLE_ORACLETEST=${WITH_QT5} \
-DENABLE_UNITY_BUILDS=${ENABLE_UNITY_BUILDS} \
-DPUSH_TO_CDASH=${PUSH_TO_CDASH} \
-DWITH_HANA=ON \
-DWITH_QGIS_PROCESS=ON \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ jobs:
mkdir -p ${CCACHE_DIR}
brew install ccache
ccache --set-config=max_size=2.0G
# To make ccache work properly with precompiled headers
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime
ccache -s

- name: Run cmake
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
with-compile-commands: ON
# LD_PRELOAD: /lib/x86_64-linux-gnu/libSegFault.so
experimental: false
unity-builds: ON

- distro-version: '39'
qt-version: 6
Expand All @@ -73,6 +74,7 @@ jobs:
with-compile-commands: OFF
LD_PRELOAD: ''
experimental: false
unity-builds: ON


fail-fast: false
Expand Down Expand Up @@ -165,6 +167,7 @@ jobs:
--env LD_PRELOAD=${{ matrix.LD_PRELOAD }} \
--env WITH_CLAZY=${{ matrix.with-clazy }} \
--env WITH_COMPILE_COMMANDS=${{ matrix.with-compile-commands }} \
--env ENABLE_UNITY_BUILDS=${{ matrix.unity-builds }} \
qgis3-build-deps \
/root/QGIS/.docker/docker-qgis-build.sh

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/windows-qt6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ jobs:
key: build-ccache-win64-qt6-${{ github.event.pull_request.base.ref || github.ref_name }}
save: ${{ github.event_name == 'push' }}

- name: 🛍️ Tune ccache configuration
shell: bash
run: |
# To make ccache work properly with precompiled headers
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime

- name: 🌱 Install dependencies and generate project files
shell: bash
run: |
Expand All @@ -73,6 +79,7 @@ jobs:
-D ENABLE_TESTS=OFF \
-D BUILD_WITH_QT6=ON \
-D USE_CCACHE=ON \
-D ENABLE_UNITY_BUILDS=ON \
-D FLEX_EXECUTABLE="${SOURCE_DIR}/win_flex.exe" \
-D BISON_EXECUTABLE="${SOURCE_DIR}/win_bison.exe" \
-D SIP_BUILD_EXECUTABLE="${BUILD_DIR}\vcpkg_installed\x64-windows-release\tools\python3\Scripts\sip-build.exe" \
Expand Down
56 changes: 54 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,62 @@ option(USE_CCACHE "Use ccache" ON)
if (USE_CCACHE)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
message(STATUS "ccache found")
execute_process(COMMAND ccache --help OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_HELP)
execute_process(COMMAND ccache --get-config sloppiness OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_SLOPPINESS)
execute_process(COMMAND ccache --get-config compiler_type OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_COMPILER_TYPE)
string(FIND "${CCACHE_SLOPPINESS}" "pch_defines" fpch_defines_found_index)
string(FIND "${CCACHE_SLOPPINESS}" "time_macros" time_macros_found_index)
string(FIND "${CCACHE_SLOPPINESS}" "include_file_mtime" include_file_mtime_found_index)
string(FIND "${CCACHE_SLOPPINESS}" "include_file_ctime" include_file_ctime_found_index)
# Detect if we have ccache >= 4.8 which accepts passing configuration settings when invoking the compiler
string(FIND "${CCACHE_HELP}" "ccache [KEY=VALUE ...] compiler" ccache_key_value_found_index)
if (fpch_defines_found_index EQUAL -1 OR time_macros_found_index EQUAL -1 OR
(BUILD_WITH_QT6 AND (include_file_mtime_found_index EQUAL -1 OR include_file_ctime_found_index EQUAL -1)))
set(CCACHE_SLOPPINESS_REQUIRED "pch_defines,time_macros")
if (BUILD_WITH_QT6 AND (include_file_mtime_found_index EQUAL -1 OR include_file_ctime_found_index EQUAL -1))
string(APPEND CCACHE_SLOPPINESS_REQUIRED ",include_file_mtime,include_file_ctime")
endif()
else()
set(CCACHE_SLOPPINESS_REQUIRED "")
endif()
if (BUILD_WITH_QT6 AND CMAKE_CXX_COMPILER STREQUAL "/usr/bin/c++" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT "${CCACHE_COMPILER_TYPE}" STREQUAL "gcc")
# Cf https://github.com/ccache/ccache/discussions/959
set(CCACHE_COMPILER_TYPE_GCC_REQUIRED ON)
else()
set(CCACHE_COMPILER_TYPE_GCC_REQUIRED OFF)
endif()
set(CCACHE_INVOCATION_COMMAND "ccache")
if (MSVC)
# CCache doesn't work yet with precompiled headers (cf https://github.com/ccache/ccache/issues/1383)
# so no need to set specific ccache configuration items
elseif (ccache_key_value_found_index EQUAL -1 )
if (CCACHE_SLOPPINESS_REQUIRED)
message(FATAL_ERROR "The use of precompiled headers only works if the ccache 'sloppiness' settings contains 'pch_defines' and 'time_macros'. Consider running 'ccache --set-config sloppiness=${CCACHE_SLOPPINESS_REQUIRED}' to define them")
endif()
if (CCACHE_COMPILER_TYPE_GCC_REQUIRED)
message(FATAL_ERROR "The use of precompiled headers only works properly with QT6 if the ccache 'compiler_type' settings is set to 'gcc'. Consider running 'ccache --set-config compiler_type=gcc'")
endif()
else()
if (CCACHE_SLOPPINESS_REQUIRED)
string(APPEND CCACHE_INVOCATION_COMMAND " sloppiness=${CCACHE_SLOPPINESS_REQUIRED}")
endif()
if (CCACHE_COMPILER_TYPE_GCC_REQUIRED)
string(APPEND CCACHE_INVOCATION_COMMAND " compiler_type=gcc")
endif()
endif()
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_INVOCATION_COMMAND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_INVOCATION_COMMAND}")
endif(CCACHE_FOUND)
endif(USE_CCACHE)

if (USE_CCACHE AND MSVC)
# CCache doesn't work yet with precompiled headers (cf https://github.com/ccache/ccache/issues/1383)
set(USE_PRECOMPILED_HEADERS OFF)
else()
set(USE_PRECOMPILED_HEADERS ON)
endif()

if (IOS)
set (DEFAULT_FORCE_STATIC_LIBS TRUE)
else()
Expand Down Expand Up @@ -1080,6 +1130,8 @@ endif()
# whether to install required system libs in the output package
set(QGIS_INSTALL_SYS_LIBS TRUE CACHE BOOL "If set to TRUE install all required system libs in the output package")

option(ENABLE_UNITY_BUILDS "Enable Unity builds, that is compiling several .cpp files in the same compilation unit (EXPERIMENTAL. Not recommended for production builds)" OFF)

#############################################################
# Python

Expand Down
3 changes: 3 additions & 0 deletions ms-windows/mingw/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ fi
installroot="$BUILDDIR/dist"
installprefix="$installroot/usr/$arch-w64-mingw32/sys-root/mingw"

# To make ccache work properly with precompiled headers
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime

# Cleanup
rm -rf "$installroot"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ be called for the layer after applying changes. This is ``True`` by default, but
.. versionadded:: 3.8
%End


virtual void syncToLayer( QgsMapLayer *layer );
%Docstring
Reset to original (vector layer) values
Expand Down
1 change: 1 addition & 0 deletions python/gui/auto_generated/qgsmaplayerconfigwidget.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ be called for the layer after applying changes. This is ``True`` by default, but
.. versionadded:: 3.8
%End


virtual void syncToLayer( QgsMapLayer *layer );
%Docstring
Reset to original (vector layer) values
Expand Down
6 changes: 5 additions & 1 deletion src/3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,11 @@ set (QGIS_3D_RCCS shaders.qrc ../../resources/3d/textures/textures.qrc)

add_library(qgis_3d SHARED ${QGIS_3D_SRCS} ${QGIS_3D_HDRS} ${QGIS_3D_RCCS} ${QGIS_3D_PRIVATE_HDRS})

target_precompile_headers(qgis_3d PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/src/core/qgis.h>)
if (USE_PRECOMPILED_HEADERS)
target_precompile_headers(qgis_3d PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/src/core/qgis.h>)
endif()

set_target_properties(qgis_3d PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})

# require c++17
target_compile_features(qgis_3d PRIVATE cxx_std_17)
Expand Down
6 changes: 5 additions & 1 deletion src/analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,11 @@ endif()

add_library(qgis_analysis ${LIBRARY_TYPE} ${QGIS_ANALYSIS_SRCS} ${QGIS_ANALYSIS_HDRS})

target_precompile_headers(qgis_analysis PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/src/core/qgis.h>)
if (USE_PRECOMPILED_HEADERS)
target_precompile_headers(qgis_analysis PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/src/core/qgis.h>)
endif()

set_target_properties(qgis_analysis PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})

# require c++17
target_compile_features(qgis_analysis PRIVATE cxx_std_17)
Expand Down
27 changes: 13 additions & 14 deletions src/analysis/processing/qgsalgorithmalignrasters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,6 @@ void QgsAlignRastersAlgorithm::initAlgorithm( const QVariantMap & )
addOutput( new QgsProcessingOutputMultipleLayers( QStringLiteral( "OUTPUT_LAYERS" ), QObject::tr( "Aligned rasters" ) ) );
}

struct QgsAlignRasterProgress : public QgsAlignRaster::ProgressHandler
{
explicit QgsAlignRasterProgress( QgsFeedback *feedback ) : mFeedback( feedback ) {}
bool progress( double complete ) override
{
mFeedback->setProgress( complete * 100 );
return true;
}

protected:
QgsFeedback *mFeedback = nullptr;
};


QVariantMap QgsAlignRastersAlgorithm::processAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
{
QgsRasterLayer *referenceLayer = parameterAsRasterLayer( parameters, QStringLiteral( "REFERENCE_LAYER" ), context );
Expand Down Expand Up @@ -172,6 +158,19 @@ QVariantMap QgsAlignRastersAlgorithm::processAlgorithm( const QVariantMap &param
rasterAlign.setClipExtent( extent );
}

struct QgsAlignRasterProgress : public QgsAlignRaster::ProgressHandler
{
explicit QgsAlignRasterProgress( QgsFeedback *feedback ) : mFeedback( feedback ) {}
bool progress( double complete ) override
{
mFeedback->setProgress( complete * 100 );
return true;
}

protected:
QgsFeedback *mFeedback = nullptr;
};

rasterAlign.setProgressHandler( new QgsAlignRasterProgress( feedback ) );

bool result = rasterAlign.setParametersFromRaster( referenceLayer->source(), customCRSWkt, customCellSize, customGridOffset );
Expand Down
25 changes: 13 additions & 12 deletions src/analysis/processing/qgsalgorithmalignsingleraster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,6 @@ void QgsAlignSingleRasterAlgorithm::initAlgorithm( const QVariantMap & )
addParameter( new QgsProcessingParameterRasterDestination( QStringLiteral( "OUTPUT" ), QObject::tr( "Aligned raster" ) ) );
}

struct QgsAlignRasterProgress : public QgsAlignRaster::ProgressHandler
{
explicit QgsAlignRasterProgress( QgsFeedback *feedback ) : mFeedback( feedback ) {}
bool progress( double complete ) override
{
mFeedback->setProgress( complete * 100 );
return true;
}

protected:
QgsFeedback *mFeedback = nullptr;
};


QVariantMap QgsAlignSingleRasterAlgorithm::processAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
Expand Down Expand Up @@ -215,6 +203,19 @@ QVariantMap QgsAlignSingleRasterAlgorithm::processAlgorithm( const QVariantMap &
rasterAlign.setClipExtent( extent );
}

struct QgsAlignRasterProgress : public QgsAlignRaster::ProgressHandler
{
explicit QgsAlignRasterProgress( QgsFeedback *feedback ) : mFeedback( feedback ) {}
bool progress( double complete ) override
{
mFeedback->setProgress( complete * 100 );
return true;
}

protected:
QgsFeedback *mFeedback = nullptr;
};

rasterAlign.setProgressHandler( new QgsAlignRasterProgress( feedback ) );

bool result = rasterAlign.setParametersFromRaster( referenceLayer->source(), customCRSWkt, customCellSize, customGridOffset );
Expand Down
13 changes: 0 additions & 13 deletions src/analysis/processing/qgsalgorithmrandompointsinpolygons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@

#include <random>

// The algorithm parameter names:
static const QString INPUT = QStringLiteral( "INPUT" );
static const QString POINTS_NUMBER = QStringLiteral( "POINTS_NUMBER" );
static const QString MIN_DISTANCE_GLOBAL = QStringLiteral( "MIN_DISTANCE_GLOBAL" );
static const QString MIN_DISTANCE = QStringLiteral( "MIN_DISTANCE" );
static const QString MAX_TRIES_PER_POINT = QStringLiteral( "MAX_TRIES_PER_POINT" );
static const QString SEED = QStringLiteral( "SEED" );
static const QString INCLUDE_POLYGON_ATTRIBUTES = QStringLiteral( "INCLUDE_POLYGON_ATTRIBUTES" );
static const QString OUTPUT = QStringLiteral( "OUTPUT" );
static const QString OUTPUT_POINTS = QStringLiteral( "OUTPUT_POINTS" );
static const QString POINTS_MISSED = QStringLiteral( "POINTS_MISSED" );
static const QString POLYGONS_WITH_MISSED_POINTS = QStringLiteral( "POLYGONS_WITH_MISSED_POINTS" );
static const QString FEATURES_WITH_EMPTY_OR_NO_GEOMETRY = QStringLiteral( "FEATURES_WITH_EMPTY_OR_NO_GEOMETRY" );
///@cond PRIVATE

QString QgsRandomPointsInPolygonsAlgorithm::name() const
Expand Down
15 changes: 15 additions & 0 deletions src/analysis/processing/qgsalgorithmrandompointsinpolygons.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ class QgsRandomPointsInPolygonsAlgorithm : public QgsProcessingAlgorithm
QgsProcessingFeedback *feedback ) override;

private:

// The algorithm parameter names:
static inline const QString INPUT = QStringLiteral( "INPUT" );
static inline const QString POINTS_NUMBER = QStringLiteral( "POINTS_NUMBER" );
static inline const QString MIN_DISTANCE_GLOBAL = QStringLiteral( "MIN_DISTANCE_GLOBAL" );
static inline const QString MIN_DISTANCE = QStringLiteral( "MIN_DISTANCE" );
static inline const QString MAX_TRIES_PER_POINT = QStringLiteral( "MAX_TRIES_PER_POINT" );
static inline const QString SEED = QStringLiteral( "SEED" );
static inline const QString INCLUDE_POLYGON_ATTRIBUTES = QStringLiteral( "INCLUDE_POLYGON_ATTRIBUTES" );
static inline const QString OUTPUT = QStringLiteral( "OUTPUT" );
static inline const QString OUTPUT_POINTS = QStringLiteral( "OUTPUT_POINTS" );
static inline const QString POINTS_MISSED = QStringLiteral( "POINTS_MISSED" );
static inline const QString POLYGONS_WITH_MISSED_POINTS = QStringLiteral( "POLYGONS_WITH_MISSED_POINTS" );
static inline const QString FEATURES_WITH_EMPTY_OR_NO_GEOMETRY = QStringLiteral( "FEATURES_WITH_EMPTY_OR_NO_GEOMETRY" );

int mNumPoints = 0;
bool mDynamicNumPoints = false;
QgsProperty mNumPointsProperty;
Expand Down
14 changes: 0 additions & 14 deletions src/analysis/processing/qgsalgorithmrandompointsonlines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@

#include <random>

// The algorithm parameter names:
static const QString INPUT = QStringLiteral( "INPUT" );
static const QString POINTS_NUMBER = QStringLiteral( "POINTS_NUMBER" );
static const QString MIN_DISTANCE_GLOBAL = QStringLiteral( "MIN_DISTANCE_GLOBAL" );
static const QString MIN_DISTANCE = QStringLiteral( "MIN_DISTANCE" );
static const QString MAX_TRIES_PER_POINT = QStringLiteral( "MAX_TRIES_PER_POINT" );
static const QString SEED = QStringLiteral( "SEED" );
static const QString INCLUDE_LINE_ATTRIBUTES = QStringLiteral( "INCLUDE_LINE_ATTRIBUTES" );
static const QString OUTPUT = QStringLiteral( "OUTPUT" );
static const QString OUTPUT_POINTS = QStringLiteral( "OUTPUT_POINTS" );
static const QString POINTS_MISSED = QStringLiteral( "POINTS_MISSED" );
static const QString LINES_WITH_MISSED_POINTS = QStringLiteral( "LINES_WITH_MISSED_POINTS" );
static const QString FEATURES_WITH_EMPTY_OR_NO_GEOMETRY = QStringLiteral( "FEATURES_WITH_EMPTY_OR_NO_GEOMETRY" );

///@cond PRIVATE

QString QgsRandomPointsOnLinesAlgorithm::name() const
Expand Down
15 changes: 15 additions & 0 deletions src/analysis/processing/qgsalgorithmrandompointsonlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ class QgsRandomPointsOnLinesAlgorithm : public QgsProcessingAlgorithm


private:

// The algorithm parameter names:
static inline const QString INPUT = QStringLiteral( "INPUT" );
static inline const QString POINTS_NUMBER = QStringLiteral( "POINTS_NUMBER" );
static inline const QString MIN_DISTANCE_GLOBAL = QStringLiteral( "MIN_DISTANCE_GLOBAL" );
static inline const QString MIN_DISTANCE = QStringLiteral( "MIN_DISTANCE" );
static inline const QString MAX_TRIES_PER_POINT = QStringLiteral( "MAX_TRIES_PER_POINT" );
static inline const QString SEED = QStringLiteral( "SEED" );
static inline const QString INCLUDE_LINE_ATTRIBUTES = QStringLiteral( "INCLUDE_LINE_ATTRIBUTES" );
static inline const QString OUTPUT = QStringLiteral( "OUTPUT" );
static inline const QString OUTPUT_POINTS = QStringLiteral( "OUTPUT_POINTS" );
static inline const QString POINTS_MISSED = QStringLiteral( "POINTS_MISSED" );
static inline const QString LINES_WITH_MISSED_POINTS = QStringLiteral( "LINES_WITH_MISSED_POINTS" );
static inline const QString FEATURES_WITH_EMPTY_OR_NO_GEOMETRY = QStringLiteral( "FEATURES_WITH_EMPTY_OR_NO_GEOMETRY" );

int mNumPoints = 0;
bool mDynamicNumPoints = false;
QgsProperty mNumPointsProperty;
Expand Down
17 changes: 1 addition & 16 deletions src/analysis/processing/qgsalgorithmzonalstatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,10 @@
#include "qgsalgorithmzonalstatistics.h"
#include "qgszonalstatistics.h"
#include "qgsvectorlayer.h"
#include "qgsalgorithmzonalstatistics_private.h"

///@cond PRIVATE

const std::vector< Qgis::ZonalStatistic > STATS
{
Qgis::ZonalStatistic::Count,
Qgis::ZonalStatistic::Sum,
Qgis::ZonalStatistic::Mean,
Qgis::ZonalStatistic::Median,
Qgis::ZonalStatistic::StDev,
Qgis::ZonalStatistic::Min,
Qgis::ZonalStatistic::Max,
Qgis::ZonalStatistic::Range,
Qgis::ZonalStatistic::Minority,
Qgis::ZonalStatistic::Majority,
Qgis::ZonalStatistic::Variety,
Qgis::ZonalStatistic::Variance,
};

QString QgsZonalStatisticsAlgorithm::name() const
{
return QStringLiteral( "zonalstatistics" );
Expand Down
Loading
Loading