Nyall Dawson
2c91df4c12
Expand on docs
2017-07-07 10:14:51 +10:00
Nyall Dawson
70cc19687d
Add a method to take result layers (and ownership) from processing context
2017-07-07 09:28:20 +10:00
Nyall Dawson
3cbcd75d2f
Add equality operator for QgsProcessingFeatureSourceDefinition
2017-07-07 09:28:19 +10:00
Nyall Dawson
8a84e134cc
Algorithms don't have to be split to prepare/process/postProcess
...
Since it's safe to evaluate parameters in background threads
now, it's usually going to be ok to evaluate everything in
the processAlgorithm step.
This keeps the algorithm code as simple as possible, and will
make porting faster.
Note that the prepare/postProcess virtual methods still exist
and can be used when an algorithm MUST do setup/cleanup work
in the main thread.
2017-07-07 09:28:19 +10:00
Nyall Dawson
e1184cd69a
Make QgsProcessingAlgRunnerTask work correctly
...
It now safely can execute algorithms in background threads
without issues
2017-07-07 09:28:19 +10:00
Nyall Dawson
e5b156b86a
Make processing algorithms safe to run in threads
2017-07-07 09:28:19 +10:00
Nyall Dawson
5350483c90
Add method to take results from another processing context and
...
add to the current context
With appropriate note and tests to ensure that both the current
context and that which the results being taken from share the
same thread affinity
2017-07-07 09:28:19 +10:00
Nyall Dawson
d20c68d3f1
Add method to copy thread safe settings between processing contexts
2017-07-07 09:28:19 +10:00
Nyall Dawson
6c6f646291
Add methods to retrieve current thread affinity and push contexts
...
to another thread
With suitable assert in place to ensure that pushes are only
made when current thread == existing thread affinity
2017-07-07 09:27:35 +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
c2621b1275
Split algorithm execution into separate prepare/process/postProcess steps
...
The prepare and postProcess steps are designed to be run in main
thread only, while the process step can safely be run in a background
thread.
2017-07-07 09:26:17 +10:00
Nyall Dawson
0c6b19cd85
Improvements to QgsProcessingAlgRunnerTask
...
- take a clone of algs before running them. This avoids issues
if the algorithm is removed or edited while a background task
is running
- accept an optional existing feedback object
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
bdaba00a01
Fix incorrect layer names used when loading result layers from models
2017-07-03 17:08:52 +10:00
Nyall Dawson
921939e4ec
Add method to determine whether dependencies exist between model parameters
2017-07-03 10:50:35 +10:00
Nyall Dawson
6483984d0b
Add method to retrieve dependent parameters for a parameter
2017-07-03 10:45:15 +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
dbf21d1969
Reorder arguments in parameterAsSink to avoid requiring wkb type and crs
2017-06-27 08:33:13 +10:00
Nyall Dawson
60f80f9355
Mark QgsProcessingModelAlgorithm as non-stable API
...
We want to be able to extend this in future without any
stable API contract.
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
d16f117b6c
Port conversion to/from script 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
3fb1b4809d
Export QgsProcessingFeatureSource to Python
2017-06-26 12:44:26 +10:00
Nyall Dawson
5e7fbf44be
Make QgsAlgorithm::setProvider() public
...
Turns out there's valid use cases for calling this from outside
code.
2017-06-24 13:33:44 +10:00
Nyall Dawson
d667bf595f
Move iterator exception handling to c++
2017-06-24 08:15:06 +10:00
Nyall Dawson
a8b364e2e2
Port another member to c++
2017-06-24 07:36:46 +10:00
Nyall Dawson
10aeba2e72
Move more modelling code to c++
2017-06-24 07:36:13 +10:00
Nyall Dawson
e7f13f5bd8
Port model help code to c++
2017-06-24 07:36:07 +10:00
Nyall Dawson
24eb6fd780
Fix loss of output names in graphical modeler
2017-06-23 13:32:31 +10:00
Nyall Dawson
57f2c623ce
Move invalid geometry callback from Python to c++
2017-06-23 12:08:54 +10:00
Nyall Dawson
93b7c2809e
Report success or failure after running algs
...
And auto catch python exceptions and report failure of model
2017-06-23 12:08:54 +10:00
Nyall Dawson
a4f23fd1a4
Throw QgsProcessingException when a python exception occurs while running an alg
2017-06-23 12:08:54 +10:00
Nyall Dawson
76a9844949
Add folder output type
2017-06-22 18:21:33 +10:00
Nyall Dawson
f304828f59
Allow storing arbitrary metadata in parameter definitions
2017-06-22 18:18:51 +10:00
Nyall Dawson
1d69939dde
Fix build
2017-06-22 06:58:31 +10:00
Nyall Dawson
312c810787
Sipify
2017-06-22 06:49:43 +10:00
Nyall Dawson
86f33c682d
Expand model unit test coverage
2017-06-22 06:49:09 +10:00
Nyall Dawson
780f4331cc
Add method to generate temporary destination parameter value
2017-06-22 06:49:09 +10:00
Nyall Dawson
a87ca09e34
Move some temp file/folder utils to c++
2017-06-22 06:48:25 +10:00
Nyall Dawson
1df9f6b6f0
Start on executing models
2017-06-22 06:47:11 +10:00
Nyall Dawson
fe0f2498d4
Fix generation of destination parameters for models
2017-06-22 06:45:21 +10:00
Nyall Dawson
c685ec2b30
Add missing tests for vector input parameter, add vector out parameter
2017-06-21 22:13:36 +10:00
Nyall Dawson
0da3652257
Rename some parameter classes for consistency
2017-06-21 22:13:16 +10:00
Nyall Dawson
d3a2f7cd65
Models can now be saved and restored
2017-06-20 19:23:21 +10:00
Nyall Dawson
f21f502a18
Add methods to convert parameter definitions to/from variants
2017-06-20 18:33:46 +10:00
Nyall Dawson
9a2f14b931
First steps to model/save restore in c++
...
Models now save to QVariantMap, using QgsXmlUtils to save to
an xml based format (with extension .model3)
2017-06-20 17:26:57 +10:00
Nyall Dawson
179a377da0
Port more model to c++
2017-06-20 15:31:53 +10:00
Nyall Dawson
1a4a654f8b
Port more model API across to c++
2017-06-20 14:45:13 +10:00
Nyall Dawson
f6358b2118
Begin port of modeler algorithm to c++
2017-06-20 14:45:13 +10:00
Nyall Dawson
020537ac7e
Add string output type
2017-06-13 12:32:17 +10:00