Move all scalebar rendering code out of composer and ensure that
all scalebar rendering is done independant of QgsComposerScaleBar
This allows scalebar rendering code to be reused by plugins
and by non-composer code.
Also rename QgsScaleBarStyle -> QgsScaleBarRenderer, (and all
subclasses too). This name better reflects what these classes do.
Also cleanup API for addFeature(s) in QgsVectorLayer, by removing
the unused extra argument from addFeature() and be removing the
makeSelected argument from addFeatures() (code should be adapted
to manually select added features after adding if desired - this
was only used in a single place in the QGIS code and I suspect
this was unintentional in any case)
Another bit to make core library independent from QgsProject::instance().
Until now labeling engine configuration was taken from project singleton.
Removed legacy methods from QgsPalLabeling - the class now does not have
any more member variables/methods, it is just a bunch of helper functions.
(PR #4384)
- setEllipsoidalMode() was removed. Ellipsoidal calculations are
now enabled whenever a valid ellipsoid() has been set. Set the
ellipsoid to 'NONE' to disable ellipsoidal calculations.
- ellipsoidalEnabled() was removed. Ellipsoidal calculations
are now enabled whenever a valid ellipsoid() is set. Check
willUseEllipsoid() to determine whether ellipsoidal
calculations will be performed.
- sourceCrs() and setSourceCrs() now always take and return
QgsCoordinateReferenceSystem objects. All string/ID based CRS
methods were removed.
- geographic() was removed. This was only used internally
in one place, so was replaced with sourceCrs().isGeographic() instead.
- some largely overlapping measurement functions were consolidated
Instead of progress changed signals on the provider/layer level,
instead use QgsFeedback arguments for methods which previously
emitted progress changed signals
Previously the renderer required that pixel values followed
sequential numerical order. This refactor allows values to
be skipped, so that only certain color index will be rendered.
Instead of creating them for all items when composer window
is opened, instead just create and destroy them when
required. None are too heavy to have a noticable delay
when selecting items, but in contrast keeping them around
forever is wasteful on memory.
Also clean up a lot of duplicate composer/composition
code and remove unnecessary signals from api (use a single
itemAdded signal instead of multiple signals for every
item type)
Since composer windows are now only created on demand, and
destroyed when the window is closed, the old interface methods
no longer apply. The new interface methods openComposers(),
openComposer(), closeComposer(), composerOpened(),
composerWillBeClosed() and composerClosed() are similar, but
only apply to composer windows when they are exist (i.e.
are currently open).
To access all compositions from a project, the project's
layoutManager() should be used instead.
Additionally, the new interface methods work with
QgsComposerInterface objects instead of QgsComposerView
objects. This should allow future hooks for plugins to interact
with open composer windows in a more useful way.
This enum value has not been in use since filter rects were
separated from other filter types. Leaving it in API is confusing
and leads to incorrect use.
In a post-OTF-disabled world these are no longer required. The
map units are dictated by the map units for the destination
CRS.
It's dangerous to separate these two properties as setting
the incorrect map units for a given CRS will result in
incorrect scale calculations.
Because
- OTF reprojection is mature and stable
- Should be no cost when not required - transforms are shortcut
when not required
- Reduces code complexity
- Canvas OTF support was being incorrectly used as a flag for
whether measurements should be made in ellipsoidal mode. Instead
the project's ellipsoid setting should be checked for this.
- Should simplify behavior for new users
This change is being driven by:
- need for consistent terminology in the api. Currently there's
a confusing mix of border/outline used
- need for consistent terminology in the gui - we have a mix
of "border"/"outline"/"pen"
- bringing QGIS into line with the standard terminology used
in other graphic editing programs
A new class QgsPathResolver is introduced for conversion between absolute
and relative paths when reading/writing XML.
Cleaned up code in layer definition file support (.qlr) to better handle
relative/absolute path conversion.