Commit graph

118 commits

Author SHA1 Message Date
Candice Bentéjac
7c9a869d99 [ImageGallery] Use palette's colors for the text of the intrinsics display 2025-01-22 20:14:20 +01:00
Candice Bentéjac
f1a83628a6 [ImageGallery] Do not fill intrinsics model until it has been instantiated
In some cases, like when opening the most recent file from the command
line, switching the color palette or hot reloading, the intrinsics
might be parsed and ready to populate the intrinsics' `TableModel` while
the model itself is being instantiated.

To prevent crashes, we forbid operations on the `TableModel` until it has
been fully instantiated.
2025-01-22 20:09:23 +01:00
Candice Bentéjac
935f5d07db [ImageGallery] Remove version number from Qt.labs.qmlmodels import 2025-01-22 20:03:48 +01:00
waaake
c2c32c8c14 [ui] ImageGallery: Implementation of Toggle based Search. 2024-11-30 20:20:32 +05:30
Candice Bentéjac
5a0b1c0c95 [qt6][qml] Clean-up code and harmonize comments 2024-11-07 18:15:37 +01:00
Candice Bentéjac
05e7d9eaee [qt6] Use JS functions format to declare explicit parameters in slots 2024-11-07 18:09:14 +01:00
Candice Bentéjac
0e71f2a520 [qt6] Update versions for all the imported modules
Qt3D.Extras cannot be updated to 2.6 yet, otherwise there are errors.
2024-11-07 18:09:01 +01:00
Candice Bentéjac
6d845376eb [qt6] Use JS functions format to declare explicit parameters in slots
This fixes all the "Injection of parameters into signal handlers
is deprecated. Use JavaScript functions with formal parameters instead."
warnings.
2024-11-07 18:08:59 +01:00
Aurore LAFAURIE
f8d963e0b0 [ui] Add MScrollBar for better visibility
Always visible if height or width need it, with specific colors for hovered and pressed behaviors.
2024-09-11 17:33:29 +02:00
Fabien Castan
958f2edc99
Merge pull request #2395 from alicevision/dev/updateIntrinsicsWhileRemovingImages
[ui] Remove intrinsic if not used by any viewpoint
2024-05-23 14:28:13 +02:00
Aurore LAFAURIE
c50d3cc9e7 [ui] Add removeImage function in Python to check for intrinsic still used 2024-05-13 09:48:24 +02:00
Aurore LAFAURIE
561e9b806c [ui] Remove intrinsic if not used by any viewpoint 2024-04-29 15:58:15 +02:00
Aurore LAFAURIE
59650d54b3 [ImageGallery] Display camera initialization label with default label if it differs 2024-04-24 16:59:36 +02:00
Aurore LAFAURIE
f43b6e3461 [ui] Fix drag and drop of heavy number of frames 2024-04-19 12:20:55 +02:00
Candice Bentéjac
04a7191b15 [ui] Simplify error dialog titles and capitalize first letters 2024-04-05 18:06:23 +02:00
Aurore LAFAURIE
dea13eb48a [ui] Warning dialog when project and images are dropped
Warning dialog when project and images are dropped, both for
ImageGallery and GraphEditor.

Counter of meshroom projects and compare to actual list of files
dragged.
2024-03-28 16:42:17 +01:00
Aurore LAFAURIE
9f96f68a95 [ui] Cosmetic modifications
Cosmetic modifications such as missing spaces.
2024-03-28 11:28:31 +01:00
Aurore LAFAURIE
67fbf1b00f [ui] drag&drop: common behavior for graph editor and image gallery
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
2024-03-28 11:28:29 +01:00
Candice Bentéjac
2bdf061d2e [ImageGallery] Clean-up: Harmonize syntax across all files 2023-11-06 16:28:22 +01:00
Fabien Castan
c02aa1f229
Merge pull request #2145 from alicevision/fix/cameraInitIdx
[ui] Preserve last `CameraInit` index when updating the CameraInits list
2023-10-19 10:58:33 +02:00
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
a606a8f83c [ui] Only update active CameraInit and its index when they are changed
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.
2023-10-03 18:11:55 +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