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

feat: Node Graph module system #1995

Open
wants to merge 97 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
cff4de5
Make proper tabs
rprospero Sep 9, 2024
3f03532
Stub model and delegate
rprospero Sep 9, 2024
5802b24
Start factoring out node graph code
rprospero Sep 9, 2024
f9300ab
Very basic connecting line
rprospero Sep 9, 2024
2eacd9c
Get line connections from models
rprospero Sep 9, 2024
a5116ca
Better spline curves
rprospero Sep 9, 2024
1f56d5d
Nodes get an icon
rprospero Sep 9, 2024
913e554
Add a second edge
rprospero Sep 9, 2024
d8f2590
Connect to actual value on node
rprospero Sep 10, 2024
53f5045
Add support for customising the curve strength of the edges
rprospero Sep 10, 2024
5bc1ff2
Use C++ to generate node model
rprospero Sep 23, 2024
7b5a644
Actually pull nodes from model
rprospero Sep 23, 2024
228e9d0
Allow references
rprospero Sep 24, 2024
cb86667
Remove old IntNode
rprospero Sep 24, 2024
3031bba
Generic number node
rprospero Sep 24, 2024
85e718d
Get type and icon from variant
rprospero Sep 24, 2024
c9af37d
Split up Node Graph across multiple files
rprospero Sep 24, 2024
888fc4f
Templated GraphModel
rprospero Sep 24, 2024
d89ef2c
Allow types to define their own types and icons in a graph
rprospero Sep 24, 2024
cedb815
Check nodeType completeness at compile time
rprospero Sep 24, 2024
fd9898a
Enable adding new plot elements at runtime
rprospero Sep 25, 2024
835e76e
Update edges when adding new elements
rprospero Sep 25, 2024
90e2fdc
Drag around nodes
rprospero Sep 25, 2024
c97424a
Drag nodes by title and icon
rprospero Sep 25, 2024
99b3e09
More Dynamic edges
rprospero Sep 25, 2024
9967d24
Better creation of new nodes
rprospero Sep 25, 2024
9ddb4f6
Put all nodes in a node wrapper
rprospero Sep 25, 2024
e958ceb
Add basic delete node button
rprospero Sep 27, 2024
dca4c39
Actually allow pointers in data
rprospero Oct 7, 2024
07ad072
Create real edges
rprospero Oct 8, 2024
f9bd07c
Actually update the values on connection
rprospero Oct 8, 2024
f2812de
Highlight unlinked nodes
rprospero Oct 8, 2024
3658646
Safely delete nodes and keep the edges correct
rprospero Oct 8, 2024
0223b1b
Enable disconnecting nodes
rprospero Oct 8, 2024
8605597
Refactor connections to remove boilerplate
rprospero Oct 11, 2024
61f0ae5
Refactor disconnect
rprospero Oct 11, 2024
ef60e24
Split GraphModelBase into own files
rprospero Oct 11, 2024
34e9d23
Enable naming of nodes
rprospero Oct 15, 2024
c66159f
Finish decoupling GraphModel from specific type implementation
rprospero Oct 15, 2024
b0475d0
Don't allow invalid node numbers
rprospero Oct 15, 2024
551cc23
Fix stupid javascript falsity issue in GUI
rprospero Oct 15, 2024
9a959e6
Allow pluggable delegates in the graph view
rprospero Oct 15, 2024
5fb60d4
Move overload visitor into its own file
rprospero Oct 16, 2024
51f6b13
Customize node model handling per type
rprospero Oct 16, 2024
5707536
Move boiler plate back into graphNodeModel
rprospero Oct 16, 2024
6f2cf82
Unwrap nodes before processing
rprospero Oct 17, 2024
5fa620e
State making graph of genuine generator parts
rprospero Oct 16, 2024
e0c2f97
Try and actually display node
rprospero Oct 17, 2024
1e90451
Load file in new GUI
rprospero Oct 18, 2024
c6512e9
Only connect to Configuration Model for now
rprospero Oct 18, 2024
22fee8a
Display configuration info in nodes
rprospero Oct 21, 2024
5634b57
Display different types
rprospero Oct 30, 2024
b9dba9a
Simplify Code
rprospero Oct 30, 2024
86b60c9
Add size info to generator
rprospero Oct 31, 2024
2c58dd3
Remve debugging output
rprospero Oct 31, 2024
97bf96f
Remove dead code
rprospero Oct 31, 2024
92d3035
Add edges
rprospero Oct 31, 2024
c3234e2
Add Generator Nodes
rprospero Oct 31, 2024
f0f6829
Start giving proper icons for GeneratorNodes
rprospero Oct 31, 2024
0633275
Automatical get node icon and name
rprospero Oct 31, 2024
d0bcb40
Start splitting off node instance types
rprospero Nov 1, 2024
86ec103
Fully seperate type handling of nodes
rprospero Nov 1, 2024
9d7a88d
Actually get temperature from Temperature node
rprospero Nov 1, 2024
a856e95
Clang format
rprospero Nov 7, 2024
b8e60e6
CMake format
rprospero Nov 7, 2024
7068fbf
format QML
rprospero Nov 7, 2024
f6139dd
Try using the older qml formatting tools
rprospero Nov 7, 2024
6dc082a
Try and format qml again
rprospero Nov 7, 2024
5643c98
Stop hard coding icon paths
rprospero Nov 8, 2024
4ec80be
Get icons added programmatically
rprospero Nov 8, 2024
94dfb05
CMake format
rprospero Nov 11, 2024
927943d
Mode QML into nodeGraph directory
rprospero Nov 11, 2024
1af2d92
Delete node framework
rprospero Nov 11, 2024
ad262c1
Pass context to delete
rprospero Nov 14, 2024
5bd5a22
Correctlty link in Dissolve Model
rprospero Nov 14, 2024
78ea755
Add test for GeneratorGraphModel
rprospero Nov 14, 2024
c214281
Get rid of overload template magic.
rprospero Nov 14, 2024
034e788
Add hotkeys to open and quit menu
rprospero Nov 19, 2024
2f4d434
Fix whitespace
rprospero Nov 20, 2024
894770d
Fixup qml
rprospero Nov 20, 2024
5e6bf8c
Don't use relative header imports
rprospero Nov 20, 2024
3d9487e
Fix path typo
rprospero Nov 20, 2024
ad86ae4
Add missing instance files
rprospero Nov 20, 2024
fbede99
Fix graph model unit test icons
rprospero Nov 20, 2024
fe16cff
Access Dissolve as reference
rprospero Nov 20, 2024
40d3aff
Remove graphModel.cpp
rprospero Nov 20, 2024
dd127d6
More code review
rprospero Nov 20, 2024
47c0461
More comments
rprospero Nov 20, 2024
54977ad
Rework and document graphMode.h
rprospero Nov 20, 2024
bf123b3
Document example graph model
rprospero Nov 21, 2024
209c108
Comment GraphModelBase
rprospero Nov 21, 2024
9736827
Refactor graph edge model
rprospero Nov 21, 2024
345906a
Remove edgeCache accessor
rprospero Nov 21, 2024
167a3c3
Document GraphNodeModel
rprospero Nov 21, 2024
48995e2
Comment GraphModel
rprospero Nov 21, 2024
18612d0
Comment generator graph model
rprospero Nov 21, 2024
ae11696
Squashed commit of the following:
rprospero 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
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,23 @@ if(GUI)
# Dissolve QML GUI
qt_add_executable(${qmlgui_target_name} MACOSX_BUNDLE ${SRCS}/dissolve-gui-qml.cpp)
set_source_files_properties(${SRCS}/gui-qml/qml/DissolveMain.qml PROPERTIES QT_RESOURCE_ALIAS qml/DissolveMain.qml)

