51 Commits

Author SHA1 Message Date
Nyall Dawson
ac84326464 [processing] Fix executing models 2017-05-01 17:29:40 +10:00
Matthias Kuhn
28a21209b9 [sipify] seealso 2017-04-30 16:52:05 +02:00
Nyall Dawson
ccb4ac98b4 Merge pull request #4417 from nyalldawson/processing_writer
Refactor processing writer to use QgsFeatureSink
2017-04-27 10:14:33 +10:00
Denis Rouzaud
4cc4a27068 [sipify] operators, remove argument
* skip some operators
 * allow to remove an argument with SIP_PYARGREMOVE
2017-04-26 15:06:16 +02:00
Nyall Dawson
fd2c18ee16 Refactor processing writer to use QgsFeatureSink, and to store
temporary output layers in the provided processing context

Should fix loss of intermediate memory layers when running
a multi-step model
2017-04-26 17:38:40 +10:00
Nyall Dawson
6b4ddb3b0d Add temporary layer store to processing context
This temporary layer store (a QgsProject) is used as a
store for layers that are added if a parameter that
is evaluated to a layer requires that a new, non-active-project
layer is loaded. It means that these layers will remain accessible
for the duration of the algorithm's execution (or models
execution if an algorithm is run as part of a model), before
being automatically discarded when the QgsProcessingContext
used to run the algorithm/model goes out of scope.

This approach has several benefits:
- it means that algorithms (including c++ algorithms) are able
to use both project and non-project layers without needing
to handle any memory management themselves.
- it means that layers are guaranteed to last for the duration
of a model execution. This is currently an issue where models
which use memory layers as intermediate outputs do not
function correctly as the memory layers are destroyed before
the model has finished executing
- there should be no leakage of layers remaining open
after an algorithm exits
2017-04-26 14:06:59 +10:00
Nyall Dawson
f247a7cda3 Add c++ optimised uniqueValues method which respects processing context
Remove processing vector.uniqueValues/vector.getUniqueValues
and port usage to c++ method

Should be much faster than the python method, as the c++ method takes
advantage of handing off the unique values calculation to the
provider source whenever possible
2017-04-26 12:53:35 +10:00
Nyall Dawson
a28bc086eb Indentation/sipify 2017-04-26 12:53:35 +10:00
Nyall Dawson
b067bd786a Rename UseSelection -> UseSelectionIfPresent, clarify docs 2017-04-26 12:53:35 +10:00
Nyall Dawson
1c6f165ff5 Add missing doc 2017-04-26 12:53:35 +10:00
Nyall Dawson
e6a33e876c Allow setting the invalid geometry callback in processing context 2017-04-26 12:53:35 +10:00
Nyall Dawson
b32b39501e Add methods for getting vector iterators to QgsProcessingUtils 2017-04-26 12:53:35 +10:00
Nyall Dawson
f3cfb8b759 Add invalid geometry handling method to processing context 2017-04-26 12:53:35 +10:00
Nyall Dawson
06a20b935d Add UseSelection flag to QgsProcessingContext
Indicates whether only selected features should be used in
algorithms
2017-04-26 12:53:35 +10:00
Nyall Dawson
241d283bb8 Create a context object for processing algorithm execution 2017-04-26 12:53:35 +10:00
Denis Rouzaud
c1832854a2 sipify batch
* QgsDial
* QgsDialog
* QgsDockWidget
* QgsEncodingFileDialog
* QgsErrorDialog
2017-04-25 13:46:56 +02:00
Denis Rouzaud
1bfa539df1 [sipify] remove extra blank line 2017-04-24 07:39:30 +02:00
Denis Rouzaud
8f2a5c7c00 sipify all 2017-04-20 14:21:36 +02:00
Denis Rouzaud
51aa44de5f [sipify] fix enum combination 2017-04-19 15:03:31 +02:00
Nyall Dawson
eff5a823c9 [sipify] Convert "\a arg" to "`arg`" when processing Docstrings
Allows argument names to be highlighted in Python docs
2017-04-17 13:49:59 +10:00
Nyall Dawson
bfd37e1122 [sipify] Add return types for functions in docstrings
and change \return -> :return: in docystrings
2017-04-08 09:48:48 +10:00
Matthias Kuhn
58d2d6d7f9 sipify_all 2017-04-07 12:26:30 +02:00
Nyall Dawson
69c31a2d71 Always return const algorithms, since algorithms should not be modified 2017-04-07 13:28:42 +10:00
Nyall Dawson
1aa7ca3452 Update sip 2017-04-07 13:21:28 +10:00
Nyall Dawson
117260dcf3 Remove activation control from AlgorithmProvider
Split between QgsProcessingProvider and subclasses
2017-04-07 13:21:28 +10:00
Nyall Dawson
fb1cf1e185 Remove processing algList
All functionality has been moved to QgsProcessingRegistry
2017-04-07 13:21:28 +10:00
Nyall Dawson
4970bb4cd5 Move more algList functionality to QgsProcessingRegistry 2017-04-07 13:21:28 +10:00
Nyall Dawson
2a1a71574a Move algorithm id (previously commandLineName) to QgsProcessingAlgorithm 2017-04-07 13:21:28 +10:00
Nyall Dawson
950ed680bd Don't try to deepcopy QgsProcessingAlgorithm class 2017-04-07 13:21:28 +10:00
Nyall Dawson
b3142a0baf Move provider algorithm handling to QgsProcessingProvider 2017-04-07 13:21:28 +10:00
Nyall Dawson
377b181c4e Port more processing dataobjects methods to c++
Also
- simplify and add tests
- remove large memory leak (persistant store of all non-project layers)
- remove broken support for direct loading postgres/virtual layers
by string (Python version was very broken and would never match
a postgres/virtual layer)
2017-04-05 19:50:46 +10:00
Nyall Dawson
8ffdb362cc Port some processing dataobjects routines to c++ 2017-04-05 15:27:17 +10:00
Nyall Dawson
4eeacb8fdf [sipify] Replace :: with . during doxygen->docstring conversion
e.g.

