Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Backdrop Node for Meshroom graph #2574

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
868c6b9
[desc] Node Internal Attributes: Added Attribute factory
waaake Dec 18, 2024
eb8f7ea
[core] Backdrop Node: Added Notion of Backdrop as a Node
waaake Dec 18, 2024
2313ef3
[desc] Node Attribute Traits: Added Resizable Trait and attribute def…
waaake Dec 18, 2024
0c01687
[desc] Added Notion of Builtin Backdrop
waaake Dec 18, 2024
093ce7a
[ui] Geom2d: Added a way to detect full intersection between two rects
waaake Dec 18, 2024
f8c5ec5
[ui][qml] Added Backdrop Node component in QML
waaake Dec 18, 2024
0c05baa
[ui] Graph: Added Functionality to modify node position and dimensions
waaake Dec 18, 2024
03e0133
[ui] GraphEditor: Added Loader for Node Delegate
waaake Dec 18, 2024
e33b22d
[core] Builtins: Added registration mechanism for Builtin plugins
waaake Dec 18, 2024
1c65ada
[core] Node: Added Constructor Preference to allow defining the Node …
waaake Dec 18, 2024
bf6f765
[core] Graph: Updated Node Construction to rely on using preferred co…
waaake Dec 18, 2024
95f7190
[ui][qml] GraphEditor: Added helper for nodeRepeater to get the item …
waaake Jan 2, 2025
2532de4
[ui] GraphEditor: Updated bounding box to look at the actual node ite…
waaake Jan 2, 2025
e54d1a1
[ui] DelegateSelectionBox: Updated selection to refer to the actual i…
waaake Jan 2, 2025
6769c1b
[ui] GraphEditor: Grouped the visual resize of a Node and reposition
waaake Jan 7, 2025
081a584
[ui] Backdrop: Updated the signal emission from QML to be invoked onl…
waaake Jan 7, 2025
0fdd044
[ui] GraphEditor: Backdrop Resizing updates
waaake Jan 7, 2025
d0b4626
[ui] GraphEditor: Added flag for holding the animation state for the …
waaake Jan 8, 2025
54a569a
[ui] Commands: Added Grouped UI Modification Command
waaake Jan 8, 2025
68e1ba3
[ui] Graph: Using Grouped UI Graph Modification to disable animation …
waaake Jan 8, 2025
8fb7d55
[desc] Node: Updated return hint -> List[Attribute] on getInternalParams
waaake Jan 13, 2025
4d39774
[core] Node: Added childNodes to BaseNode
waaake Jan 13, 2025
0447cd3
[core] Node: Add method to create a node instance in memory
waaake Jan 13, 2025
f6853d7
[ui] Graph: Copying Nodes also considers any child nodes the parent n…
waaake Jan 13, 2025
ee4eb7f
[ui] Backdrop: Backdrop has a const defined minimum height and width …
waaake Jan 13, 2025
87bf2e9
[ui] Backdrop: Backdrop can be resized from the top as well
waaake Jan 13, 2025
9b77310
[ui] GraphEditor: Backdrop Node Animations considers reszing on Y and…
waaake Jan 13, 2025
6a97f48
[ui] Backdrop: Backdrop updates the node children when selected
waaake Jan 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[ui] Graph: Added Functionality to modify node position and dimensions
  • Loading branch information
waaake committed Jan 1, 2025
commit 0c05baa439e76e6b71b27058405269d6d17b5c64
25 changes: 25 additions & 0 deletions meshroom/ui/graph.py
Original file line number Diff line number Diff line change
@@ -661,6 +661,22 @@ def moveNode(self, node: Node, position: Position):
"""
self.push(commands.MoveNodeCommand(self._graph, node, position))

@Slot(Node, float, float)
def resizeNode(self, node, width, height):
""" Resizes the Node.

Args:
node (Node): the node to move
width (float): Node width.
height (float): Node height.
"""
# Update the node size
with self.groupedGraphModification("Resize Node"):
if node.hasInternalAttribute("nodeWidth"):
self.setAttribute(node.internalAttribute("nodeWidth"), width)
if node.hasInternalAttribute("nodeHeight"):
self.setAttribute(node.internalAttribute("nodeHeight"), height)

@Slot(QPoint)
def moveSelectedNodesBy(self, offset: QPoint):
"""Move all the selected nodes by the given `offset`."""
@@ -670,6 +686,15 @@ def moveSelectedNodesBy(self, offset: QPoint):
position = Position(node.x + offset.x(), node.y + offset.y())
self.moveNode(node, position)

@Slot(list, QPoint)
def moveNodesBy(self, nodes, offset: QPoint):
"""Move all the selected nodes by the given `offset`."""

with self.groupedGraphModification("Move Nodes"):
for node in nodes:
position = Position(node.x + offset.x(), node.y + offset.y())
self.moveNode(node, position)

@Slot()
def removeSelectedNodes(self):
"""Remove selected nodes from the graph."""