Giter Site home page Giter Site logo

paceholder / nodeeditor Goto Github PK

View Code? Open in Web Editor NEW
2.8K 154.0 759.0 2.67 MB

Qt Node Editor. Dataflow programming framework

License: BSD 3-Clause "New" or "Revised" License

CMake 11.89% C++ 88.11%
dataflow-programming graph qt5 cpp model-view qt6

nodeeditor's People

Contributors

chriamue avatar cpi47 avatar emmenlau avatar facontidavide avatar fredakilla avatar githubuser0xffff avatar jbltx avatar jcelerier avatar kpanesar avatar landonjerre avatar malcohol avatar migferreira avatar mtbrobotanist avatar paceholder avatar quincunx271 avatar rayment avatar rkollataj avatar romch007 avatar russelltg avatar saulberrenson avatar schumacb avatar signmotion avatar sindney avatar tatatupi avatar tatolevicz avatar tuvok avatar vhutter avatar yadunund avatar ypnos avatar zmoth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodeeditor's Issues

Licensing

Would it be possible to release the software with an more permissive license like MIT or LGPL?
GPL is a good license, but it restricts usage to "open source only".

Rigth now I can't use the library in proprietary software. I know that this software depends on QT, but QT can be used under the LGPL which allows the usage in proprietary software, as long as it is dynamically linked.

Comments

I think it would be nice to be able to comment on nodes, in two fashions:

  1. Directly on the node, something like this:
    image
  2. Or a box around a group of nodes like:
    image

Thoughts?

Access the topology of a graph

Given a graph that the user constructed, I need to be able to access the topology of the graph.

Currently, it almost seems possible with FlowScene::nodes() and FlowScene::connections(), but although Connection is defined through its header, Node is not. Node is merely forward declared. If Node.hpp was visible or #include'd somewhere, it would work.

Support HiDPI screens

What I get now on my QHD+ screen looks terrible.
Qt documentation suggests to define a boolean environment variable

export QT_AUTO_SCREEN_SCALE_FACTOR=1

This scales the application but fonts are bad and the nodes look pixelized.

Ideas:

  • Check QGraphicsObject caching
  • Study Qt::AA_EnableHighDpiScaling

Python bindings

This library is awesome, tested it using Qt but I could really make use of it using Python/Pyside2.
Any chance somebody would be savvy enough to generate python bindings for this ?
Thanks !

Graphical issues when embedded widget is too big

screen shot 2017-05-18 at 5 46 10 pm

I know the lib is not really intended to deal with multiple inputs but I'm trying to do it anyway. The problem is only graphical, inputs works great.

I tried to set the node height manually but with no success. Is there like a max height setting somewhere?

Thanks for the lib!

Special context menus

I think it'd be useful to have context menus for nodes. I also think it'd be useful for the user to be able to configure which actions are there, or maybe even totally custom action menus.

Another possibility is you could be able to set the ContextMenuPolicy to allow for custom context menus entirely on nodes.

What is the best way to go about this? Some sort of addNodeContextAction?

Multiple windows build errors

Hi. I'm trying to compile nodes in VS 2015, but I'm getting dozens of compiler errors "error syntax ::" .

I have no idea what is wrong as it seems correct.
Any Idea what it may be?

Diffenent colors for different NodeDataTypes

So a useful feature to me would be diffenent colors for different NodeDataTypes to make different types easily differentiated.

This kind of goes against the styling you recently implemented, but there are a few ways around that.

Approach 1

Have a QColor member in NodeDataType and just use that for rendering. It might be nice to have different colors for hover, select etc or just they are made lighter for hover etc.

Approach 2

A style theme defines a bunch of possible colors that could be used for connections, based on the color scheme they are going for, then they are assigned to be different for different data types.

Conclusion

I personally like approach 2 better because it follows color schemes and doesn't need each NodeDataType to define all their own custom colors, it just works and it looks good but you can't like assign red to a specific data type (which isn't really a loss IMHO because that would break color scheming anyways).

I'm willing to write the code for it :).

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39601225-diffenent-colors-for-different-nodedatatypes?utm_campaign=plugin&utm_content=tracker%2F34672389&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F34672389&utm_medium=issues&utm_source=github).

Build error on Windows mingw32-make

Tried to build on Windows 10 by Qt 5.5.1 mingw 4.9.2/ There is build log:

