Commit graph

129 commits

Author SHA1 Message Date
Candice Bentéjac
d563451a53 [ui] GraphEditor: check node is valid
Only count valid nodes
2024-10-15 15:05:11 +02:00
Aurore LAFAURIE
b6df2852e7 [ui] Recompute and Re-submit not allowed with Compatibility Nodes
Renaming of canCompute to canComputeTopologically to understand the static aspect of the function
2024-09-13 18:32:46 +02:00
Aurore LAFAURIE
7d93a54b4c [ui] Fix click on Category in Node Menu to keep the nodes displayed 2024-09-10 12:37:44 +02:00
Candice Bentéjac
801ac369cd [GraphEditor] Do not update pins when the app is closing
When an edge is removed, the pins it is connected to are
updated depending on their status while the edge is getting destroyed. When the window is
closing, all the components are being destroyed while the QML context is being invalidated: no function call to components that are being destroyed should be made in that context.
2024-09-05 09:36:17 +02:00
Aurore LAFAURIE
85bfc5614b [ui] Thicker edges for for loops and better draw of them
If it's a for loop edge, it needs 2 shapes to draw from each side of the info section
2024-09-02 19:04:22 +02:00
Aurore LAFAURIE
f9ec52a39b [ui] Prevent modification of iterations while expanded for loop 2024-09-02 17:08:04 +02:00
Aurore LAFAURIE
0d346ab2da [ui] Value of current edge iteration and TaskManager protected 2024-09-02 17:08:04 +02:00
Fabien Castan
a9b22b0aaa [ui] GraphEditor: fix tooltip camel case 2024-09-02 17:08:03 +02:00
Fabien Castan
62ea6924f6 [ui] GraphEditor: simplify foreach loop menu 2024-09-02 17:08:03 +02:00
Fabien Castan
48d08b1f88 [ui] GraphEditor: improve alignments
Reduce usage of anchors (except centerIn/fill).
Display of Next/Previous for IntSelector.
2024-09-02 17:08:02 +02:00
Aurore LAFAURIE
ff86a5182e [GraphEditor] Close edge popup when action is triggered 2024-09-02 17:08:02 +02:00
Aurore LAFAURIE
c60c4d4d6c [ui] Collapse and Expand for loop are not allowed for Compatibility Nodes 2024-09-02 17:08:02 +02:00
Aurore LAFAURIE
aba045f4aa [ui] Display for loop size on edges 2024-09-02 17:08:02 +02:00
Aurore LAFAURIE
019e137386 [ui/core] First version of For Loop implementation
If you connect a list to an attribute, you can iterate over the list as a for loop
2024-09-02 17:08:01 +02:00
Candice Bentéjac
da2c3fda05 [GraphEditor] Return empty bbox if the graph is empty
This commit checks whether there is a node in the graph before trying
to determine the size and position of the bounding box. If the graph is
empty, an bounding box set with 0s is returned.
2024-08-26 16:21:28 +02:00
Fabien Castan
6646bde7a9 [ui] GraphEditor.newNodeMenu: fix unstable menu height
Use an explicit height on the newNodeMenu, this fixes the issue with
unstable size of the menu.
2024-08-22 22:23:28 +02:00
Candice Bentéjac
16e951bad8 [ui] Update Delete data label according to selected nodes 2024-08-01 14:53:43 +02:00
Aurore LAFAURIE
82dd2a1f31 [ui] Re-submit behavior implemented 2024-08-01 11:07:29 +01:00
Aurore LAFAURIE
72201a80ff [GraphEditor] Implementation of Recompute Button
Allows to do Delete data + Compute in less clicks
2024-08-01 11:07:29 +01:00
Aurore LAFAURIE
cc6acbc610 [ui] Removal of useless option for Compute and Submit selected nodes
It is now included directly in Compute and Submit options.
2024-07-17 16:08:01 +02:00
Aurore LAFAURIE
887844541c Compute or Submit selected nodes 2024-07-17 16:08:00 +02:00
Aurore LAFAURIE
671b3ff128 [ui] InputNode behavior for menu and display 2024-05-27 22:03:42 +02:00
Aurore LAFAURIE
697a8a562f [ui] Change order and put getSelectedNodes function outside specific action 2024-05-10 11:52:26 +02:00
Aurore LAFAURIE
c3ab36deb0 [ui] Cut option available in GraphEditor 2024-05-06 17:11:54 +02:00
Candice Bentéjac
6f1ac9a06e [ui] Hide disabled File attributes and their edges but keep the connections
This commit effectively hides a node's attributes when they are disabled.
If these attributes have connections, the edges representing these
connections are hidden but not destroyed. When the edges are hidden, if
one of the connected attributes is still enabled, its pin becomes empty as
if it was not connected to anything.

