Blender DAG node graph
-
- Knows some wx things
- Posts: 39
- Joined: Fri Feb 02, 2018 1:48 pm
Blender DAG node graph
Here's an example:
I've thought of a couple ways to do this:
1. Each node is a wxPanel that is absolutely positioned (even though technically wxWidgets doesn't allow overlapping panels, I had them work in all backends I wanted to support fine). The lines between them are drawn on the parent panel with wxDC.
2. The entire thing is custom drawn a single panel with OpenGL, and all lines as well.
The first approach would seem to work, although I don't think it would be practical to get the "dots" on the side to be drawn natively without a lot of hacks.
The second approach would overall be more flexible but would cost the program some nativeness points.
I've thought of a couple ways to do this:
1. Each node is a wxPanel that is absolutely positioned (even though technically wxWidgets doesn't allow overlapping panels, I had them work in all backends I wanted to support fine). The lines between them are drawn on the parent panel with wxDC.
2. The entire thing is custom drawn a single panel with OpenGL, and all lines as well.
The first approach would seem to work, although I don't think it would be practical to get the "dots" on the side to be drawn natively without a lot of hacks.
The second approach would overall be more flexible but would cost the program some nativeness points.
Re: Blender DAG node graph
Is this a question?
If yes, go 100% custom drawn. When using panels you're limited by their rectangular shape and you might get redraw / flicker issues.
If yes, go 100% custom drawn. When using panels you're limited by their rectangular shape and you might get redraw / flicker issues.
Use the source, Luke!
Re: Blender DAG node graph
Hi,
Or even better - use the existing library for that. wxShapeFramework comes to mind but its not the only one.
Thank you.
Or even better - use the existing library for that. wxShapeFramework comes to mind but its not the only one.
Thank you.
-
- Knows some wx things
- Posts: 39
- Joined: Fri Feb 02, 2018 1:48 pm
Re: Blender DAG node graph
I don't need the prettiness, native doesn't really often intersect with "pretty". I simply need an intuitive UI.
Going custom also means I'd have to remake every single text, number, combo input. I don't want that because that means putting two separate GUIs in one program with different behaviours, that's even worse than Qt!
EDIT: Although technically if I have a custom drawn wxPanel per node, I can sorta do this with existing controls, might go for that technique, then.
Re: Blender DAG node graph
Hi,
Also, remember - if you are doing Windows you will limit yourself with 32K controls (windows window id limitation). Which in practice will be even less since you will have other windows, menus, dialogs, etc.
wxShapeFramework might be a good choice.
If not - there are others: see complete list here.
Thank you.
Also, remember - if you are doing Windows you will limit yourself with 32K controls (windows window id limitation). Which in practice will be even less since you will have other windows, menus, dialogs, etc.
wxShapeFramework might be a good choice.
If not - there are others: see complete list here.
Thank you.
-
- Knows some wx things
- Posts: 39
- Joined: Fri Feb 02, 2018 1:48 pm
Re: Blender DAG node graph
You're not giving me any alternative to text, number, combo boxes; this is a requirement, along with it to be just as native. If I wanted the above I would've went with Qt.ONEEYEMAN wrote: ↑Thu Aug 22, 2019 6:24 pm Hi,
Also, remember - if you are doing Windows you will limit yourself with 32K controls (windows window id limitation). Which in practice will be even less since you will have other windows, menus, dialogs, etc.
wxShapeFramework might be a good choice.
If not - there are others: see complete list here.
Thank you.
Re: Blender DAG node graph
Well wxSF does support text/numbers (I presume you are talking about wxStaticText here). However combo boxes are not supported.Midnightas wrote: ↑Thu Aug 22, 2019 8:48 pmYou're not giving me any alternative to text, number, combo boxes; this is a requirement, along with it to be just as native. If I wanted the above I would've went with Qt.ONEEYEMAN wrote: ↑Thu Aug 22, 2019 6:24 pm Hi,
Also, remember - if you are doing Windows you will limit yourself with 32K controls (windows window id limitation). Which in practice will be even less since you will have other windows, menus, dialogs, etc.
wxShapeFramework might be a good choice.
If not - there are others: see complete list here.
Thank you.
But it will be easy to implement them in terms of the framework you choose.
I plan to do that myself in the near future.
Thank you.
-
- Knows some wx things
- Posts: 39
- Joined: Fri Feb 02, 2018 1:48 pm
Re: Blender DAG node graph
No, I'm talking about native boxes where the user can input data themselves, not wxStaticText. Just like in the Blender picture above.
Re: Blender DAG node graph
Ah, OK.
Then you will need to implement it yourself.
I doubt it is too hard. You can probably look at the wxUniversal and see how it is done there.
Remember - Windows has a limitation on the number of control that can be created, since every control is connected to the id, which is declared as I believe unsigned integer (wxWindowID).
Also, I think if you look at MS Access Query design view, you will see that the tables there is custom drawn "control" and not a scrolled panels.
Thank you.
Then you will need to implement it yourself.
I doubt it is too hard. You can probably look at the wxUniversal and see how it is done there.
Remember - Windows has a limitation on the number of control that can be created, since every control is connected to the id, which is declared as I believe unsigned integer (wxWindowID).
Also, I think if you look at MS Access Query design view, you will see that the tables there is custom drawn "control" and not a scrolled panels.
Thank you.
-
- Super wx Problem Solver
- Posts: 469
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: Blender DAG node graph
One way to do this using the renderer/editor division of labor. wxWidgets uses this for wxGrid, wxDataViewCtrl, and wxPropgrid. The idea is to bring up the editor (the spin control, text control, combo box, or whatever control used to edit the data) only when it is needed. That way you don't have to use thousands of windows. The rest of the time, the tenderer is used to display the data. If you want, you can use wxRenderNative to make it look like the data is displayed in the control used to edit it.Midnightas wrote: ↑Thu Aug 22, 2019 9:09 pm No, I'm talking about native boxes where the user can input data themselves, not wxStaticText. Just like in the Blender picture above.
-
- Knows some wx things
- Posts: 39
- Joined: Fri Feb 02, 2018 1:48 pm
Re: Blender DAG node graph
That is a mighty fancy optimization, I'll do that once it goes through the prototype stage.New Pagodi wrote: ↑Thu Aug 22, 2019 10:07 pm One way to do this using the renderer/editor division of labor. wxWidgets uses this for wxGrid, wxDataViewCtrl, and wxPropgrid. The idea is to bring up the editor (the spin control, text control, combo box, or whatever control used to edit the data) only when it is needed. That way you don't have to use thousands of windows. The rest of the time, the tenderer is used to display the data. If you want, you can use wxRenderNative to make it look like the data is displayed in the control used to edit it.
I came across that class before but I guessed: I assume I have to draw text separately from the actual textbox (DrawTextCtrl then DrawText)?
Re: Blender DAG node graph
AFAIU no, it should be as simple as setting up a native control, then use it as the first argument in the corresponding DrawXXX() method,Midnightas wrote: ↑Fri Aug 23, 2019 8:18 amI assume I have to draw text separately from the actual textbox (DrawTextCtrl then DrawText)?
i.e. for a text control use it from a paint event handler with wxRendererNative::Get().DrawTextCtrl(myTextCtrl, ...)
There is also a 'render' sample that might help.
-
- In need of some credit
- Posts: 5
- Joined: Mon Jun 15, 2020 12:43 am
Re: Blender DAG node graph
Hi,
You can try imGui, here's a nice example of a node-based editor implementation: https://github.com/thedmd/imgui-node-editor
I don't know how hard to integrate it into wxWidgets though...
Cheers,
Imre
You can try imGui, here's a nice example of a node-based editor implementation: https://github.com/thedmd/imgui-node-editor
I don't know how hard to integrate it into wxWidgets though...
Cheers,
Imre
Re: Blender DAG node graph
I found a wxWidgets based project, which has a node editor, see here:
pulkomandy/RapidoFSM: Graphical finite state machine editor with code generator. — https://github.com/pulkomandy/RapidoFSM
You can see the image shot of the application in its github home page.
pulkomandy/RapidoFSM: Graphical finite state machine editor with code generator. — https://github.com/pulkomandy/RapidoFSM
You can see the image shot of the application in its github home page.
-
- In need of some credit
- Posts: 5
- Joined: Mon Jun 15, 2020 12:43 am
Re: Blender DAG node graph
Nice, I haven't seen this one!
I tried https://code.google.com/archive/p/wxworkspaceview/ back then, but didn't scale well, because it was using the OS's native GUI drawing functionality, and those are always slower than low level (OpenGL) solutions.
That being said, I'd love to see it in action.
Cheers,
Imre
I tried https://code.google.com/archive/p/wxworkspaceview/ back then, but didn't scale well, because it was using the OS's native GUI drawing functionality, and those are always slower than low level (OpenGL) solutions.
That being said, I'd love to see it in action.
Cheers,
Imre