You can use QgsXmlUtils::writeVariant to save it to an XML document
->
You can use QgsXmlUtils.writeVariant to load it from an XML document
2017-04-05 10:32:27 +10:00
Nyall Dawson
d2a242aa95 Move format handling flags to QgsAlgorithmProvider 2017-04-04 08:15:54 +10:00
Nyall Dawson
e40389a41c Sipify QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Nyall Dawson
e506ceb1f8 Move flags (hide from toolbox, etc) to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Nyall Dawson
6987d7b37c Port handling of algorithm names to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Nyall Dawson
dc729c1b5a Move algorithm group handling to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Nyall Dawson
faa8a653b2 Move algorithm icon handling to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Nyall Dawson
28e75731e1 Move tag handling to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Nyall Dawson
52cc002990 Simple c++ base class for processing algorithms 2017-04-03 21:17:45 +10:00
Nyall Dawson
9b3539ab07 Update sip files 2017-04-03 13:18:36 +10:00
Matthias Kuhn
a609883cc0 Add %Feature support to sipify 2017-04-02 23:37:17 +02:00
Nyall Dawson
d3daf60020 Convert doxygen notes and version added to sphinx style in sipify 2017-04-02 20:52:50 +10:00
Nyall Dawson
28a57c8f95 Remove ingroup and class from doxygen when creating sip docstrings 2017-04-02 20:30:22 +10:00
Nyall Dawson
f831a3c1a2 Remove processing sip bindings from sip blacklist 2017-04-02 17:13:07 +10:00
Nyall Dawson
99f186a7d2 Clean up progress handling in QgsProcessingFeedback 2017-03-29 09:02:30 +10:00
Nyall Dawson
ede452be85 [processing] Port feedback object to c++
Algorithms are now passed a QgsProcessingFeedback object
instead of the loosely defined progress parameter.
2017-01-11 11:11:10 +10:00
Nyall Dawson
bf484dafa8 [processing] Allow providers to return path to SVG icon 2017-01-11 10:55:16 +10:00
Nyall Dawson
dca697b427 [processing] New c++ QgsProcessingRegistry class
Intended as a registry for the various processing components,
including providers, algorithms and various parameters and outputs.

Currently handles only registration of providers, as a step toward
removing processing's algList (this requires first porting
the algorithm class to c++)

A QgsProcessingRegistry instance is attached to QgsApplication,
and is retrieved by QgsApplication::processingRegistry()
2017-01-11 10:55:15 +10:00