D:\workplace\_nodeeditor\build>mingw32-make
Scanning dependencies of target nodes_autogen
[  1%] Automatic MOC for target nodes
Generating MOC source nodes_autogen/UVLADIE3JM/moc_Connection.cpp
Generating MOC source nodes_autogen/UVLADIE3JM/moc_ConnectionGraphicsObject.cpp
Generating MOC source nodes_autogen/UVLADIE3JM/moc_FlowItemInterface.cpp
Generating MOC source nodes_autogen/UVLADIE3JM/moc_FlowScene.cpp
Generating MOC source nodes_autogen/UVLADIE3JM/moc_Node.cpp
Generating MOC source nodes_autogen/UVLADIE3JM/moc_NodeDataModel.cpp
Generating MOC source nodes_autogen/UVLADIE3JM/moc_NodeGraphicsObject.cpp
Generating MOC compilation nodes_autogen/moc_compilation.cpp
[  1%] Built target nodes_autogen
[  3%] Generating qrc_resources.cpp
Scanning dependencies of target nodes
[  5%] Building CXX object CMakeFiles/nodes.dir/src/Connection.cpp.obj
D:\workplace\_nodeeditor\src\Connection.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "Connection.hpp"
 ^
[  6%] Building CXX object CMakeFiles/nodes.dir/src/ConnectionBlurEffect.cpp.obj
D:\workplace\_nodeeditor\src\ConnectionBlurEffect.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "ConnectionBlurEffect.hpp"
 ^
[  8%] Building CXX object CMakeFiles/nodes.dir/src/ConnectionGeometry.cpp.obj
D:\workplace\_nodeeditor\src\ConnectionGeometry.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "ConnectionGeometry.hpp"
 ^
[ 10%] Building CXX object CMakeFiles/nodes.dir/src/ConnectionGraphicsObject.cpp.obj
D:\workplace\_nodeeditor\src\ConnectionGraphicsObject.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "ConnectionGraphicsObject.hpp"
 ^
[ 11%] Building CXX object CMakeFiles/nodes.dir/src/ConnectionPainter.cpp.obj
D:\workplace\_nodeeditor\src\ConnectionPainter.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "ConnectionPainter.hpp"
 ^
[ 13%] Building CXX object CMakeFiles/nodes.dir/src/ConnectionState.cpp.obj
D:\workplace\_nodeeditor\src\ConnectionState.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "ConnectionState.hpp"
 ^
[ 15%] Building CXX object CMakeFiles/nodes.dir/src/ConnectionStyle.cpp.obj
D:\workplace\_nodeeditor\src\ConnectionStyle.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "ConnectionStyle.hpp"
 ^
[ 16%] Building CXX object CMakeFiles/nodes.dir/src/DataModelRegistry.cpp.obj
D:\workplace\_nodeeditor\src\DataModelRegistry.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "DataModelRegistry.hpp"
 ^
[ 18%] Building CXX object CMakeFiles/nodes.dir/src/FlowItemInterface.cpp.obj
D:\workplace\_nodeeditor\src\FlowItemInterface.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "FlowItemInterface.hpp"
 ^
[ 20%] Building CXX object CMakeFiles/nodes.dir/src/FlowScene.cpp.obj
D:\workplace\_nodeeditor\src\FlowScene.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "FlowScene.hpp"
 ^
[ 22%] Building CXX object CMakeFiles/nodes.dir/src/FlowView.cpp.obj
D:\workplace\_nodeeditor\src\FlowView.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "FlowView.hpp"
 ^
[ 23%] Building CXX object CMakeFiles/nodes.dir/src/FlowViewStyle.cpp.obj
D:\workplace\_nodeeditor\src\FlowViewStyle.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "FlowViewStyle.hpp"
 ^
[ 25%] Building CXX object CMakeFiles/nodes.dir/src/Node.cpp.obj
D:\workplace\_nodeeditor\src\Node.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "Node.hpp"
 ^
[ 27%] Building CXX object CMakeFiles/nodes.dir/src/NodeConnectionInteraction.cpp.obj
D:\workplace\_nodeeditor\src\NodeConnectionInteraction.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "NodeConnectionInteraction.hpp"
 ^
[ 28%] Building CXX object CMakeFiles/nodes.dir/src/NodeDataModel.cpp.obj
D:\workplace\_nodeeditor\src\NodeDataModel.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "NodeDataModel.hpp"
 ^
[ 30%] Building CXX object CMakeFiles/nodes.dir/src/NodeGeometry.cpp.obj
D:\workplace\_nodeeditor\src\NodeGeometry.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "NodeGeometry.hpp"
 ^
[ 32%] Building CXX object CMakeFiles/nodes.dir/src/NodeGraphicsObject.cpp.obj
D:\workplace\_nodeeditor\src\NodeGraphicsObject.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "NodeGraphicsObject.hpp"
 ^
