Commit graph

115 commits

Author SHA1 Message Date
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
Candice Bentéjac
ede24713d0 Add "Copy" and "Paste" actions in the "Edit" menu
Also add a "Copy Node(s)" option in the nodes' right click menu.
2022-08-25 11:32:37 +02:00
Candice Bentéjac
e11452efdb Extend copy/paste support to selections containing multiple nodes 2022-08-25 11:08:57 +02:00
Candice Bentéjac
5b65866e49 [ui] Paste a node on the mouse's position
When creating a node with a "paste" operation, place the node
on the mouse's position in the graph instead of default position (0,0).

If the mouse is placed on an existing node, the pasted node will be
placed on the mouse's position plus an offset so that the pasted node
does not directly overlap with the existing node.
2022-08-19 12:02:09 +02:00
Candice Bentéjac
ddda62a652 Add node to graph with Ctrl+V if valid node content is in the clipboard
Attempt to paste the clipboard's content in the graph when Ctrl+V is
pressed. If the clipboard contains a valid node description, add the
corresponding node to the graph.
Otherwise, do nothing.
2022-08-19 12:00:16 +02:00
Candice Bentéjac
751bad96c6 Copy selected node's content to the clipboard when Ctrl+C is pressed
When Ctrl+C is pressed while a node selected, its content is formatted
to JSON and copied to the system's clipboard.
2022-08-19 11:31:31 +02:00
luz paz
f4dcf6557f Fix various typos in the source code
## Description
Fix various typos in the source code. This includes user facing code, documentation, and source comments. This PR has not been tested.
Closes #1605
2022-01-22 07:39:05 -05:00
ChemicalXandco
ecb1662b6b [ui] GraphEditor: highlight the edge that will be deleted when it is replaced with another edge 2021-06-04 19:59:49 +01:00
Fabien Castan
18be350e6f
Merge pull request #1227 from ChemicalXandco/box_select
[ui] add support for selecting multiple nodes at once
2021-05-03 23:42:11 +02:00
ChemicalXandco
fdfabf0066 [ui] GraphEditor: use entire node selection when handling '_ from here' operations 2021-04-18 14:33:17 +01:00
ChemicalXandco
e8a5491178 [ui] GraphEditor: select duplicated nodes and select following nodes on alt + left click 2021-04-14 23:14:51 +01:00
ChemicalXandco
e18f815af9 [nodes] add node categories 2021-02-14 17:03:42 +00:00
ChemicalXandco
3d33134ca9 [ui] add support for node categories 2021-02-14 16:12:39 +00:00
ChemicalXandco
55b16bc6d3 [tests] update node duplication test 2021-02-03 22:29:31 +00:00
ChemicalXandco
acf1bf2116 [ui] grapheditor: explicitly pass selected nodes argument 2021-01-26 21:13:16 +00:00