If the disabled attribute is re-enabled and the connection has not been
broken (if the enabled attribute on the other side of the edge has not
been reconnected to another attribute, for example), the edge re-appears.
If the connection has been broken, then the attribute will be unconnected.

Hidden connections are saved in project files and taken into account when
a project file containing some is loaded.
2024-04-19 17:16:20 +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
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
e9d80611c7 [GraphEditor] Clean-up: Harmonize syntax across all files 2023-11-06 16:28:22 +01:00
Abdelrahman AL MAROUK
af8eabfa97 [ui] add searchbar for graph nodes 2023-09-01 09:03:39 +02:00
Candice Bentéjac
091346cbb8 [qml] Optimize QML files and fix syntax warnings
This commit addresses warnings that were raised by QtCreator's linter:
- IDs declared more than once
- variables declared more than once in the same scope
- type coercions
- variables declared as "var" when their type is known
- unclosed "case" in switch-case
2023-07-04 12:04:14 +02:00
Candice Bentéjac
9b5dd40b02 [qml] Qt5.15: Upgrade all QtQuick modules 2023-07-03 12:11:29 +02:00
Candice Bentéjac
614f831457 [ui] Force nodes' status update before performing a submit/compute/delete
This ensures that each node's status is correct before being computed,
submitted, or before having its data deleted. This is especially useful
when the File Poller is in minimal node, and only monitors the nodes that
are currently submitted or running.

If a graph is being opened in two different instances of Meshroom, and
computations are started on it in one of the instances, the other one will
not be aware of it (as the signals indicating computations have started
will have been emitted in the first instance, so no chunk will be added
to the monitoring in the second one). By forcing the update of the statuses
before actually starting computations or deleting data, we ensure that
there will not be any computational conflicts (same nodes submitted twice
in farm, for example) and that the users can know at all times what they
are doing without manually triggering a refresh.

