This commit fixes a situation where loading a project results
in incorrect project & canvas CRS. The bug is trigerred whenever
something in the project load calls a processEvents() call, eg
restoring a project with layer count enabled on a layer
or with a composer html item.
When this occurs, the "auto-set CRS to first added layer" code
would kick in early and replace the project's CRS with that
of the first layer loaded.
To avoid this disable the "auto-set CRS" code when loading
layers from a project.
Adds a new geometry class for Triangle geometries
Methods include orthocenter, bisectors, medians, medial, circumscribed (center,
radius), inscribed (center, radius)
Also adds make_triangle expression function for creating triangles
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.
Not much there yet, but it adds an interface with stable API
which can be used by plugins and scripts to interact with
composer windows.
Could be expanded in future to add hooks for toolbars, menus,
etc, allowing plugins to extend composer functionality.