Commit graph

97 commits

Author SHA1 Message Date
Candice Bentéjac
66ffe017a4 [ui] Rename "Clear Images" actions into "Remove All Images"
Update the names of the commands that remove images in the "File"
menu to match with those in the Image Gallery menu.

"Clear Images" becomes "Remove All Images" and "Clear All Images" becomes
"Remove Images From All CameraInit Nodes".
2023-10-11 18:07:18 +02:00
Candice Bentéjac
d2dc78dd5a [ui] ImageGallery: Add "Remove All Images" menu to clear all images
In addition to the existing "Remove" menu action in the Image Gallery that
deletes the currently selected image, add a "Remove All Images" menu
action that performs the same action as "Clear Images" from the "File"
menu.

The "Del" key was used as a shortcut to remove the currently selected
image when the Image Gallery has the focus, "Shift+Del" can now also be
used to remove all the images at once.
2023-10-09 18:54:06 +02:00
Candice Bentéjac
f570b37b09 [ui] ImageGallery: Disable "Visualize HDR" button after clearing images
When all the images in the gallery are cleared using the "Clear Images" or
"Clear All Images" menu action while the "Visualize HDR images" option is
turned on, the gallery is correctly emptied and the viewer correctly reset
but the button remains turned on even though there is nothing left to show.

As it is turned on (although with a "0" count), the gallery remains in
read-only mode and no more image can be dropped until the button is
manually clicked to be turned off. Even after that, it remains clickable
instead of being disabled.

This commit ensures that the button gets disabled if the number of
viewpoints is 0 (meaning the gallery is empty). That way, the button
correctly reflects the current situation, and the gallery is ready to have
images dropped.
2023-09-04 19:00:05 +02:00
Candice Bentéjac
8c494198e0 [qml] Qt5.15: Update syntax for slots
Slots now need to be written as function; the previous syntax is
deprecated.
2023-07-03 12:11:33 +02:00
Candice Bentéjac
62ba08447d [qml] Qt5.15: Upgrade all remaining modules
The upgrade concerns the following modules:
- QtCharts
- QtPositioning
- QtLocation
- QtGraphicalEffects
- QtQml
2023-07-03 12:11:32 +02:00
Candice Bentéjac
9b5dd40b02 [qml] Qt5.15: Upgrade all QtQuick modules 2023-07-03 12:11:29 +02:00
Loïc Vital
e81e3371cc [ui] ImageGallery: use CameraInit label instead of name 2023-06-09 17:24:33 +02:00
Candice Bentéjac
30c3e08f48 [ui] ImageGallery: Display the name of the active CameraInit group
Add the name of the currently active `CameraInit` group in the Image
Gallery, as well as the name of the previous / next group in the tooltip
of the buttons to switch between groups.
2023-06-09 17:06:53 +02:00
Candice Bentéjac
e8990a6fc7 [ui] ImageGallery: Reset viewpoints and intrinsics when removing the last image
When the last image from the active group has been manually removed from
the Image Gallery (meaning it has been removed either with the "Del" key
or the "Remove" option), the list of viewpoints and intrinsics should
both be reset, like they are when "Clear Images" is used.

Prior to this commit, the list of viewpoints was emptied (but not reset)
and the list of intrinsics remained untouched. Removing all the images
manually did not affect the list of intrinsics, which could cause issues
later on.
2023-05-30 12:20:54 +02:00
Candice Bentéjac
7488ee2f7e [ui] ImageGallery: Allow image drop if the active group is not computing
The Image Gallery should only switch to read-only if the currently active
group is being computed. The behaviour prior to this commit was to lock it
as soon as any node in the entire graph was being computed, even if it did
not involve the active CameraInit node.
2023-03-21 12:47:46 +01:00
Candice Bentéjac
21500bec96 [ui] ImageGallery: Fix QML syntax warnings 2023-03-15 10:55:26 +01:00
Candice Bentéjac
2e31ecaea7 [ui] ImageGallery: Harmonize functions and indentation 2023-03-15 10:36:16 +01:00
Candice Bentéjac
59be396244 [ui] Prevent editing the intrinsics of temporary CameraInit nodes
As the temporary CameraInit nodes are not really part of the graph, their
attributes cannot be edited. By default, the intrinsics can be edited for
any CameraInit node from the intrinsics table.

For temporary CameraInit nodes, we want the intrinsics to be displayed in
read-only mode to ensure that the user cannot attempt to edit them, which
would cause errors.

Upon its creation, the temporary CameraInit node is locked (as if it were
computed), and the intrinsics table's component are updated to be displayed
as read-only if the CameraInit node is locked.
2023-03-15 10:00:19 +01:00
Candice Bentéjac
ac592f4cb2 [ui] ImageGallery: Re-parse intrinsics as soon as they are updated
When setting a temporary CameraInit node, the intrinsics of the actual
CameraInit node are used, meaning that the temporary CameraInit has all
the intrinsics information we need to fill the intrinsics table.