This is not critical for the "Delete Data" part, as the action can already
be triggered even with there is no data to delete, but is still useful
to keep the displayed nodes as up-to-date with their actual status as
possible.
2023-03-02 19:13:00 +01:00
Sarah Brood
56fe514582
[ui] GraphEditor: use maxZoom to fit on nodes (#1865) 2023-01-18 11:49:03 +00:00
Fabien Castan
a2f559f48a
Merge pull request #1839 from alicevision/dev/fixQmlWarnings
[ui] Fix all "TypeError" QML warnings
2022-12-06 11:38:16 +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
Candice Bentéjac
6a36da61cf [ui] GraphEditor: select pipelines imported through the node menu
Add all the nodes from a pipeline imported through the node menu to the
node selection.
This involves changing the return value of ImportProjectCommand from a
boolean to a list of imported nodes.
2022-12-02 18:19:56 +01:00
Candice Bentéjac
9d88ad91d5 [ui] GraphEditor: clear node selection before adding new nodes from the menu
This commit is a bugfix.
When adding new nodes with the node menu, the selection was never
explicitly cleared and nodes were added to the selection rather than
being exclusively selected.

This behaviour used to be hidden when the node menu could only appear
with a right click, as the click would automatically empty the
selection. However, with the node menu being now openable with the TAB
key, there might not be a click to empty the selection. If new nodes
are added by opening the menu with the TAB key and using the arrow keys
to select the node to create, an infinite number of them can be created
and added to the selection.
2022-12-02 18:13:50 +01:00
Candice Bentéjac
aedf0ef4c1 [ui] GraphEditor: Add the pipelines in the node menu's search bar
Pipelines can be searched in the list of available node types / pipelines
like regular node types.
2022-12-02 18:13:50 +01:00
Candice Bentéjac
2e5f471b7b [ui] Add a "pipelineTemplateNames" property
This property simplifies and optimizes the addition of templates in
the node menu and their import into the graph, as it prevents us from
looping over the entire "pipelineTemplateFiles" dictionary to retrieve
the information we need.
2022-12-02 18:13:49 +01:00
Candice Bentéjac
c2570ca0fb [ui] GraphEditor: Import pipeline on the mouse's position with the node menu
If a pipeline is imported with the node menu instead of the "Import
Project" action from the File menu, the top-left "corner" of the graph
should be placed on the mouse's position.
The position of pipelines imported with the "Import Project" menu
remains unchanged: they are automatically placed below the lowest
node in the current graph.
2022-12-02 18:13:17 +01:00
Candice Bentéjac
04ab813cef [ui] GraphEditor: Add a "Pipelines" category in the node menu
Artificially add a "Pipelines" category in the node menu. The category
contains the list of available pipeline templates. Selecting a pipeline
instead of a regular node type "creates" the pipeline in the GraphEditor
(using the "import project" functionality). The imported pipeline is
by default placed under the current graph.

This commit does not include enabling the search for pipelines from the
"Pipelines" category in the search bar.
2022-11-29 18:14:30 +01:00
Loïc Vital
0795e40ef6 [ui] check mouse is in graph editor 2022-11-03 10:33:19 +01:00
Loïc Vital
cf3e2b3573 [ui] prevent default tab behavior (change focus to next element) 2022-11-02 15:25:24 +01:00
Loïc Vital
c5294eb364 [ui] open node menu with tab 2022-11-02 13:31:52 +01:00
Candice Bentéjac
021770a424 [ui] Center pasted nodes in GraphEditor when it does not contain the mouse
When using the Edit > Paste menu, or when pressing Ctrl+V while the Graph
Editor has the focus but the mouse is not contained in it, there is no
current mouse position in the GraphEditor so the position that is provided
to the "pasteNodes" function is the last known mouse position, which is
oftentimes on the border of the GraphEditor.

This commit automatically sets the mouse's position to the center of
the GraphEditor, and "builds" the zone containing the pasted nodes around
it.
2022-10-03 11:13:52 +02:00
Candice Bentéjac
58784fb6ff [ui] Restrain the "copy/paste nodes" shortcuts to the GraphEditor
If a Ctrl+C or Ctrl+V shortcut is performed outside the GraphEditor,
the performed action should not be a copy or a paste of the nodes, but
the own copy/paste of the current element (e.g. if a Ctrl+C is made on
on the NodeEditor, then the copied element should be the one selected
in the NodeEditor, not the currently selected node).
2022-09-26 09:56:28 +02:00
Candice Bentéjac
61e0482a21 Add an offset to the position of pasted nodes if a node is hovered
If a node is being hovered when the user performs the paste, an
offset is added to the mouse's position, both in the horizontal and
vertical directions. This aims at avoiding a complete overlap with
the nodes on top of which the clipboard content is pasted.
2022-09-08 15:21:57 +02:00
Candice Bentéjac
6bb0ad4508 Add a "Paste Node(s)" option in the nodes' right click menu
The "Paste Node(s)" option copies the selected nodes to the
clipboard (as does the "Copy Node(s)" option) and immediately
pastes them into the graph.
2022-09-06 11:20:25 +02:00
Candice Bentéjac
d06acf6722 Reconnect copied/pasted nodes together but not to the graph
If several nodes are described in the clipboard and are supposed to
be connected with each other, reconnect them together, but do not
attempt to reconnect them to the graph they were copied from, even if
it is the current graph.
2022-09-06 11:13:29 +02:00