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.
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%
This adds a mechanism where flushes of QgsSettings to the underlying
ini storage file can be temporarily suspended. It is intended for
code paths where many settings entries are consecutively read/written,
to avoid the very expensive cost of constructing and destructing
multiple QgsSettings objects for each in turn.
When QgsSettings::holdFlush() is called, then a temporary thread local
QgsSettings object will be created and ALL access to settings entries
will use this same object (preventing flushing of it to ini files).
An accompanying QgsSettings::releaseFlush() call MUST be made from
the same thread to destroy the thread local QgsSettings, flush it
to disk, and resume normal operation.
This helps avoid the VERY costly backward migration of settings,
and cuts the run time for qgis_process commands like `qgis_process list`
by at least half (and considerably more in common setups).
QCA and SSL certificate initialize can be costly -- so defer
startup of authentication framework until it is actually required.
This has no effect on QGIS desktop, as the news feed request
and other startup network requests will immediately trigger
an initialization of the framework. The use case here is improving
the core application startup time to benefit non-app based clients,
eg. qgis_process.
stored in a single place, and that we always use the default
value when its not overwise set
This has two benefits:
1. The user doesn't see confusing "0" values for radius/length etc,
which are silently treated as some other fixed value when rendering
2. The default values are correctly accounted for when calculating
the layer's AABB, otherwise we end up with a flat AABB by
default
This method will be used where multiple calls to `qgsDoubleNear(x1, y1, eps) &&
qgsDoubleNear(x2, y2, eps) && ... && qgsDoubleNear(xn, yn, eps)` are possible.