68 Commits

Author SHA1 Message Date
Nyall Dawson
3f6b490218 Sipify 2025-04-02 11:11:10 +10:00
Nyall Dawson
afd2e4f42d Fix doxygen class briefs which aren't full sentences 2025-04-01 09:44:00 +10:00
Nyall Dawson
52226f0b9c Mark models as security risk if they contain algs with security risks 2024-10-02 10:36:00 +10:00
Nyall Dawson
b39f760cbc
Correctly handle multiline SIP_OUT param documentation 2024-09-10 11:11:25 +10:00
Nyall Dawson
49d31fa527 Fix some malformed docs 2024-08-30 05:47:07 +10:00
Nyall Dawson
3a578d6712 Header update 2024-08-13 20:28:55 +10:00
Nyall Dawson
20d9657f19 Add mechanism to merge results across different model execution runs
So that if a part model was run from a previous state, we can
generate the complete state of model results across both runs
2024-05-04 06:30:43 +10:00
Nyall Dawson
86cf8f8815 Store more model execution details for later retrieval 2024-05-04 06:30:43 +10:00
Nyall Dawson
0a877ea4af Documentation improvements 2024-04-21 06:46:35 +10:00
Nyall Dawson
de0f5cf87c Make API more future proof 2024-04-21 06:46:35 +10:00
Nyall Dawson
75455dffad Move class to own file 2024-04-21 06:46:35 +10:00
Even Rouault
15ea5c46bc
Header files: remove all mentions of '\since QGIS 3.0' 2024-02-18 20:57:23 +01:00
Nyall Dawson
2346f75366 Correctly calculate model child dependencies when a model step
uses expressions for parameter values and contains variables
generated by another step in the model

We were showing links for these in the model designer so it
appeared as though the dependencies were there, but at actual
execution time there was nothing forcing the child which generated
the variable to be run before the child using the variable.
2023-08-26 05:06:40 +10:00
Nyall Dawson
440cac298f Promote QgsProcessingModelChildParameterSource source to enum class and move to Qgis
This wasn't marked as stable API, so we don't need any of the usual monkey patching code
2023-08-25 15:44:05 +10:00
Alexandre Neto
6f1d39a7f3 update sip 2023-08-05 10:48:51 +10:00
Alexandre Neto
1c30d618aa Try to clean all traces of the Graphical modeler and replace by Model Designer 2023-08-05 10:48:51 +10:00
Nyall Dawson
f27195c165 [processing] Allow configuration of order of outputs created by a model
This adds a new "Reorder Model Outputs" action to the model designer
menu (to accompany the existing "Reorder Model Inputs" action).
Selecting this option allows model creators to set a specific order
which the outputs from their model must use when loading the results
into a project. This gives the model creator a means of ensuring
that layers are logically ordered, eg placing a vector layer over
a raster layer and a point layer over a polygon layer.

Optionally, the model creator can also set a "Group name" for the
outputs. If this is specified then all outputs from the model will
be placed into a (newly created if necessary) layer tree group
with that name.

Sponsored by the QGIS Germany User Group
2023-05-10 13:17:55 +10:00
Nyall Dawson
dd89f3779a [processing] Always use the same method to launder names
Ultimately avoids forced removal of _ characters in model
parameter names
2022-03-30 15:41:23 +10:00
Nyall Dawson
9b427c665f Remove constraint disabling threading for all models 2022-03-14 08:28:24 +10:00
Nyall Dawson
5df4882380 Fix exception when editing outputs in models 2022-02-28 19:57:15 +10:00
Nyall Dawson
1d97b4548a Add internal version handling for model algorithms
Allows us to change behaviour of model algorithms (e.g. output names)
for newly created models only, without risk of breaking existing
scripts
2022-02-28 19:57:15 +10:00
Nyall Dawson
817895d6d3 [processing] When an input parameter is renamed in the model designer,
also update the internal name of that parameter and all child algorithms
in the model accordingly