However, when a temporary CameraInit node is set, the parsing of the
intrinsics and the model update are not performed. If the active CameraInit
group does not change, this is not directly visible as the table keeps on
displaying the intrinsics from the actual CameraInit node.

If the active group changes, we attempt to fill the table with the
intrinsics of the temporary CameraInit node, which is being re-set for the
active group. The intrinsics are thus not available, leading to an empty
table, and the parsing is never retriggered once the temporary CameraInit
has been fully set.

Instead of re-parsing the intrinsics when the CameraInitIndex is updated,
the parsing is triggered when the intrinsics are updated, since this
ensures they will be available and its covers all the cases we could
be facing.
2023-03-15 10:00:08 +01:00
Candice Bentéjac
3e8e568bba [ui] ImageGallery: Update columns' width for the intrinsics table 2023-03-14 18:36:05 +01:00
Candice Bentéjac
5e61a1da5a [ui] ImageGallery: Force index to -1 before setting it if there's a tempCameraInit
When there is a temporary CameraInit, it means that either the "Visualize
HDR images" or "Preprocessed images" options are enabled.

If several CameraInit groups are available, and if the currently selected
image in the GridView is the first one (index = 0), there is a possibility,
depending on the input images, that the first images in two different
groups are not identical but have the same view ID. If that happens, there
will be no update of the Viewer2D, as the selectedViewId property will not
have been modified.

By setting the selectedViewId property to -1 when there is a temporary
CameraInit and the current index in the GridView is 0, we trigger an
update of the viewer even when there is no apparent change in the view ID.
2023-03-13 15:57:24 +01:00
Fabien Castan
69d45fde1b
Merge pull request #1898 from alicevision/fix/intrinsicsWarnings
[ui] Intrinsics: Fix warnings and exceptions
2023-02-16 19:17:31 +01:00
Candice Bentéjac
8e00a5be8c [ImageGallery] Match the filter selection with the gallery's display
Selecting any filter in the Image Gallery changes the displayed content of
the gallery according to the filter. Unselecting any filter automatically
switches the displayed content back to the "input images" filter (which
simply displays all the input images), but the "input images" button is
never reselected, meaning that there can be a display corresponding to a
filter without any filter being selected.

This commit prevents unselecting a filter without reselecting the one
corresponding to the display. Since the "input images" is always the
display that is reverted to, unselecting any filter automatically selects
its button.
2023-02-15 18:20:20 +01:00
Candice Bentéjac
7bdd7cf9d6 [ImageGallery] Initialize and use "attribute" properly for the intrinsics table
This commit fixes an "Unable to assign QJSValue to QObject*".

In IntrinsicDisplayDelegate, initialize the "attribute" variant to null
and set it as a parameter during the instantiation in ImageGallery.
All references to "model.display" in IntrinsicDisplayDelegate have been
replaced with a correct use of "attribute".
2023-02-15 17:32:22 +01:00
Fabien Castan
334bfc8b00
Merge pull request #1861 from alicevision/mug/thumbnailCache
[ui] Thumbnail cache
2023-02-09 11:08:09 +00:00
Fabien Castan
40b182efc5
Merge pull request #1864 from alicevision/dev/saveImportImagesFolder
[ui] Use the location of the most recently imported images as the base folder for the "Import Images" dialog
2023-01-22 18:07:56 +00:00
mugulmd
dd235dcbf1 [ui] clear thumbnail requests when changing viewpoints 2023-01-17 07:11:32 -08:00
mugulmd
0926b20d43 [ui] fallback for dispatching thumbnails in case cellID changed 2023-01-17 02:42:35 -08:00
mugulmd
80174e22af [ui] ImageGallery: faster thumbnail dispatch using caller ID 2023-01-16 06:21:48 -08:00
Candice Bentéjac
5638cf3a75 [ui] "Import Images" dialog: Use opened project's images folder as the base folder
If a project has already been opened before the "Import Images" dialog
is opened for the first time, and if the opened project has imported
images, use the location of these images' folder as the base folder for
the "Import Images" dialog.

If the opened project has no imported images, the base folder will remain
identical to the other dialogs' until images are imported.
2023-01-16 15:10:27 +01:00
mugulmd
cd955893e3 [ui] ImageGallery: default value for grid view cache buffer 2023-01-10 02:06:00 -08:00
mugulmd
af2c9c0fd3 [ui] dispatch thumbnail creation signal from grid 2023-01-09 06:21:10 -08:00
Candice Bentéjac
04bd976387 [ui] ImageGallery: fix the DB path in the "Edit Sensor Database" dialog
The output of "cameraInit.attribute("sensorDatabase").value" is the
unresolved ${ALICEVISION_SENSOR_DB} environment variable.

