380 Commits

Author SHA1 Message Date
Mathieu Pellerin
ad54073b1e
[processing] list native QGIS algorithms first in modeler dialog 2017-12-05 11:52:06 +07:00
Alexander Bruy
3d4a59bb8b [processing] cleanup files from unused code and remove some files 2017-11-28 12:27:45 +02:00
Alexander Bruy
0059b2b692 [processing] remove Python 2 compatibility layer 2017-11-28 12:27:45 +02:00
Nyall Dawson
c0e732b799 [processing] Add QGIS 3d provider
Adds a new QGIS processing provider for 3d algorithms, available
only when QGIS is built WITH_3D

Currently includes only a single algorithm for tesselating geometries,
which exposes the functionality of QgsTesselator to processing.

Like the native c++ algorithm provider, algorithms in the 3d
provider are transparently merged with the other QGIS providers
(i.e. they aren't separated into their own group)
2017-11-27 06:54:29 +11:00
Alexander Bruy
3a576d80b2 [processing] restore Help button functionality in modeler (fix #17483) 2017-11-23 16:16:08 +02:00
Harrissou Sant-anna
dd378a58c2 Tweak some dialog titles 2017-11-18 18:52:45 +01:00
Nyall Dawson
c5b9fa23cd Formatting 2017-09-22 10:56:32 +10:00
Nyall Dawson
94530a9efc Allow setting default value for field parameters in models 2017-09-22 10:50:46 +10:00
Nyall Dawson
6e1c5c4d75 [FEATURE] Show processing models in browser
And allow them to be executed and edited directly from there
2017-09-20 14:09:03 +10:00
Nyall Dawson
cf16a82419 Fix indentation 2017-09-12 19:23:37 +10:00
Nyall Dawson
4a974eab18 Cleanup model algorithm parameter definition dialog 2017-09-12 17:12:13 +10:00
Nyall Dawson
451a3fab26 Reformat code 2017-08-23 02:14:29 +10:00
Nyall Dawson
cdbb57d65f Don't throw python exception when modeler algorithm is missing inputs
Instead use nicer messagebar for feedback. Also fix untranslatable
strings.

Refs #17028
2017-08-23 02:14:24 +10:00
Nyall Dawson
b62fd51cc2 Don't allow dragging groups in model algorithm tree 2017-08-22 23:16:33 +10:00
Nyall Dawson
355cff191d Add Map Layer input parameter type for models
Since algorithms now use this parameter type (render map alg)
we also need to allow its use in models
2017-08-19 03:45:51 +10:00
Nyall Dawson
7d69e5f5af Expose all layer type filters to both model feature source, vector
layer and multi layer inputs

Refs #17030
2017-08-19 03:36:33 +10:00
Nyall Dawson
370b26798f Fix wrapped c++ object has been deleted error when editing model parameters
Fixes #16858
2017-08-19 03:24:28 +10:00
Nyall Dawson
b318aff6ff Fix multi layer parameters in models not giving all options for inputs 2017-08-17 05:12:11 +10:00
arnaud.morvan@camptocamp.com
b26e6812d4 [processing] Check all parameter's values in ModelerParametersDialog
Check that all parameter's values pass the validity check,
even if not returned as QgsProcessingModelChildParameterSource.

In case of list, tests that it is really a QgsProcessingModelChildParameterSource list,
and create a QgsProcessingModelChildParameterSource from the list if it is not the case
(useful for custom parameters that return lists as ParameterFieldsMapping).
2017-08-14 13:48:50 +02:00
Nyall Dawson
e0fbe3409a Use ellipsis for isolated strings in plugins too 2017-08-11 04:33:18 +10:00
Nyall Dawson
d6e2985c08 Fix invalid icon sizes in processing model builder
While the toolbar buttons were shown in the correct size, the
actual icon image in the buttons was not correctly scaling to
match the button size.

Hardcoding the svg icons in the py file seems to be the only
way to avoid this.
2017-08-07 05:24:12 +10:00
Nyall Dawson
cad54f2cea Fix incorrect icon sizes in Python console
Console was not respecting application icon size setting
2017-08-07 05:24:12 +10:00
arnaud.morvan@camptocamp.com
40ccd3bcb3 [processing] Correctly delete processing dialogs
del only delete the python variable, not the dialog which is owned by the main window.
2017-08-05 09:31:40 +02:00
Alexander Bruy
9fe326dee2 [processing] more consistent naming for class members, setters and
getters
2017-08-04 13:21:26 +03:00
Alexander Bruy
49bfe69823 [processing] add parameter representing raster band 2017-08-04 11:27:35 +03:00
Nyall Dawson
5c844a5cfb Really delete processing dialogs
The dialogs are parented to the main window, which means sip
transfers the ownership to the main window - and they are
never deleted as a result. This results in various error
messages caused by the widgets hanging around forever
and listening out for various signals they are connected to.
2017-07-12 18:52:53 +10:00
Nyall Dawson
1e13d733c2 Move declaration of algorithm parameters/outputs to a new virtual
initAlgorithm() method

This allows 2 benefits:
- algorithms can be subclassed and have subclasses add additional
parameters/outputs to the algorithm. With the previous approach
of declaring parameters/outputs in the constructor, it's not
possible to call virtual methods to add additional parameters/
outputs (since you can't call virtual methods from a constructor).

- initAlgorithm takes a variant map argument, allowing the algorithm
to dynamically adjust its declared parameters and outputs according
to this configuration map. This potentially allows model algorithms which
can be configured to have variable numbers of parameters and
outputs at run time. E.g. a "router" algorithm which directs
features to one of any number of output sinks depending on some
user configured criteria.
2017-07-10 16:31:14 +10:00
Nyall Dawson
f49b603443 Split QgsProcessingModelAlgorithm into separate components
The cpp/h file was getting too large, so split off the individual
subcomponents into their own h/cpp files to keep code
maintainable.
2017-07-08 20:49:17 +10:00
Nyall Dawson
cfa18039af Fix incorrect icon size in processing windows
Well... kind of. It fixes the toolbar button size, but for some
reason the actual icon content itself isn't being resized. I can't
work out why this is...
2017-07-08 20:49:17 +10:00
Nyall Dawson
a3fdb95d0a Update model input type names 2017-07-08 20:49:17 +10:00
Nyall Dawson
7db1a9dfd3 Save and restore window geometry for modeler dialogs 2017-07-08 20:49:17 +10:00
Nyall Dawson
3665e462c8 Use a filter line edit for outputs 2017-07-08 20:49:17 +10:00
Nyall Dawson
0836c60712 Make model editor dialog more robust while loading models 2017-07-08 20:49:17 +10:00
Nyall Dawson
9d04f87249 Rename "output" style parameters for clarity
The previous naming was too easily confused with processing outputs.
Rename them to QgsProcessingParameterFileDestination, etc... to
make it clearer what they are used for.
2017-07-08 20:49:17 +10:00
Nyall Dawson
534844f999 Add function to return variables available for child algorithms during
model execution

And use this function to determine in advance dependencies between
child algorithm parameters with expression based values and
which other child algorithms they depend upon.
2017-07-07 11:35:31 +10:00
Nyall Dawson
3f9cfe0ce7 Fix setting number parameters to expressions 2017-07-07 11:35:31 +10:00
Nyall Dawson
82ef7d2a89 Create specific expression context scope for child algorithms
Contains variables for model parameters, algorithm results for
other child algorithms which are not dependent on the
algorithm.

Allows removal of final pieces of ModelerAlgorithm code
2017-07-07 11:35:31 +10:00
Nyall Dawson
d8086e549d Use c++ method for available sources 2017-07-07 11:35:31 +10:00
Nyall Dawson
e0c7daa2d8 Rename QgsProcessingAlgorithm::clone to ::create
Since it better describes what the function does. It returns a new
pristine copy of the algorithm, not a clone of its current state
2017-07-07 09:27:35 +10:00
Nyall Dawson
6d7b0a3bbc Fix re-saving already saved models 2017-07-07 09:26:17 +10:00
Nyall Dawson
9156933c9e Add a pure virtual clone method for algorithms
This is required for safely executing the algorithm in a background
thread.
2017-07-07 09:26:17 +10:00
Nyall Dawson
37cc8fc5f1 Don't allow removal of model parameters on which other parameters
depend
2017-07-03 11:02:45 +10:00
Nyall Dawson
f9f98593e0 Draw links between dependent parameters in graphical modeler
Fix #12907
2017-07-03 10:27:03 +10:00
Nyall Dawson
f4d703bd38 Fix processing modeler joins are drawn doubled
OCD fix: joins are actually being drawn with two lines going
in both directions. This is totally 100% unacceptable, so
this commit fixes it so they are correctly drawn only with one line.
2017-07-03 10:25:40 +10:00
Nyall Dawson
77588b9b61 Convert model child algorithm parameter sources to a list
So that multiple input type parameters are correctly handled,
allowing models with child algorithms like merge to correctly
use any combination of static layers/model inputs/child outputs
as their input parameter
2017-06-30 12:50:38 +10:00
Nyall Dawson
11d35821c0 Fix setting number inputs to algorithms in modeler 2017-06-27 08:33:13 +10:00
Nyall Dawson
0a32add69e Port exporting model as python code to c++ 2017-06-27 08:33:13 +10:00
Nyall Dawson
178a415c9f Port parameter conversion to script code to c++ 2017-06-27 08:33:13 +10:00
Nyall Dawson
e2331c913c Fix error when deleting models 2017-06-24 13:49:19 +10:00
Nyall Dawson
5822ef9f46 Refresh model algorithms when providers are added
Since algorithms which models are dependent upon may now be
available, we need to rebuild them to ensure that they
will operate correctly.
2017-06-24 13:47:34 +10:00