Cleanup QgsProjectionSelectionWidget to use proper models to
drive the combo box. This removes a bunch of very fragile
logic regarding showing and hiding entries on demand, as it
allows us to move all the filtering logic to a single place
in a QSortFilterProxyModel subclass.
This has a few side benefits:
- The combos now dynamically respond to changes like recent
CRS being used in other places in QGIS
- The widget correctly respects horizontal/vertical crs filters
for all entries, including recent crs
Sets whether changes to the active layer should be temporarily
blocked. Exposes a previously private optimisation for use
by plugins.
This is a low-level method, designed to avoid unnecessary work when adding lots
of layers at once. Clients which will be adding many layers may call blockActiveLayerChanges( TRUE ) upfront,
add all the layers, and then follow up with a call to blockActiveLayerChanges( FALSE ). This will defer emitting
the active layer changed signal until they've added all layers, and only emit the signal once for
the final layer added.
The comparisons among QGIS were conducted on coordinates using a fixed epsilon:
specifically, 1e-8 for QgsPoint and the default value for qgsDoubleNear: 4 *
DBL_EPSILON.
Initially, I've standardized its use to 1e-8 universally; it's already
significantly adequate for our Cartesian cases (1e-3 should suffice for many),
potentially fitting just right for geographical contexts.
Furthermore, in response to precision concerns, we're using the fuzzyEqual
and fuzzyDistanceEqual methods. These methods enable users/developers to
compare geometries more easily and with a given precision.
The API remains intact as operator==/equals() have been shifted into fuzzyEqual
(with an epsilon of 1e-8).
To consolidate the code between fuzzyEqual and fuzzyDistanceEqual, helper
functions, fuzzyHelpers, have been introduced following the logic of the
respective segments to be executed.
Adds a new material choice for a physically based metal/roughness
material. Options are available for setting the material base color,
metalness and roughness.
Internally this uses a clone of Qt's QMetalRoughMaterial class. We
use a copy of the Qt class instead of relying on Qt's implementation
as longer-term improvements (such as data defined base color) will
require a re-implementation anyway. By using our own material we
will avoid having two different code paths for the data-defined/
non-data defined scenarios.
As for the sqrDistance and Distance 2D functions, this adds functions for 3D.
To maintain the lowest level, the specific case where a Z could be NaN
is not handled.
It is left to the responsibility of other methods using these functions.
this has been done automatically with the following comand line
./scripts/3to4/3to4.py --only-qgis3-compatible-changes ./python/plugins/
./scripts/3to4/3to4.py --only-qgis3-compatible-changes ./tests/src/python/
The backward compatibility code is very expensive, as it triggers
a huge number of QSetting object creation and destruction.
We only need to perform this for settings which have changed,
so add API to flag changed settings and only perform backward
migration of changed settings.
This dramatically improves QgsApplication shutdown time (cuts
1.5 seconds off shutdown on a release build!!)
Populating the style library from the database can be a time
consuming process, especially if a user has many symbols
present in their library.
But for many standalone scripts, and for qgis_process, the
style database may not be required.
Let's defer initialization of it until it's actually required,
saving the startup cost in qgis_process and 3rd party scripts.
On my system with a style database containing ~700 items this
cuts down qgis_process startup times by around 25%