# Programatically add icon resources
set(REAL_ICONS "")
file(
GLOB_RECURSE icons
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src/gui/icons/
"*.svg"
)
foreach(icon ${icons})
if(${icon} MATCHES "\\.\\..*")

else()
set_source_files_properties(${SRCS}/gui/icons/${icon} PROPERTIES QT_RESOURCE_ALIAS icons/${icon})
list(APPEND REAL_ICONS "${SRCS}/gui/icons/${icon}")
endif()
endforeach()

qt_add_qml_module(
${qmlgui_target_name}
VERSION
Expand All @@ -287,6 +304,12 @@ if(GUI)
Dissolve
QML_FILES
${SRCS}/gui-qml/qml/DissolveMain.qml
${SRCS}/gui/qml/nodeGraph/ExampleDelegate.qml
${SRCS}/gui/qml/nodeGraph/GeneratorDelegate.qml
${SRCS}/gui/qml/nodeGraph/GraphView.qml
${SRCS}/gui/qml/nodeGraph/NodeBox.qml
RESOURCES
${REAL_ICONS}
)

# Set project-local include directories for target (we expect to need less of these dependencies over time)
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/dissolve-gui-qml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
#include "base/messenger.h"
#include "base/processPool.h"
#include "gui/models/dissolveModel.h"
#include "gui/models/nodeGraph/graphModel.h"
#include "gui/models/types.h"
#include "main/cli.h"
#include "main/dissolve.h"
#include "main/version.h"
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QSurfaceFormat>
#include <clocale>

Expand All @@ -19,6 +21,9 @@ int main(int args, char **argv)
CoreData coreData;
Dissolve dissolve(coreData);

DissolveModel dissolveModel;
dissolveModel.setDissolve(dissolve);

// Parse CLI options
CLIOptions options;
if (options.parse(args, argv, true) != CLIOptions::Success)
Expand All @@ -31,14 +36,15 @@ int main(int args, char **argv)
QGuiApplication app(args, argv);

QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("dissolve", &dissolveModel);
const QUrl url(u"qrc:/Dissolve/qml/DissolveMain.qml"_qs);
Types::registerDissolveQmlTypes();

QObject::connect(
&engine, &QQmlApplicationEngine::objectCreationFailed, &app, []() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.load(url);

Types::registerDissolveQmlTypes();
QCoreApplication::setOrganizationName("Team Dissolve");
QCoreApplication::setOrganizationDomain("www.projectdissolve.com");
QCoreApplication::setApplicationName("Dissolve-GUI-QML");
Expand Down
Loading
Loading