1991 Commits

Author SHA1 Message Date
Nyall Dawson
ac51ae106c Add unit tests 2017-07-07 11:36:41 +10:00
Nyall Dawson
35e16b2f31 Add method for specifying variable description when adding to contexts
And use this description in expression builders when it's set.
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
17199c8ffd Reimplement getAvailableValuesOfType in QgsProcessingModelAlgorithm 2017-07-07 11:35:31 +10:00
Nyall Dawson
26cd6017b8 Use an expression context when evaluating child parameters with expression sources 2017-07-07 11:35:31 +10:00
Nyall Dawson
3243a1a34c Allow model child parameters to take values from an expression
The expression is evaluated just before the child algorithm is
executed, so can utilise results already calculated by other
children in the model through the use of expression context
functions
2017-07-07 11:34:17 +10:00
Nyall Dawson
240dd19f97 Update tests 2017-07-07 11:15:05 +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
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
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
cd7776ca1c Upgrade ported python algs to be thread ready 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
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
ddf5acebe7 Merge pull request #4807 from nyalldawson/layout_item_registry
Create a layout item registry for item types
2017-07-06 19:12:43 +10:00
rldhont
fe8522f811 [Geometry] Polygon::asGml: fix outer and add tests 2017-07-04 14:07:59 +02:00
Nyall Dawson
6307bc490d Merge pull request #4808 from nyalldawson/model_out_layer_names
Fix incorrect layer names used when loading result layers from models
2017-07-03 17:46:21 +10:00
Nyall Dawson
bdaba00a01 Fix incorrect layer names used when loading result layers from models 2017-07-03 17:08:52 +10:00
Harrissou Sant-anna
ab437cd4de Ok is spelled OK 2017-07-03 08:49:50 +02:00
Harrissou Sant-anna
59e9f79658 ok is spelled OK 2017-07-03 08:49:50 +02:00
Nyall Dawson
59d28a3525 Remove useless testqgslayoutitemregistry.cpp file 2017-07-03 14:01:37 +10:00
Nyall Dawson
c228132cbb Layout designers listen out for new item types in registry and
auto create actions for adding new items of the newly registered type

This avoids hard-coding in available item types into layout UI classes,
and allows designers to handle plugin-supplied item types
2017-07-03 13:57:42 +10:00
Nyall Dawson
97e8d9cf9e Emit signal when new layout item types are added to registry 2017-07-03 13:29:23 +10:00
Nyall Dawson
d23abf955a Add registration of item types to QgsLayoutItemRegistry 2017-07-03 13:22:15 +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
18b2b5240b Add some base classes for layouts 2017-06-30 17:01:52 +10:00
Nyall Dawson
cd979d8ab0 [layout] Create a page size registry for layout
Adds a new QgsPageSize class and QgsPageSizeRegistry registry
(attached to QgsApplication), which stores and manages known
page sizes
2017-06-30 16:23:18 +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
d2b9652d4b Fix use of direct map layers as inputs for source parameters 2017-06-29 08:00:47 +10:00
Nyall Dawson
9f5e33af72 Merge pull request #4767 from nyalldawson/layouts3
[layouts] Add layout measurement and size classes
2017-06-28 08:58:41 +10:00
Nyall Dawson
aeecda3707 Fix crash when no options are selected in a multiple-enum parameter 2017-06-27 21:27:59 +10:00
Nyall Dawson
7a6a6ff9f8 Fix test on Qt5.6 2017-06-27 08:46:58 +10:00
Nyall Dawson
46b4f2468c Allow storing multiple status in field script code 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
Ilya Zverev
7941759d23 Rectangle moving operators 2017-06-26 16:28:54 +02:00
Matthias Kuhn
e7f50524b8 Make QgsLineString Z and M values NaN if unspecified 2017-06-26 08:21:11 +02:00
Matthias Kuhn
8e7e573214 Prevent division by 0 and unrequired interpolation 2017-06-26 08:21:11 +02:00
Matthias Kuhn
317fead516 Add tests for QgsGeometryUtils::closestPoint() 2017-06-26 08:21:11 +02:00
Nyall Dawson
e7f13f5bd8 Port model help code to c++ 2017-06-24 07:36:07 +10:00
Nyall Dawson
6a54130f0b [layout] Add layout measurement and size classes
These classes are used for storing measurements for a layout
(QgsLayoutMeasurement), sizes for a layout (QgsLayoutSize)
and points in a layout (QgsLayoutPoint)

They support storing a measurement unit alongside a measurement
length/size. A new class QgsLayoutMeasurementConverter handles
conversion between different units, including converting to and
from pixels via a specified DPI property.
2017-06-23 18:00:17 +10:00
Nyall Dawson
24eb6fd780 Fix loss of output names in graphical modeler 2017-06-23 13:32:31 +10:00
Nyall Dawson
2906d1f1c9 Merge pull request #4763 from nyalldawson/algs3
Restore more processing algs
2017-06-23 12:08:15 +10:00
Martin Dobias
7cd517c6ba [FEATURE] Legend for markers with data-defined size
(Merge pull request #4752 from wonder-sk/legend-data-defined-size)
2017-06-22 15:29:10 +02:00
Martin Dobias
59ca985928 Use white bg color for test images to avoid black background 2017-06-22 12:56:02 +02:00
Nyall Dawson
d8c44cb643 Fix creation of feature sinks when using windows style paths 2017-06-22 18:22:43 +10:00