[ 33%] Building CXX object CMakeFiles/nodes.dir/src/NodePainter.cpp.obj
D:\workplace\_nodeeditor\src\NodePainter.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "NodePainter.hpp"
 ^
[ 35%] Building CXX object CMakeFiles/nodes.dir/src/NodeState.cpp.obj
D:\workplace\_nodeeditor\src\NodeState.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "NodeState.hpp"
 ^
[ 37%] Building CXX object CMakeFiles/nodes.dir/src/NodeStyle.cpp.obj
D:\workplace\_nodeeditor\src\NodeStyle.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "NodeStyle.hpp"
 ^
[ 38%] Building CXX object CMakeFiles/nodes.dir/src/Properties.cpp.obj
D:\workplace\_nodeeditor\src\Properties.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "Properties.hpp"
 ^
[ 40%] Building CXX object CMakeFiles/nodes.dir/src/StyleCollection.cpp.obj
D:\workplace\_nodeeditor\src\StyleCollection.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "StyleCollection.hpp"
 ^
[ 42%] Building CXX object CMakeFiles/nodes.dir/qrc_resources.cpp.obj
D:\workplace\_nodeeditor\build\qrc_resources.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 /****************************************************************************
 ^
[ 44%] Building CXX object CMakeFiles/nodes.dir/nodes_autogen/moc_compilation.cpp.obj
D:\workplace\_nodeeditor\build\nodes_autogen\moc_compilation.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 /* This file is autogenerated, do not edit*/
 ^
[ 45%] Linking CXX shared library bin\libnodes.dll
[ 45%] Built target nodes
Scanning dependencies of target connection_colors_autogen
[ 47%] Automatic MOC for target connection_colors
Generating MOC source connection_colors_autogen/EWIEGA46WW/moc_models.cpp
Generating MOC compilation connection_colors_autogen/moc_compilation.cpp
[ 47%] Built target connection_colors_autogen
Scanning dependencies of target connection_colors
[ 49%] Building CXX object examples/connection_colors/CMakeFiles/connection_colors.dir/main.cpp.obj
D:\workplace\_nodeeditor\examples\connection_colors\main.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include <QtWidgets/QApplication>
 ^
[ 50%] Building CXX object examples/connection_colors/CMakeFiles/connection_colors.dir/models.cpp.obj
D:\workplace\_nodeeditor\examples\connection_colors\models.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "models.hpp"
 ^
[ 52%] Building CXX object examples/connection_colors/CMakeFiles/connection_colors.dir/connection_colors_autogen/moc_compilation.cpp.obj
D:\workplace\_nodeeditor\build\examples\connection_colors\connection_colors_autogen\moc_compilation.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 /* This file is autogenerated, do not edit*/
 ^
[ 54%] Linking CXX executable ..\..\bin\connection_colors.exe
CMakeFiles\connection_colors.dir/objects.a(main.cpp.obj):main.cpp:(.text$_ZSt11make_uniqueI14NaiveDataModelIEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueI14NaiveDataModelIEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x4a): undefined reference to `QtNodes::StyleCollection::nodeStyle()'
CMakeFiles\connection_colors.dir/objects.a(moc_compilation.cpp.obj):moc_compilation.cpp:(.text$_ZNK14NaiveDataModel5cloneEv[__ZNK14NaiveDataModel5cloneEv]+0x49): undefined reference to `QtNodes::StyleCollection::nodeStyle()'
collect2.exe: error: ld returned 1 exit status
examples\connection_colors\CMakeFiles\connection_colors.dir\build.make:155: recipe for target 'bin/connection_colors.exe' failed
mingw32-make[2]: *** [bin/connection_colors.exe] Error 1
CMakeFiles\Makefile2:185: recipe for target 'examples/connection_colors/CMakeFiles/connection_colors.dir/all' failed
mingw32-make[1]: *** [examples/connection_colors/CMakeFiles/connection_colors.dir/all] Error 2
makefile:82: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

Crash on Load of a new node graph

Hi, awesome product with one small issue:

The Node editor calculator example crashes when loading a second .flow file after an initial load. loading a new graph in its place causes an memory access violation whenever FlowScene::load() calls _connections.clear();

I'm using Visual Studio 2015 Community on Windows 10 with Qt 5.7.

Showcase section in readme

I was thinking it might be nice (for you and your users) to have a "showcase" section in the readme showcasing some of the projects that use your library.

It would show that it is actually well used and that it is chosen by other developers.

