246 Commits

Author SHA1 Message Date
Nyall Dawson
29a59e70bf Add method to test whether model file name matches model name 2022-02-05 11:05:51 +10:00
Nyall Dawson
d5856ec400 Allow enum parameters to have icons specified for values for parameter metadata 2022-01-31 21:01:44 +10:00
Nyall Dawson
e0dfc46916 Fix typos 2021-12-17 08:29:31 +10:00
Nyall Dawson
53d08d73e6 Add method to convert parameters for a processing algorithm to a JSON
serializable map
2021-12-17 08:29:31 +10:00
Nyall Dawson
84cf46a629 Add method to copy QgsProcessingContext settings as a json map 2021-12-17 08:29:31 +10:00
Nyall Dawson
fe471eacce Add method to QgsProcessingAlgorithm to create equivalent qgis_process command 2021-12-17 08:29:31 +10:00
Nyall Dawson
6315133c8b Add method to convert parameter value to a list of strings 2021-12-17 08:29:31 +10:00
Nyall Dawson
4e71e45ae2 Add method to convert QgsProcessingContext settings to equivalent
qgis_process arguments
2021-12-17 08:29:31 +10:00
Nyall Dawson
ee3257b8e9 Add api to convert a processing parameter value to a string, if possible
Designed for use in converting an algorithm's parameters for
representation as a qgis_process command line
2021-12-17 08:29:31 +10:00
Nyall Dawson
e73d51d660 Add api to convert a processing parameter value to a value which
is compatible with storage in a JSON object
2021-12-17 08:29:31 +10:00
Nyall Dawson
dcf0cfe5a3 Fix API issues causing malformed python stub files
Fixes #46240
2021-11-29 11:54:06 +10:00
Alexander Bruy
88d7a62321 [processing] add point cloud output and point cloud destination parameter
to Processing. These are useful for 3rd party tools as outputs can be
automatically loaded on algorithm completion.

It is an API change not visible for users.
2021-11-26 15:37:27 +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
Antoine
68f003cb62 replace descriptionAsPythonString 2021-09-25 06:57:43 +10:00
Antoine
968db20b82 add \see and \since in comments 2021-09-25 06:57:43 +10:00
Antoine
968a5e8532 add method to get parameter description for python script 2021-09-25 06:57:43 +10:00
Nyall Dawson
45b886727b Improve docs 2021-09-11 07:59:51 +10:00
Nyall Dawson
c2c0f2574d [processing] Add parameter type for annotation layers 2021-09-11 07:59:51 +10:00
Alexander Bruy
63952c1a37 [processing] add support for point clouds to map layer and multiple
layer parameters
2021-08-05 18:41:33 +03:00
Alexander Bruy
f801cb6816 [processing] new pont cloud parameter for processing 2021-08-05 16:03:50 +03:00
Nyall Dawson
8f36cdfa44 [processing] Add API to allow a string parameter to show as a combobox
with preset choices in processing GUI

In some circumstances it is desirable to restrict the values available
when a user is asked to enter a string parameter to a list of predetermined
"valid" values, yet these values will vary installation by installation
(e.g. a "printer name" parameter, where you want users to pick from
printers installed on the system, but since the printer names will
vary install to install an enum parameter is not a valid choice)

This can now be done by setting the widget wrapper metadata
"value_hints" option, as demonstrated below. (While this provides a mechanism
for guiding users to select from valid string values when running a Processing
algorithm through the GUI, it does not place any limits on the string values
accepted via PyQGIS codes or when running the algorithm via other non-gui
means. Algorithms should gracefully handle other values accordingly.)

    param = QgsProcessingParameterString( 'PRINTER_NAME', 'Printer name')
    # show only printers which are available on the current system as options
    # for the string input.
    param.setMetadata( {'widget_wrapper':
      { 'value_hints': ['Inkjet printer', 'Laser printer'] }
    })