To get the path, the variable needs to be evaluated.
2023-01-05 09:41:47 +01:00
Candice Bentéjac
45bdeba343 [ui] Increase the "cacheBuffer" value of ImageGallery's GridView
The "cacheBuffer" property determines whether delegates are retained
outside the visible area of view. In the case of the ImageGallery,
it determines whether the images that are not currently visible in
the GridView (because we need to scroll up or down to be able to see
them) will remain in the cache or not. The default value is platform-
dependent (320 for Windows) and currently causes any image that is not
directly visible to be lost, even if it was previously loaded when it
appeared in the view: if we scroll up or down, we will necessarily need
to wait for the images to be loaded again.

10000 is an arbitrary value that seems to work correctly for most cases.
2022-12-22 16:09:52 +01:00
Candice Bentéjac
02383c68b3 [ui] Check that objects accessed by QML properties are not null before accessing them
Some QML properties access exposed Python objects that may or may not
be null upon their access. When these objects are accessed while null,
QML issues "TypeError" warnings. These warnings have no functional
impact as QML correctly handles trying to access null objects, but can
spam the logs.

This commit aims at fixing all these warnings by checking that the
Python objects are not null before being accessed.
2022-12-06 11:04:50 +01:00
Loïc Vital
0429accd79 [ui] filter with viewIds only when displaying view ids 2022-11-18 10:35:17 +01:00
Loïc Vital
b829a2d9f4 [ui] tab to focus search bar + click on empty area to loose focus 2022-11-18 10:03:03 +01:00
Loïc Vital
e24310d1a1 [ui] more flexible filtering mechanism + filter with viewIds 2022-11-18 10:03:03 +01:00
Loïc Vital
047b6fb589 [ui] ImageGallery: search bar to filter with filename 2022-11-18 10:03:03 +01:00
Candice Bentéjac
a531caf6fd [ui] ImageGallery: update the Viewer2D correctly when the GridView's item changes
This commit ensures that any change in the ImageGallery's GridView
selection is correctly reflected in the Viewer2D. In particular:
- When a new project file is opened, the first image in the gallery
is now displayed in the 2D viewer, after a correct auto-fit has been
applied
- When an image in the gallery is removed, the adjacent image that
becomes selected is automatically displayed in the 2D viewer
2022-11-17 12:22:51 +01:00
Loïc Vital
91cc786e14 [ui] coherent naming "Image Gallery" across app 2022-10-19 09:50:20 +01:00
Loïc Vital
4e19cf44b9 [ui] update selected view from grid when using keys 2022-10-19 09:50:10 +01:00
Candice Bentéjac
0fb487b098 [ui] ImageGallery: prevent intrinsics table from overlapping with the "Group" label 2022-09-05 09:33:30 +02:00
Candice Bentéjac
e395bc08e5 [ui] ImageGallery: start group index at 1 instead of 0
The first group will not be displayed as "Group 0 / X" anymore,
but rather as "Group 1 / X".
2022-09-02 19:14:15 +02:00
Candice Bentéjac
93a3ad8f16 [ui] Update intrinsics table when switching between groups 2022-08-08 11:58:12 +02:00
Fabien Castan
5829206ba8 [ui] ImageGallery: fix missing function changeCurrentIndex 2022-04-26 17:08:08 +02:00
fabien servant
655dad9959 [camerainit] update parameters to use focal in mm 2022-03-25 11:07:52 +01:00
Fabien Castan
5301104661 [ui] ImageGallery: call makeCurrentItemVisible only once 2021-09-13 10:17:40 +02:00
Fabien Castan
da1f23963a [ui] ImageGallery: fix sort and filtering
Keep a valid index when changing the type of view
2021-09-01 19:06:34 +02:00
Fabien Castan
d3559bd51e [ui] fix image selection in ImageGallery 2021-09-01 14:41:32 +02:00
Nils Landrodie
500dfd96b1 [ui] Change from i++ to ++i 2021-08-27 20:03:24 +02:00
Nils Landrodie
ee910b96c5 [ui] Change buttons default display before reconstruction 2021-08-23 18:44:40 +02:00
Landrodie
56d91bde1a [ui] Change intrinsic structure and key getter for table view 2021-08-23 18:18:29 +02:00
Nils Landrodie
4fb719e204 [ui] Update tableview to stop flicking at bounds
Specify boundsMovement property to avoid overshooting with the flicks
2021-08-23 17:52:42 +02:00
Nils Landrodie
0876b9e3d5 [ui] Add vertical scrollbar for high number of intrinsics 2021-08-23 17:52:42 +02:00