What do you think? If you're OK with it I'll file a PR adding chigraph to it...

Replace std::cout with QMessageLogger or other logging

Currently, there are 4 places which stream to std::cout (one of them is commented out):

  • src/ConnectionGraphicsObject.cpp: std::cout << "Remove ConnectionGraphicsObject from scene" << std::endl;
  • src/Properties.cpp: //std::cout << "Properties already have a value with the name '"
  • src/Connection.cpp: std::cout << "Connection destructor" << std::endl;
  • src/Node.cpp: std::cout << "Node destructor" << std::endl;

These clutter stdout. Either they should be removed, or replaced with the QMessageLogger system.

For example:

Node::
~Node()
{
  qCInfo(QLoggingCategory("QtNodes")) << "Node destructor";
}

This way, users of the library could customize the output of the log messages if necessary. The exact way of initializing the QLoggingCategory might have to be different, but a quick test shows that this seems to work with qInstallMessageHandler()

Marquee Selection

It would be nice to be able to select nodes in a marquee selection.

Left-click is currently used for moving the viewport + nodes, so maybe right click for marquee?

Issues with Geometry

I don't fully understand what is going on with the scene geometry. For example, if (in the flow view) I want to place a node's center under the mouse cursor:

auto pos = this->mapToScene(event->pos());
auto shift = _scene->getNodeSize(node) / 2.f;
pos = {pos.x() - shift.width(), pos.y() - shift.height()};
_scene->setNodePosition(node, pos);

This works correctly. However, with this code, nodes are off:

auto pos = this->mapToScene(event->pos());
auto shift = node.nodeGraphicsObject().boundingRect().size() / 2.f; // wrong?
pos = {pos.x() - shift.width(), pos.y() - shift.height()};
_scene->setNodePosition(node, pos);

Similarly, if I do something like this:

fitInView(scene()->itemsBoundingRect(), Qt::KeepAspectRatio);

I would expect all nodes to fit in the view nicely. Instead, the zoom is too strong and also the view is somewhat displaced. Why does the QGraphicsScene get the bounding rectangle wrong?

Save Button Doesn't Work

Does the "Save.." button work for anyone in the Calculator example? I looked at the main.cpp in the calculator subdirectory and it seems like FlowScene::save() should save the graph in some sort of .flow file. Does anyone know whether they are able to save their graphs?

Rework source tree

The current way of implementing the headers in the include folder makes the use of installed library impossible. This must be reworked to the structure as follows:

include/
    nodes/
        public *.hpp files
src/
    private *.hpps
    *.cpps
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39584618-rework-source-tree?utm_campaign=plugin&utm_content=tracker%2F34672389&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F34672389&utm_medium=issues&utm_source=github).

Troubles with CMake

I am new to cmake and am trying to get the calculator example running for the first time.

Here is a step by step of what I did to try to compile and run the example:

  1. Within the calculator example directory (Where the CMakeLists.txt file is located) I created a subdirectory -> mkdir build
  2. cd build
  3. cmake ..
  4. make

After running make I get this error:

fatal error: QtCore/QObject: No such file or directory
 #include <QtCore/QObject>
                          ^
compilation terminated.
make[2]: *** [CMakeFiles/calculator.dir/ModuloModel.o] Error 1
make[1]: *** [CMakeFiles/calculator.dir/all] Error 2
make: *** [all] Error 2

I am not sure what the right way to go about setting the include paths for the Qt libraries. Any help would be appreciated.

Bounding boxes don't match node visuals

When selecting nodes, it seems to be that the "hitbox" for the nodes are way bigger than the visuals for the node:

boundingbox

This is especially annoying when trying to select a connection that connects to the same node (yeah that's actually useful in chigraph, think looping):
boundingbox2

Resizing Nodes can turn them invisible

invisiblenodes

This was tested on an xubuntu14.04 machine.

When a node is rendered invisible the console is spammed with messages from the QPainter about being not active. E.g.:

QPainter::end: Painter not active, aborted

Dynamic In and Out ports

Is there any way to dynamically change the number of In and Out ports on a node that has already been created?

Scrolling issue

The scrolling issue (outlined in the readme) where you have to move nodes to resize the scene is really annoying, and I found a fix for it.

	mView->setSceneRect(-320000, -320000, 640000, 640000);
	mView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	mView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

Just makes the scene huge and turns scrollbars off. Not super clean, but the best way to do it.

http://stackoverflow.com/questions/19207153/how-to-pan-beyond-the-scrollbar-range-in-a-qgraphicsview

Output duplication

From the examples, it seems that there cannot be two outbound edges coming from the same port of a node. Is this a hard limitation on the library or could it be easily lifted ? (Or I just couldn't manage to do it).

Thanks !

Runtime-defined node types

A useful feature (at least for me) would be runtime-defined types. As of right now, only subclasses of NodeDataModel (that must be defined at compile time) can be used as node types.

I am willing to form a PR for this with a little guidance on how this should be implemented.

Want to back this issue? ** Post a bounty on it!** We accept bounties via Bountysource.

C++14 with CI

I know you had troubles with travis+newer compilers.

You should check out https://github.com/mikkeloscar/arch-travis which sets up a archlinux chroot inside the VM. This is useful because arch has really new packages (clang 3.9, g++ 6.2.1)

That's what I use for chigraph and it's really nice :).

The builds do take a bit longer (90ish seconds)

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39466792-c-14-with-ci?utm_campaign=plugin&utm_content=tracker%2F34672389&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F34672389&utm_medium=issues&utm_source=github).

