1991 Commits

Author SHA1 Message Date
Nyall Dawson
e444f00cc5 Fix calculation of layout bounds considers page shadow 2017-07-25 12:54:58 +10:00
Nyall Dawson
fabfd77c2b Show known page size when opening page properties if current page size matches 2017-07-25 12:54:58 +10:00
Nyall Dawson
39bf23a5d5 Start on reflow support for page collections (needs tests) 2017-07-25 12:54:57 +10:00
Nyall Dawson
ea32391280 Add methods for handling page size to QgsLayoutItemPage 2017-07-25 12:54:57 +10:00
Nyall Dawson
3cf06db467 Port item id and uuid code 2017-07-25 12:54:57 +10:00
Nyall Dawson
a515e953b8 Add support for reading/writing item properties to XML 2017-07-25 12:54:57 +10:00
Nyall Dawson
09dd6db97b Add API to save/restore QgsLayoutObject properties to XML 2017-07-25 12:54:57 +10:00
Nyall Dawson
e304662a4f Use standard QgsUnitTypes::RenderUnit throughout labeling
Instead of duplicate labeling specific unit enum, reuse
the QgsUnitTypes::RenderUnit enum in labeling.

This brings several improvements, including:
- label offset/distance/repeat units now works correctly
in all available unit types (inc pixels, map unit meters,
points, inches, etc)
- less duplicate code
- labeling can use the robust QgsRenderContext methods for
converting between different units and painter coordinates

Also change comments for members to doxygen comments, so
that these get included in the API docs.
2017-07-24 11:18:30 +10:00
Nyall Dawson
faa4a09ed0 Merge pull request #4877 from nyalldawson/layout_next
Layouts, chapter II
2017-07-24 08:42:51 +10:00
Juergen E. Fischer
4f9a9e0360 s/( )/()/; s/== /== /; s/!= /!= /; 2017-07-19 09:19:37 +02:00
Nyall Dawson
54bf013004 Update tests 2017-07-18 13:42:04 +10:00
Nyall Dawson
19a7863ea4 Add methods to construct layout size/point from QSizeF/QPointF 2017-07-18 12:42:06 +10:00
Nyall Dawson
56bb65709d Change QgsLayoutItem::draw to use a renderContext instead of
direct QPainter argument

This will make use of other rendering code within layout items
much easier - since symbology/text renderer/diagrams/etc all
require QgsRenderContexts for use, it makes sense for
layout item rendering to also use this approach.

This also avoids lots of duplicate code which was scattered
throughout different composer item types to manually handle
creation of QgsRenderContexts when required.
2017-07-18 12:42:06 +10:00
Nyall Dawson
c282024748 Partially port some layout utils for render context creation 2017-07-18 12:42:06 +10:00
Nyall Dawson
00405fd6b5 Start porting item rotation 2017-07-18 12:42:06 +10:00
Nyall Dawson
c3456133dc Add QgsLayoutUtils 2017-07-18 12:42:06 +10:00
Nyall Dawson
6fd06983a6 Port data defined item position and size 2017-07-18 12:42:06 +10:00
Nyall Dawson
3f0a0cb063 Ensure that moving/resizing items respects reference point 2017-07-18 12:42:06 +10:00
Nyall Dawson
d0c844ed67 Implement item size and positioning using layout units 2017-07-18 12:42:06 +10:00
Nyall Dawson
498c4cda16 Add some rendering checks for layout items 2017-07-18 12:42:06 +10:00
Nyall Dawson
dd370373be Port a bunch of low-level methods to layouts
Relating to expression contexts and variables
2017-07-18 12:42:06 +10:00
Nyall Dawson
15b65fa6d4 Port some basic functionality from QgsComposerObject 2017-07-18 12:42:06 +10:00
Nyall Dawson
a6156d9221 Layouts have a name 2017-07-18 12:42:05 +10:00
Nyall Dawson
ab79b1560c [layout] Add measurement unit handling to QgsLayout
Allows layouts to convert from various units to their
own native units