2021-08-01 05:33:51 +10:00
Alexander Bruy
7cb631e03c add support for plugin layers in QgsProcessingParameterMapLayer and
QgsProcessingParameterMultipleLayers (fix #44183)
2021-07-30 09:00:57 +10:00
nirvn
6b993f6b98 [FEATURE][processing] Brand new duration parameter 2021-07-27 13:46:09 +07:00
Even Rouault
da41d49c53 Add QgsProcessingAlgorithm::writeFeatureError() to help throw processing exception when addFeature() fails 2021-07-22 06:51:28 +10:00
Nyall Dawson
711a615be3 Fix raises sphinx format 2021-06-25 10:50:04 +10:00
Even Rouault
92fc43505d Update featureCount() methods to return long long for Win64 compatibility 2021-06-15 12:40:04 +10:00
Nyall Dawson
4ff3f447dc Don't try to insert links in raises blocks in PyQGIS docs
These aren't formatted correctly if we do
2021-06-10 11:03:43 +10:00
Damiano
810af987d3 Removed setting entries from the python api 2021-04-29 11:18:55 +02:00
Damiano
95dfe0f45c Removed settings struct 2021-04-26 15:07:21 +02:00
Damiano
00a7936389 Moved most core settings to SettingsEntry 2021-04-26 15:04:07 +02:00
Vincent Cloarec
63ec727003
fix API header references (#42795)
* fix API header reference

* fix SIP
2021-04-15 13:21:45 +02: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
David Marteau
9eb172aa8e Add multipart option for processing geometry parameter 2021-03-31 08:59:20 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Harrissou Sant-anna
6e20ee86ae
Use correct spelling for qgsProcessingException class
Fix typo
2021-03-16 04:49:35 +01:00
Nyall Dawson
c6370c7f52
Speed up QGIS compilation by removing all Qt Module-wide includes
Refs https://www.kdab.com/beware-of-qt-module-wide-includes/
2021-03-05 11:23:15 +10:00
Nyall Dawson
c8d61499ff [processing] Instead of a hidden parameter for verbose model logging,
add an explicit log level getter/setter to QgsProcessingContext which
algorithms can use to determine an appropriate level of feedback
to push to users.

Initially the verbose log only triggers the full verbose output
of model executions (which is also used when running models through
the model designer), but the intention is that more algorithms
will fine tune their output based on the logging level.

qgis_process also gains a new --verbose switch to enable verbose
log output.
2021-02-20 05:04:00 +10:00
Nyall Dawson
7dfef3a0b1 Newer doxygen versions don't auto convert the first line in a class'
documentation to a brief note, so we have to do it explicitly...
2021-02-19 08:15:29 +10:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00
Nyall Dawson
b740bf201a [processing] Fix exception when calling "Select from Files" in batch mode
on a file parameter

Fixes #40705
2021-01-05 08:32:10 +10:00
Nyall Dawson
a9c80e5740 Code shuffle
Move vector, project and network related core .cpp/.h files into
dedicated subdirectories.

An attempt to organise src/core better to make things easier to find.
2020-12-29 11:38:11 +10:00
nirvn
04b9c6ab00 [processing] Add a warning-level information message feedback 2020-12-07 14:15:35 +07:00
Nyall Dawson
83ccb6554e [processing] Add method to set an explicit override for the default
value of a parameter for the GUI only

This allows us freedom to change the default settings for an algorithm
shown when opening the algorithm in the toolbox/batch/model without
changing the underlying default value used for the parameter in the
raw API (which we can't do easily without potentially breaking 3rd
party scripts/plugins)
2020-11-24 13:11:37 +10:00
Alexander Bruy
cc98fe30d9 support static (non-translated) strings as enum values in Processing 2020-11-19 19:33:18 +02:00
Vincent Cloarec
d45790e05b
Other export mesh algorithms (#39783)
[processing] adds there new export mesh layer to vector layer algorithms :
- export faces
- export edges (1D mesh)
- export on grid
2020-11-04 06:57:30 +01:00
Vincent Cloarec
1fbba79a0f
Mesh export processes, first part : infrastructure and export vertices (#39664)
[processing] Infrastructure for QgsMeshLayer to add processing algorithms, dataset group paramater and dataset time parameter to allow the user to easily choose a dataset.
2020-11-03 06:05:28 +01:00
Alexander Bruy
ee241edb87 completely hide parameter type definition from SIP 2020-11-02 09:50:05 +02:00
Alexander Bruy
5a155f7c23 make QgsProcessingParameterDxfLayers public 2020-11-02 09:49:05 +02:00