Use JSON-based graphical style settings

It seems there is no way to make use of Qt Stylesheets for setting the colors and linewidths for Nodes and Connections.

I think it would be sufficient to set styles in the form of JSON documents:

NodeStyle::setStyle({  "CornerRadius" : 5,
                       "Color" : [ 100, 100, 0 ],
                       "TextColor : [ 255, 255, 255 ],
                       "BorderColor : [ 10, 10, 255 ]
                       "FontSize" : 12
                    });

Common namespace/prefix to class names

It would be cleaner if you had a common prefix to classes (like Qt has the Q prefix, KF5 has the K prefix, etc) or were in a namespace (like the standard library) to be able to differentiate from classes not in your library.

The plus of putting them in a namespace is that people who want the same behavior as before can use insert a using namespace XXX statement.

Just some food for thought

Suggestion: downgrade to c++11 anf Qt 5.2

Hi,

First of all, thanks for this very nice piece of software.
I am currently working on Ubuntu 14.04 (I am stacked to that version for several reasons).

I had to do some changes to downgrade the code. Not many indeed.
Would you be interested to "downgrade" your requirements to allow a broader availability of your library?

I can send you a Pull request, if you agree.

Cheers

Davide

Programmatic node creation ?

Hello,

I have the following case in my software: the main structure I manipulate is a time-line

Now, for some of the relationships I have on the time-line, I'd like to get a visual representation with nodeeditor (that the user wouldn't really be able to change). But the examples seem to imply that creating nodes should only be done from the GUI.

What would be the best way to create nodes from code, layout them in the scene, add connections? thanks

Add Qwidget to each port?

Hi. First of all, thanks for this fantastic library!

I've recently started to use it, but , for my needs, I would need to show some data in each port
blueprint
This is from Unreal Blueprint editor, but you can get the idea, show some data between the port name and the port connection...

Is it possible to do something like this?. I'm looking at the source code, but some clues from you would be great.

Thanks in advance

Some nodes don't show captions when they are long

I've noticed that some nodes don't show captions or even port labels if they are too long.

For example, if you change SubtractionModel::caption in SubtractionModel.hpp to:

return QString("Subtraction1233456789012345678901234567890");

It appears like this:

spectacle ns8848

I haven't really looked at the rendering code yet, so I don't know where to look to form a PR.

Interestingly enough, it is dependent on the embeddedWidget. All of the below nodes have the caption somelongstring:

spectacle wz8848

yet only the one with the embedded widget has the caption...

I think the trust should be put in the developer for not creating a name that is too long (I have had this issue with significantly shorter names and it makes things quite unreadable)

Crash: Attempting to connect an input node into self output node

There is a crash when attempting to connect nodes to an output node contained on itself. For example doing something like:

node_editor_crash

Is this expected behavior? I would think that connecting an input node to an output node should be invalid and it should just ignore the attempted connection.

Locking the psoition of Nodes and Connections

I need to implement a feature to lock/unlock the position of Connections and Nodes (and prevent deleting).

I can work on it myself and send you a PR, it you agree with this enhancement.

  • In which class would you add these methods? Node, NodeGeometry or NodeGraphicObject?

For the records, I would prefer the latter, but it is just personal taste. This is your code, you decide ;)

Headless Mode

I experimented a bit with your library and it seems that I can only run in interactive mode (Showing the editor). It would be cool if I could design a flow in the editor, save it to a file and run the saved file without the need for the editor itself.

For example: The unreal engine uses a similar editor system called "Blueprints" where you can visually design program flow. But after shipping, the editor itself is not needed anymore and the generated files can be interpreted by it's own.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.