Also added a QgsLayoutContext to QgsLayout.
2017-07-18 12:42:05 +10:00
Nyall Dawson
cd380f616c Add measurement converter and dpi to layout context 2017-07-18 12:42:05 +10:00
Nyall Dawson
b2b35dd084 Add a context class for layouts
Stores information relating to the current context (such as
associated feature and layer) and rendering settings for a layout.
2017-07-18 12:42:05 +10:00
Nyall Dawson
b24370dca3 Fix use after delete error (thanks to Coverity) 2017-07-17 12:59:09 +10:00
Nyall Dawson
3a2710efe5 Merge pull request #4870 from nyalldawson/algs3
Port 4 more algs to new API
2017-07-17 07:51:47 +10:00
Nyall Dawson
38a13ff5af Make pole of inaccessibility calculation handle multipolygons 2017-07-17 07:24:33 +10:00
Nyall Dawson
1342f4d9ac Add API to set optional destination parameters as not created by default
This allows optional outputs (such as null geometry features detected
by the Remove Null Geometries algorithm) to be skipped by default
when desirable.
2017-07-16 18:19:24 +10:00
Nyall Dawson
f84a3bbd04 Merge pull request #4819 from nyalldawson/layout_gui
Layout GUI work (pt 1/?)
2017-07-14 10:22:38 +10:00
Nyall Dawson
773b2e7f9e Port grass followup to area calculation fix
https://trac.osgeo.org/grass/changeset/71259

refs discussion at

https://trac.osgeo.org/grass/ticket/3369
2017-07-13 07:41:42 +10:00
Nyall Dawson
058271b0c1 Auto create corresponding outputs when adding destination style
parameters to an algorithm

QgsProcessingAlgorithm::addParameter() has a new createOuput
argument (true by default).

If the createOutput argument is true, then a corresponding
output definition will also be created (and added to the
algorithm) where appropriate. E.g. when adding a
QgsProcessingParameterVectorDestination and createOutput is
true, then a QgsProcessingOutputVectorLayer output will be
created and added to the algorithm. There is no need to call
addOutput() to manually add a corresponding output for this
vector. If createOutput is false then this automatic output
creation will not occur.

This should simplify declaration of outputs for algorithms
as it avoids the need to manually declare these corresponding
outputs.
2017-07-12 07:18:53 +10:00
Nyall Dawson
cf488d34a4 Split layout item registry into two separate registries
Instead of relying on forward declared c++ classes from
gui in QgsLayoutItemRegistry, instead create a
QgsLayoutItemGuiRegistry which handles registration
of all the GUI specific behavior relating to layout items.

Remove all GUI related code from QgsLayoutItemRegistry.

This creates a cleaner split between core/gui code, and
given that there'll be a lot of gui specific behavior
which needs to be handled by a registry it makes sense
to keep this isolated in gui.

It also plays nicer with the sip bindings, which can't
handle forward declared gui classes in core.
2017-07-11 11:06:36 +10:00
Nyall Dawson
179c51c953 Don't auto populate QgsLayoutItemRegistry
Initially create an empty registry, allow it to be populated
at a later stage.
2017-07-11 11:06:36 +10:00
Nyall Dawson
726936eee2 Merge pull request #4831 from nyalldawson/processing_alg_config2
Minor refactoring to processing algorithms, future proofing some API
2017-07-11 10:59:08 +10:00
Nyall Dawson
326d6f5fc7 Allow child algorithm configuration to be stored and handled by models 2017-07-10 17:02:23 +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
03275bbace Split QgsProcessingAlgorithm::create into non virtual-create
and pure virtual createInstance

Allows us to add logic which always need applying within
create(), leaving createInstance() free to just return a
raw new instance of the class
2017-07-10 10:07:32 +10:00
Nyall Dawson
d85039363a Fix incorrect area calculation in corner cases (fix #16820)
In certain circumstances very proximal nodes could cause instability
in the ellipsoidal area calculation.

Port (slightly tweaked) fix from grass changeset 71167 for same issue,
and add a unit test
2017-07-10 09:31:16 +10:00
Nyall Dawson
cd6e7d78cf Add method to processing registry to create a new instance of an algorithm directly 2017-07-09 17:14:45 +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
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
f82b41e001 Move an enum to new QgsProcessing class 2017-07-08 20:49:17 +10:00
Nyall Dawson
febf0a0e6e Rename method to more generic name - it's usable by vector layer outputs too 2017-07-08 20:49:17 +10:00
Nyall Dawson
9e184feaed Add method to evaluate parameters to compatible vector layers
of a specified type
2017-07-08 20:49:17 +10:00
Matthias Kuhn
ada9ce4dcf Merge pull request #4825
Various new expression functions and possibilities
2017-07-08 10:18:10 +02:00
rldhont
aa24896ce1 Fix GML2 after GML3 improvements 2017-07-07 13:01:31 +02:00
Matthias Kuhn
72da246b8b Add tests 2017-07-07 13:01:17 +02:00
Nyall Dawson
515ba24230 Update tests 2017-07-07 11:58:15 +10:00