* API
Instead of having a single `load` function that exposes in its API
some elements only applicable to initializing a graph from a templates,
split it into 2 distinct functions: `load` and `initFromTemplate`.
Apply those changes to users of the API (UI, CLI), and simplify Graph
wrapper classes to better align with those concepts.
* Deserialization
Reduce the cognitive complexity of the deserizalization process
by splitting it into more atomic functions, while maintaining the
current behavior.
Add a property that contains the path of the image that is currently
displayed in the viewer. If no image is displayed, the property is set
with an empty string.
The path information is set directly from the Viewer2D when an image is
loaded to be displayed.
In Image Gallery :
- drop 1 .mg open the scene
- drop images either create new camera or augment the reconstruction
In Graph Editor :
- drop 1 .mg open the scene
- drop images create new camera at position of mouse
Prior to this commit, when a `CameraInit` node was added to or removed
from the list of `CameraInit` nodes, the active `CameraInit` was always
reset to the first one in the list, independently from its previous
value.
This commit changes that behaviour by only modifying the active
`CameraInit` if no `CameraInit` node has been assigned yet, or if the
active `CameraInit` does not exist anymore (meaning it has been removed).
This requires to emit the `cameraInitChanged` signal every single time
the list of existing `CameraInit` nodes is modified even if the active one
is not changed, and to connect it to the ImageGallery in order to ensure
the index from the combo box always corresponds to the currently active
`CameraInit` node. Indeed, when the list of CameraInits is updated, the
model for the combo box is reset, and it needs to be re-updated with the
correct non-default value.
When parsing the input JSON file, there might be some instances where
the `poses` key, unlike the `views` and `intrinsics` keys, does not exist.
If that is the case, an unhandled exception is raised while connections
are being made, which then causes issues for the lifetime of the Meshroom
instance.
This commit checks that the key exists before trying to access it, which
prevents raising unhandled exceptions while the active project is being
set up.