Before we just "faked" this by changing the parameter's description
only, but that meant that the old name was permenantly stuck and
had to be used in qgis_process or when calling the model via
python.
2022-02-28 17:33:19 +10:00
Nyall Dawson
29a59e70bf Add method to test whether model file name matches model name 2022-02-05 11:05:51 +10:00
Juergen E. Fischer
c6008b7ee1 fix MSVC build: reverts fee62e4, dff05dd and e3a77b9484c effectivly
reverting 3fb0f66 (followup #45348)

Using --no-public-is-protected (default on Windows) also works on Linux
and fixes #45331 too
2021-10-21 23:03:48 +02:00
nirvn
ef84e48a09 Run sipify_all.sh 2021-10-12 16:34:05 +10:00
Denis Rouzaud
ec16736306 run sipify 2021-10-12 16:34:05 +10:00
Nyall Dawson
d3870937b2 [processing] When exporting a model to a python script, include
helpful comments next to all static enum parameter values used
in child algorithms with the corresponding text.

I.e. instead of

  alg_params = {
    'END_CAP_STYLE': 2,
  }

we now export

  alg_params = {
    'END_CAP_STYLE': 2,  # Flat
  }

Much more readable!
2021-04-09 11:45:53 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00
Nyall Dawson
81a9db9f57 [sipify] Fix creation of cross references 2020-06-15 13:43:58 +10:00
Nyall Dawson
3b3c7d8012 Hookup model logic for correct skipping of branches which shouldn't be run 2020-04-16 16:02:53 +10:00
Nyall Dawson
e3955df564 Add method to model API to get available dependencies for a child algorithm 2020-04-16 16:02:53 +10:00
Nyall Dawson
b2167594fe Make handling of processing child algorithm dependencies more flexible
Instead of just using child ID strings, use a new dedicated class to
store dependency information
2020-04-16 16:02:53 +10:00
Nyall Dawson
7fd72f3b4e [FEATURE][processing] Allow reordering model inputs
Instead of forcing a quasi-random ordering of inputs for models,
this commit exposes a new "Reorder Model Inputs" option in the model
designer which allows users control over the exact order of
inputs to show users for their model.

No more illogical ordering like showing a field choice before the
layer choice it's based on!

Sponsored by NaturalGIS
2020-04-16 06:03:48 +10:00
Nyall Dawson
b9a99890b4 Add method to validate a whole model 2020-04-14 20:27:21 +10:00
Nyall Dawson
9f7c7fcb35 Add method to validate a child algorithm in a model
Checks that the algorithm has valid values for all inputs
2020-04-14 20:27:21 +10:00
Nyall Dawson
47f96e2466 [FEATURE][processing] Allow copying/cut/paste of model components
This commit allows users to copy and paste model components, both
within the same model and between different models
2020-04-14 14:36:02 +10:00
Nyall Dawson
d20a3bddc0 [FEATURE][processing] Port output parameter wrappers to new c++ API for modeler
This allows a range of new possibilities, including:
- models with static outputs for child algorithms, e.g. always saving
a child algorithm's output to a geopackage or postgres layer
- models with expression based output values for child algorithms, e.g.
generating an automatic file name based on today's date and saving
outputs to that file
2020-04-02 02:29:54 +10:00
Nyall Dawson
f31af07235 Fix windows build 2020-04-01 18:20:09 +10:00
Nyall Dawson
4fa9083cf6 [FEATURE][processing] Allow creation of group boxes in models
These are a visual guide, allowing designers to create logical groups
of algorithms relating to a single task ("eg 'Prepare data')

The title and color of the group boxes can be customized
2020-04-01 18:20:09 +10:00
Nyall Dawson
a7a64d40e0 Add API for storing group boxes in processing models 2020-04-01 18:20:09 +10:00
Nyall Dawson
e788be93fa [processing][FEATURE] Add api for setting model component colors, and expose
the option to set manual colors for individual model comments
2020-04-01 18:20:09 +10:00
Nyall Dawson
e386573c0c [FEATURE][processing] Port multi-layer input parameter widget to new API
Allows
- expression based inputs
- rearrangement of inputs for multi-layer parameters in models, to set
specific layer orders
2020-03-31 01:06:48 +10:00
Nyall Dawson
2a1bf56493 [FEATURE][processing] Remember parameter values between model designer runs
When designing a model, users typically will need to run the model
many times as they tweak its structure.

This change causes the parameters used when running the model from
the designer to be remembered and saved into the model, so that
each time you run the model from the designer you don't have to
re-set all the input parameter values to the desired test ones.

Makes iterative model design SO much easier!

Sponsored by Alta Ehf
2020-03-06 18:22:49 +10:00
Nyall Dawson
64868ce8f2 Bit more Python to c++ porting 2020-03-06 03:49:16 +10:00
Nyall Dawson
13fc85d740 [FEATURE][processsing] Add support for comments attached to components
This allows users to create comments attached to model components (inputs,
algorithms or outputs). Comments are shown linked to the associated component,
and can be freely moved around the model.
2020-03-06 03:49:16 +10:00
Nyall Dawson
d6d1b858c9 Metatype 2020-03-05 18:55:20 +10:00
Nyall Dawson
873ad5f734 Clone should be const 2020-03-05 18:55:20 +10:00
Nyall Dawson
d8111e1025 Make link point collapsing handling more generic 2020-03-03 16:08:23 +10:00
Nyall Dawson
55a582d068 Make size a property of QgsProcessingModelComponent
API only for now, cannot be set by users
2020-03-02 18:53:31 +10:00