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.
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.
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.
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
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
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
## 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