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

Radium dataflow #1007

Draft
wants to merge 204 commits into
base: release-candidate
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
f3a6363
[externals] Add Dataflow external stduuid
MathiasPaulin Sep 7, 2022
73b0f6d
[core] add random point sets
MathiasPaulin Sep 7, 2022
0aa8ee1
[unittests][core] add tests on random point sets
MathiasPaulin Sep 7, 2022
531efb2
[core] improve type utilities : add type traits utility and fix type …
MathiasPaulin Oct 2, 2022
f7a8dbd
[cmake] Allows configuring INTERFACE library (e.g. header only)
MathiasPaulin Sep 7, 2022
d578a0b
[scripts] generation of filelist is allows filelist per subdirectory
MathiasPaulin Sep 7, 2022
c4e486e
[dataflow-core] first commit of dataflow component
MathiasPaulin Sep 7, 2022
d49b0fd
[examples][dataflow] add helloDataflow example
MathiasPaulin Sep 7, 2022
3212616
[examples][dataflow] add graph serialization example
MathiasPaulin Oct 17, 2022
9776101
[dataflow-qtgui] add QtGui subcomponent
MathiasPaulin Oct 17, 2022
463e71d
[examples][dataflow] add dataflow graph editor example
MathiasPaulin Oct 17, 2022
63626e7
[dataflow-cmake] fix install of dataflow components
MathiasPaulin Sep 21, 2022
2283871
[dataflow-cmake] add missing precompilation header
MathiasPaulin Sep 29, 2022
1d5c7db
[dataflow-core] fix source nodes
MathiasPaulin Sep 29, 2022
826dc6c
[dataflow-rendering] add rendergraph subcomponent
MathiasPaulin Sep 29, 2022
761b071
[dataflow-all] improve serialization
MathiasPaulin Oct 2, 2022
2cdbc5e
[dataflow-core] improve type demangling for dataflow graph
MathiasPaulin Oct 2, 2022
539c5fa
[examples][dataflow] fix compilation of HelloGraph
MathiasPaulin Oct 3, 2022
cc1dc44
[dataflow] introduced function communication between nodes
MathiasPaulin Oct 3, 2022
7c7f005
[dataflow] better management of dataSetters for interface port
MathiasPaulin Oct 4, 2022
73f5eb9
[dataflow] Simplify code structure and node instanciation
MathiasPaulin Oct 4, 2022
5cd00f3
[dataflow] TODO on builtinsNodes
MathiasPaulin Oct 5, 2022
0efc543
[dataflow] make QtNodeEditor an external under then name RadiumNodeEd…
MathiasPaulin Oct 5, 2022
f59b28b
[dataflow] simplifies a bit Node interface
MathiasPaulin Oct 5, 2022
9365cb1
[dataflow] make port construction more robust
MathiasPaulin Oct 5, 2022
c3d4b3e
[dataflow] accelerate compilation
MathiasPaulin Oct 5, 2022
6994245
[dataflow] disable rendering graph
MathiasPaulin Oct 6, 2022
2260f3f
[dataflow] improve graph compilation/execution robustness
MathiasPaulin Oct 6, 2022
6b2420f
[dataflow] improve functionals
MathiasPaulin Oct 6, 2022
22a4c38
[example] add dataflow functionals example
MathiasPaulin Oct 6, 2022
ff448c9
[dataflow] remove uneeded includes
MathiasPaulin Oct 6, 2022
a46634b
[dataflow] improve compilation robustness
MathiasPaulin Oct 6, 2022
6ec02fb
[dataflow] add reduce operator
MathiasPaulin Oct 6, 2022
39991c6
[example] add test on reduce operator
MathiasPaulin Oct 6, 2022
df86aaa
[dataflow] improve node's type readability
MathiasPaulin Oct 10, 2022
83877eb
[examples][dataflow] remove unneeded include
MathiasPaulin Oct 10, 2022
5fc87e1
[dataflow] unify Sources, Sinks and Functional nodes declaration and …
MathiasPaulin Oct 10, 2022
fdc1a73
[dataflow-core] add generic binary operator node
MathiasPaulin Oct 10, 2022
0ffa66f
[unittests][dataflow] add first dataflow node unit tests
MathiasPaulin Oct 10, 2022
7b18c85
[dataflow] remove dead code and fix some method profile
MathiasPaulin Oct 11, 2022
a99bceb
[dataflow] add homogeneous BinaryOpNode on CoreDataType to standard f…
MathiasPaulin Oct 11, 2022
8a47cf0
[unittests][dataflow] add graph load/save tests
MathiasPaulin Oct 11, 2022
01d64be
[dataflow][rendering] improve codacy report
MathiasPaulin Oct 11, 2022
964cb73
[dataflow][examples] improve codacy report
MathiasPaulin Oct 11, 2022
9527d1c
[unittests][dataflow] improve codacy report
MathiasPaulin Oct 11, 2022
9cf2490
[unittests][dataflow] improve codacy report
MathiasPaulin Oct 11, 2022
6e5726a
[dataflow] fix wrong log message
MathiasPaulin Oct 11, 2022
07e911c
[tests] improve coverage of builtins node
MathiasPaulin Oct 11, 2022
41f79b9
[dataflow-core] improve nodes
MathiasPaulin Oct 11, 2022
9439c3a
[example] include what is needed
MathiasPaulin Oct 11, 2022
903490d
[unittests] add unit tests on sources and sinks
MathiasPaulin Oct 11, 2022
0e4411d
[unittests] update unit tests on sources and sinks
MathiasPaulin Oct 12, 2022
f30d406
[unittests] add unit tests on custom nodes
MathiasPaulin Oct 12, 2022
55e18f3
[dataflow] fix some inconsistencies in the code while improving cover…
MathiasPaulin Oct 12, 2022
153c8e3
[dataflow] improve source code readability.
MathiasPaulin Oct 13, 2022
44da72d
[tests] add graph inspection unittest
MathiasPaulin Oct 17, 2022
a7fe6af
[dataflow] make it compiles on Windows
MathiasPaulin Oct 13, 2022
84fdca7
[tests] simplify unittests on predefined nodes
MathiasPaulin Oct 14, 2022
789fcdf
[dataflow] improve logging and error management
MathiasPaulin Oct 14, 2022
5467791
[tests] improve logging and error management
MathiasPaulin Oct 14, 2022
2327a16
[examples] fix snippet comments in HelloGraph
MathiasPaulin Oct 14, 2022
521d606
[dataflow-core] improve class and namespace documentation
MathiasPaulin Oct 20, 2022
bef78be
[examples] fix snippet labels
MathiasPaulin Oct 20, 2022
8825014
[doc] add first documentation about node system
MathiasPaulin Oct 20, 2022
993cabc
[doc] node system typos.
dlyr Oct 25, 2022
24c4f4c
[core] rename constexpr in Random utilities
MathiasPaulin Oct 25, 2022
5645b51
[tests] fix some typos on dataflow unittests and add doc snippets
MathiasPaulin Oct 25, 2022
2e8df1b
[doc] use snippets from unittests
MathiasPaulin Oct 25, 2022
277ba8a
[externals] update externals configuration
MathiasPaulin Nov 1, 2022
d92963e
[dataflow] update configuration files
MathiasPaulin Nov 1, 2022
bee49b1
[dataflow-core] remove unwanted error messages
MathiasPaulin Nov 2, 2022
e7d003f
[dataflow-qtgui] improve contextual menu on node editor
MathiasPaulin Nov 2, 2022
34b6007
[dataflow-qtgui] improve editable parameter gui and add TODO
MathiasPaulin Nov 2, 2022
2c8e3ff
[dataflow-core] allow sources and sinks to customize their interface …
MathiasPaulin Nov 3, 2022
60a7622
[dataflow] remove unneeded indicator
MathiasPaulin Nov 3, 2022
3d536a8
[dataflow-core] improve simplified type demangler
MathiasPaulin Nov 3, 2022
b237194
[dataflow-core] fix comment typo
MathiasPaulin Nov 3, 2022
78e91c6
[dataflow-core] Fix singleton (static) initialization order to allow …
MathiasPaulin Nov 3, 2022
a68e480
[dataflow-core] allow to load any graph registered in a factory witho…
MathiasPaulin Nov 3, 2022
1a6da49
[examples] allow to load any graph registered in a factory without kn…
MathiasPaulin Nov 3, 2022
4b01f86
[dataflow] fix typo in macro to generate code :(
MathiasPaulin Nov 3, 2022
9e0cc49
[dataflow-core] add state flag to dataflowgraph
MathiasPaulin Nov 4, 2022
ee88795
[dataflow-qtgui] add graph editor window as an available dataflow::qt…
MathiasPaulin Nov 4, 2022
7a289f4
[examples] Simplify graph editor example
MathiasPaulin Nov 4, 2022
7e401d6
forget to install pre-commit -- fix format after installing
MathiasPaulin Nov 4, 2022
f885baf
[dataflow-core] improve auto initialization of libraries
MathiasPaulin Nov 4, 2022
33a3dad
[dataflow-core] Add documentation about some type conflict in port sy…
MathiasPaulin Nov 4, 2022
1d90aa2
[dataflow-core] Workaround for the way the Qt Node Editor manage graphs.
MathiasPaulin Nov 4, 2022
97ede2d
[dataflow-qtgui] Workaround for the way the Qt Node Editor manage gra…
MathiasPaulin Nov 4, 2022
a50ba51
[dataflow-qtgui] add missing dllexport
MathiasPaulin Nov 4, 2022
6ece211
[dataflow-qtgui] fix crash at app exit
MathiasPaulin Nov 5, 2022
332d600
[dataflow-core] modify node interface for better reporting.
MathiasPaulin Nov 5, 2022
d5bcb26
[tests] custom node update
MathiasPaulin Nov 6, 2022
7fe3387
[doc] fix typo
MathiasPaulin Nov 14, 2022
36d815a
[dataflow-core] prepare better ownership transfer
MathiasPaulin Nov 14, 2022
0ec86d7
[dataflow-core] refactor removeNode
MathiasPaulin Jan 11, 2023
554fe54
[unittests] refactor removeNode
MathiasPaulin Jan 11, 2023
67c6efe
[dataflow] explicitly transfer ownership when adding a node to the graph
MathiasPaulin Jan 31, 2023
5c96796
[unittests] explicitly transfer ownership when adding a node to the g…
MathiasPaulin Jan 31, 2023
9005faf
[examples] explicitly transfer ownership when adding a node to the graph
MathiasPaulin Jan 31, 2023
261b951
[dataflow-core] remove .inl files
MathiasPaulin Jan 31, 2023
9db8da8
[dataflow-qtgui] remove .inl files
MathiasPaulin Jan 31, 2023
a4ed791
[dataflow-core] fix codacy warning
MathiasPaulin Jan 31, 2023
2a620bb
[dataflow-core] improve trace and robustness
MathiasPaulin Feb 1, 2023
a547189
[dataflow-qtgui] improve robustness
MathiasPaulin Feb 1, 2023
c1a226f
[dataflow-qtgui] add constraints on powerslider when available
MathiasPaulin Feb 1, 2023
6d675d2
[dataflow-core] improve NodeFactoriesManager interface
MathiasPaulin Feb 2, 2023
554b901
[unittests] update to use NodeFactoriesManager interface
MathiasPaulin Feb 2, 2023
a98e362
[examples] update to use NodeFactoriesManager interface
MathiasPaulin Feb 2, 2023
419211c
[cmake] fix configuration issue for interface libraries on windows in…
MathiasPaulin Feb 2, 2023
d67923b
[dataflow-core] fix double deletion problem
MathiasPaulin Feb 2, 2023
c5f6a6b
[dataflow-core] fix memory leaks
MathiasPaulin Feb 2, 2023
f1822ac
[dataflow-core] remove compilation warning
MathiasPaulin Feb 2, 2023
1576263
[dataflow-core] improve error management
MathiasPaulin Feb 3, 2023
71b68e1
[unittests] improve coverage
MathiasPaulin Feb 3, 2023
6132b2c
[core] fix compilation warning
MathiasPaulin Feb 6, 2023
1325cdd
[dataflow-core] fix compilation warning
MathiasPaulin Feb 6, 2023
c784c0a
[dataflow-qtgui] fix compilation warning
MathiasPaulin Feb 6, 2023
5f7d97a
[dataflow] use std::type_index instead of hash for port type management
MathiasPaulin Feb 6, 2023
47edfe7
[dataflow] make Node's uuid generator private
MathiasPaulin Feb 6, 2023
e50da3c
[core] add type demangler from typeindex
MathiasPaulin Feb 6, 2023
2ca8a41
[dataflow] add type demangler from typeindex
MathiasPaulin Feb 6, 2023
2a260ad
[unittests] add test on type demangler from typeindex
MathiasPaulin Feb 6, 2023
6fc6caa
[core] add missing RA_CORE_API
MathiasPaulin Feb 6, 2023
5c731f2
[dataflow] add missing RA_DATAFLOW_API
MathiasPaulin Feb 6, 2023
0e2ff2b
[core] fix typeutils on windows
MathiasPaulin Feb 6, 2023
84766b5
[core] fix merge conflicts
MathiasPaulin Mar 17, 2023
2f436c8
[unittests] Simplify typeutils
MathiasPaulin Feb 8, 2023
4d6e263
[dataflow-core] Simplify type demangler
MathiasPaulin Feb 8, 2023
f2be55a
[dataflow-core] fix missing methods
MathiasPaulin Feb 8, 2023
21832de
[dataflow-core] fix missing methods on graph
MathiasPaulin Feb 8, 2023
39c91dc
[dataflow-core] specialize some sources
MathiasPaulin Feb 8, 2023
32c2d74
[unittests] improve coverage
MathiasPaulin Feb 8, 2023
31d003f
[dataflow-core] allows to access to a port through its name or index
MathiasPaulin Feb 10, 2023
f479cc9
[dataflow-core] simplify loading and json representation
MathiasPaulin Feb 10, 2023
a3184ba
[dataflow-core] modify default generated node creator functor
MathiasPaulin Feb 10, 2023
b554498
[dataflow-qtgui] fix crash when ending graph edition session
MathiasPaulin Feb 10, 2023
3e82770
[unittests] improve coverage for graph building and serialization
MathiasPaulin Feb 10, 2023
b0bdbd4
[dataflow-core] allows to force recompilation of a graph
MathiasPaulin Feb 10, 2023
1384da3
[unittests] update tests
MathiasPaulin Feb 10, 2023
3acecb7
[dataflow-qtGui] use Radium log
MathiasPaulin Feb 10, 2023
221bd73
[dataflow-core] try to fix random crash : sinkNode
MathiasPaulin Feb 13, 2023
b036dd6
[dataflow-core] try to fix random crash : Port
MathiasPaulin Feb 13, 2023
6fd1117
[dataflow-core] try to fix random crash : Node
MathiasPaulin Feb 13, 2023
91d1386
[dataflow-core] try to fix random crash : Graph
MathiasPaulin Feb 13, 2023
760a50f
[unittests] try to fix random crash
MathiasPaulin Feb 13, 2023
46f0384
[unittest] try to fix random crash
MathiasPaulin Feb 13, 2023
bc70677
[dataflow] remove dependency from stduuid external
MathiasPaulin Feb 24, 2023
954ce8f
[dataflow-core][tests] improve Radium types demangler
MathiasPaulin Mar 20, 2023
0eaa2cd
[dataflow-core][tests][examples] Node factory improvements
MathiasPaulin Mar 20, 2023
88b1ff1
[dataflow-core][dataflow-qtgui][tests] fix typos and profile for Data…
MathiasPaulin Mar 20, 2023
1f6c93e
[tests] fix missing const in dataflow graph test
MathiasPaulin Mar 20, 2023
dbb1684
[dataflow-qtgui] fix missing const in dataflow graph node access
MathiasPaulin Mar 20, 2023
6c5a7b4
[dataflow-core][tests] fix type demangler for __cxx11::basic_string o…
MathiasPaulin Mar 21, 2023
85b9d97
[gui] fix missing widget name
MathiasPaulin Mar 24, 2023
65b7275
[dataflow-core] use find_if instead of custom loop
MathiasPaulin Mar 24, 2023
3628c6a
[dataflow-qtgui] add widget
MathiasPaulin Mar 24, 2023
6aa514c
[dataflow-core] add a todo in Node.hpp
MathiasPaulin Apr 3, 2023
36a05fd
[dataflow-rendering] remove .inl in the Rendering package
MathiasPaulin Apr 4, 2023
e8e9800
[core] fix merge of Radium PR #1037
MathiasPaulin Apr 4, 2023
13c79d9
[engine] fix envmap computation when Scalar = double
MathiasPaulin Apr 4, 2023
573c27f
[core][tests] fix Random sequences when Scalar = double
MathiasPaulin Apr 4, 2023
11824ec
[dataflow-rendering] fix codacy for unused component
MathiasPaulin Apr 4, 2023
b98fa2a
[tests] fix random sequence when Scalar = double
MathiasPaulin Apr 4, 2023
71b425c
[general] format with new guidelines
pre-commit-ci[bot] Apr 5, 2023
09b83d0
[cmake][dataflow] update cmake min version to 3.18
MathiasPaulin Jun 30, 2023
b337356
[script] add Dataflow to list_dep
MathiasPaulin Sep 7, 2023
5c4b396
[doc] add Dataflow dependencies
MathiasPaulin Sep 7, 2023
352b683
[dataflow] Core use shared_ptr instead of unique+raw for nodes.
dlyr Sep 18, 2023
1c7b2c8
[dataflow] QtGui: update according to change ptr type of node.
dlyr Sep 18, 2023
ff52eea
[tests] Update dataflow unittests according to shared_ptr.
dlyr Sep 18, 2023
eafb57c
[examples] Update dataflow examples according to shared_ptr.
dlyr Sep 18, 2023
0cdc2d3
[dataflow] Start using port idx instead of ptr alias.
dlyr Sep 19, 2023
4564552
[dataflow] core, use const idx, add some comments, default json implem.
dlyr Sep 19, 2023
d91c476
[dataflow-core] small changes on node.
dlyr Sep 20, 2023
84859d0
[dataflow-core] Start using shared ptr for port
dlyr Sep 20, 2023
4c16782
[examples] start updating dataflow examples
dlyr Sep 20, 2023
06ee43e
[examples] simplify HelloGraph
dlyr Sep 20, 2023
7a96b54
[dataflow-core] Use pass by copy and move for set data.
dlyr Sep 20, 2023
71a5135
[examples][tests] Update according to setData
dlyr Sep 20, 2023
d7c007b
[dataflow-core] silently pass this in Node::add*Port
dlyr Sep 20, 2023
881557a
[dataflow-core] add some port getter constness.
dlyr Sep 20, 2023
6410807
[tests] test typo in comment
dlyr Sep 20, 2023
d01c05e
[dataflow-core] Wip on new addlink.
dlyr Sep 20, 2023
64199ed
[dataflow-core] Add PortOut ctor with data.
dlyr Sep 21, 2023
65479cd
[dataflow-core] use needsRecompile() to set bool values.
dlyr Sep 21, 2023
966a686
[dataflow-core] Add port getter, return index and ptr.
dlyr Sep 21, 2023
ecfc94e
[dataflow-core] add typed access to port
dlyr Sep 21, 2023
76aed8c
[examples] use typed add link in hellograph.
dlyr Sep 21, 2023
96d27d1
[dataflow-core] GetPort -> Get, move some method in protected.
dlyr Sep 22, 2023
da9f1f4
[dataflow-core] Node return type consistency
dlyr Sep 23, 2023
1e981be
[dataflow-core] Node serialization comments and messages.
dlyr Sep 23, 2023
5e85823
[dataflow-core] Function source refactor using port shared ptr.
dlyr Sep 23, 2023
14f5fbe
[dataflow-core] Use node ptr using and base json implem.
dlyr Sep 23, 2023
0449599
[dataflow-core] Refactor graph
dlyr Sep 23, 2023
e4dad05
[dataflow-core/qtgui] move shouldBeSave private.
dlyr Sep 23, 2023
daab700
[dataflow-core] remove node constexpr (not working, nor compiling wit…
dlyr Sep 23, 2023
11f93b4
fix
dlyr Sep 23, 2023
3443d96
[examples] HelloGraph with new addLink.
dlyr Sep 23, 2023
f03f52f
[dataflow-core] Add missing export on inner class.
dlyr Sep 23, 2023
d174d68
[dataflow-core] Use initialization list for ports.
dlyr Sep 23, 2023
de7395b
[dataflow-core] Clean code, addLink by index check existing port.
dlyr Sep 24, 2023
fcb5826
[dataflow-core] Some refactors
dlyr Sep 25, 2023
305c81a
[examples] Simplify HelloGraph and add GraphAsNode.
dlyr Sep 25, 2023
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
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ option(RADIUM_GENERATE_LIB_ENGINE "Include Radium::Engine in CMake project." ON)
option(RADIUM_GENERATE_LIB_GUI "Include Radium::Gui in CMake project." ON)
option(RADIUM_GENERATE_LIB_PLUGINBASE "Include Radium::PluginBase in CMake project." ON)
option(RADIUM_GENERATE_LIB_HEADLESS "Include Radium::Headless in CMake project." ON)
option(RADIUM_GENERATE_LIB_DATAFLOW "Include Radium::Dataflow* in CMake project." ON)
option(
RADIUM_UPDATE_VERSION
"Update version file each time the project is compiled (update compilation time in version.cpp)."
Expand Down Expand Up @@ -290,6 +291,7 @@ message_setting("RADIUM_GENERATE_LIB_CORE")
message_setting("RADIUM_GENERATE_LIB_ENGINE")
message_setting("RADIUM_GENERATE_LIB_GUI")
message_setting("RADIUM_GENERATE_LIB_HEADLESS")
message_setting("RADIUM_GENERATE_LIB_DATAFLOW")
message_setting("RADIUM_GENERATE_LIB_IO")
message_setting("RADIUM_GENERATE_LIB_PLUGINBASE")
string(REPLACE ";" " " COMPONENTS_LIST "${RADIUM_COMPONENTS}")
Expand Down
21 changes: 15 additions & 6 deletions cmake/RadiumSetupFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -966,18 +966,27 @@ function(configure_radium_library)
# add the cmake command to install target
add_custom_install_target(${ARGS_TARGET})

get_target_property(TargetType ${ARGS_TARGET} TYPE)
if(TargetType STREQUAL INTERFACE_LIBRARY)
set(PropertyQualifier INTERFACE)
else()
set(PropertyQualifier PUBLIC)
target_compile_definitions(${ARGS_TARGET} PRIVATE ${ARGS_TARGET}_EXPORTS)
endif()

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(${ARGS_TARGET} PUBLIC _DEBUG)
if(MSVC OR MSVC_IDE)
target_compile_definitions(${ARGS_TARGET} ${PropertyQualifier} _DEBUG)
if((MSVC OR MSVC_IDE) AND NOT (TargetType STREQUAL INTERFACE_LIBRARY))
install(FILES $<TARGET_PDB_FILE:${ARGS_TARGET}> DESTINATION bin)
endif()
endif()
target_compile_features(${ARGS_TARGET} PUBLIC cxx_std_17)

target_compile_features(${ARGS_TARGET} ${PropertyQualifier} cxx_std_17)
if(OPENMP_FOUND)
target_link_libraries(${ARGS_TARGET} PUBLIC OpenMP::OpenMP_CXX)
target_link_libraries(${ARGS_TARGET} ${PropertyQualifier} OpenMP::OpenMP_CXX)
endif(OPENMP_FOUND)
target_compile_definitions(${ARGS_TARGET} PRIVATE ${ARGS_TARGET}_EXPORTS)
target_include_directories(${ARGS_TARGET} PUBLIC $<INSTALL_INTERFACE:include/>)
target_include_directories(${ARGS_TARGET} ${PropertyQualifier} $<INSTALL_INTERFACE:include/>)

add_library(${ARGS_NAMESPACE}::${ARGS_TARGET} ALIAS ${ARGS_TARGET})

install(
Expand Down
3 changes: 3 additions & 0 deletions doc/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ These dependencies are shipped with radium, fetching external git sources.
* with options `-DOPTION_BUILD_TESTS=OFF -DOPTION_BUILD_DOCS=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>`
* nlohmann_json: https://github.com/nlohmann/json.git, [tags/v3.10.5],
* with options `-DJSON_Install=ON -DJSON_BuildTests=OFF`
* [Dataflow]
* RadiumNodeEditor: https://github.com/MathiasPaulin/RadiumQtNodeEditor.git, [main],
* with options `-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>`
<!-- (end script copy) -->

## TL;DR; command line version
Expand Down
Empty file added doc/basics/dependencies.md
Empty file.
1 change: 1 addition & 0 deletions doc/basics/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Currently supported (note that these paths must refer to the installation direct
* `OpenMesh_DIR`
* `cpplocate_DIR`
* `nlohmann_json_DIR`
* `RadiumNodeEditor_DIR`

<!-- (end script copy) -->

Expand Down
1 change: 1 addition & 0 deletions doc/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
* \subpage eventSystem
* \subpage pluginSystem
* \subpage forwardRenderer
* \subpage nodeSystem
71 changes: 71 additions & 0 deletions doc/concepts/dataflow/HelloGraph.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"instance": "helloGraph",
"model": {
"graph": {
"connections": [
{
"in_node": "Filter",
"in_port": "in",
"out_node": "Source",
"out_port": "to"
},
{
"in_node": "Filter",
"in_port": "f",
"out_node": "Selector",
"out_port": "f"
},
{
"in_node": "Sink",
"in_port": "from",
"out_node": "Filter",
"out_port": "out"
}
],
"factories": [],
"nodes": [
{
"instance": "Source",
"model": {
"name": "Source<RaVector<float>>"
},
"position": {
"x": -195.0,
"y": -82.0
}
},
{
"instance": "Selector",
"model": {
"name": "Source<function<bool (float const&)>>"
},
"position": {
"x": -279.0,
"y": 35.0
}
},
{
"instance": "Filter",
"model": {
"name": "Filter<RaVector<float>>"
},
"position": {
"x": 44.0,
"y": -45.0
}
},
{
"instance": "Sink",
"model": {
"name": "Sink<RaVector<float>>"
},
"position": {
"x": 267.0,
"y": 12.0
}
}
]
},
"name": "Core DataflowGraph"
}
}
199 changes: 199 additions & 0 deletions doc/concepts/nodesystem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
\page nodeSystem Radium node system
[TOC]

# Radium node system

Radium-Engine embed a node system allowing to develop computation graph using an adaptation of dataflow programming.
This documentation explain the concepts used in the node system and how to develop computation graph using the Core
node system and how to extend the Core node system to be used in specific Radium-Engine application or library.

## Structure and usage of the Radium::Dataflow component

When building the Radium-Engine libraries, the node system is available from the Radium::Dataflow component.
The availability of this component in the set of built/installed libraries is managed using the
`RADIUM_GENERATE_LIB_DATAFLOW` cmake option (set to `ON` by default) of the main Radium-Engine CMakeLists.txt.

The Radium::Dataflow component is a header-only library with is linked against three sub-components :

- **DataflowCore** library defining the Core node system and a set Core Nodes allowing to develop several computation
graph.
- **DataflowQtGui** library defining Qt based Gui elements to edit and interact with a computation graph.
- **DataflowRendering** library defining specific nodes to be used by a Graph-based renderer allowing to easily define
custom renderers.

When defining the CMakeLists.txt configuration file for an application/library that will build upon the node system,
The RadiumDataflow component might be requested in several way :

- `find_package(Radium REQUIRED COMPONENTS Dataflow)`. This will define the imported target `Radium::Dataflow` that
gives access to all the available sub-components at once but also through imported targets `Radium::DataflowCore`,
`Radium::DataflowQtGui` and `Radium::DataflowRendering`.
- `find_package(Radium REQUIRED COMPONENTS DataflowCore)`. This will define the imported target `Radium::DataflowCore`
only.
- `find_package(Radium REQUIRED COMPONENTS DataflowQtGui)`. This will define the imported target `Radium::DataflowQtGui`
only, with transitive dependencies on `Radium::DataflowCore`.
- `find_package(Radium REQUIRED COMPONENTS DataflowRendering)`. This will define the imported target
`Radium::DataflowRendering` only, with transitive dependencies on `Radium::DataflowCore`.

The targets that depends on a Dataflow components should then be configured as any target and linked against the
requested dataflow component, by, e.g, adding the line
`target_link_libraries(target_name PUBLIC Radium::Dataflow)` (or the only needed subcomponent).

## Concepts of the node system

The node system allow to build computation graph that takes its input from some _data source_ and store their results
in some _data sink_ after applying several _functions_ on the data.

Computation graphs can be serialized and un-serialized in json format. The serialization process is nevertheless limited
to serializable data stored on the node and it is of the responsibility of the application to manage non serializable
data such as, e.g. anonymous functions (lambdas, functors, ...) dynamically defined by the application.

The Radium node system relies on the following concepts

- _Node_ (see Ra::Dataflow::Core::Node for reference manual) : a node represent a function that will be executed on
several strongly typed input data, defining the definition domain of the function, to produce some strongly typed
output data, defining the definition co-domain of the function.

The input and output data are accessed through _ports_ allowing to connect nodes together to form a graph.

The node profile is implicitly defined by its domain and co-domain.

A node can be specialized to be a _data source_ node (empty domain) or a _data sink_ node (empty co-domain).
These specific nodes define the input and output of a complex _computation graph_

- _Port_ (see Ra::Dataflow::Core::PortBase for reference manual) : a port represent an element of the node
profile and allow to build the computation graph by linking ports together, implicitly defining _links_.

A port gives access to a strongly typed data and, while implementing the general Ra::Dataflow::Core::PortBase
interface should be specialized to be either an input port (element of the definition domain of a node) through the
instancing of the template Ra::Dataflow::Core::PortIn or to an output port (element of the definition
co-domain of a node) through the instancing of the template Ra::Dataflow::Core::PortOut.

When a node executes its function, it takes its parameter from its input ports and set the result on the output port.

An output port can be connected to an input port of the same _DataType_ to build the computation graph.
- _Graph_ (see Ra::Dataflow::Core::DataflowGraph for reference manual) : a graph is a set of node connected through
their ports so that they define a direct acyclic graph (DAG) representing a complex function. The DAG represents
connections from some _data source_ nodes to some _data sink_ nodes through

Once built by adding nodes and links, a graph should be _compiled_ so that the system verify its validity
(DAG, types, connections, ...).

Once compiled, a graph can be _executed_.
The input data of the computation graph should be set on the available _data sources_ of the graph and the results
fetched from the _data sinks_.

As a graph can be used as a node (a sub graph) in any other graph. When doing this, all _data sources_ and
_data sinks_ nodes are associated with _interface ports_ and these interface ports are added as _input_ or _output_
ports on the graph so that links can be defined using these ports.

_input_ and _output_ ports of a graph can also be accessed directly from the application using _data setters_ and
_data getters_ fetched from the graph. These _data setters_ and _data getters_ allows to use any graph without the
need to know explicitly their _data sources_ and _data sinks_ nor defining ports to be linked with the _input_ and
_output_ ports of the graph.

- _Factories_ (see Ra::Dataflow::Core::NodeFactoriesManager for reference manual) : the serialization of a graph output
a set of json object describing the graph. If serialization is always possible, care must be taken for the system to
manage un-serilization of any nodes.

When serializing a graph, the json representing a node contains the type (the name of the concrete C++ class) of the
node and several other properties of the node system. When un-serializing a graph, nodes will be automatically
instanced from their type.
The instantiation of a node is made using services offered by node factories and associated to the node type. So, in
order to be un-serializable, each node must register its type to a factory and each graph must refer to the factories used
to instantiate its node.

## HelloGraph : your first program that uses the node system

The example application examples/HelloGraph shows how to define a computation graph to apply filtering on a collection.
In this example, whose code is detailed below, the following graph is built and executed using different input data.

![HelloGraph computation graph](images/HelloGraph.png)

This graphs has two inputs, corresponding to the two **Source< ... >** nodes. These input will deliver to the
computation graph :

- from a Ra::Dataflow::Core::Sources::SingleDataSourceNode, a vector of scalars, whose container type is
Ra::Core::VectorArray (abridged here as a RaVector) and value type is _Scalar_ (float in the default Radium-Engine
configuration),
- from a Ra::Dataflow::Core::Sources::FunctionSourceNode a predicate whose type is _std::function<bool(float const&)>_
which returns _true_ if its parameter is valid according to some decision process.

These two _sources_ are linked to the input of a Ra::Dataflow::Core::Functionals::FilterNode, here represented by the
**Filter< ... >** node. This node select from its **in** input only the values validated by the predicate **f** and
built its output **out** with these values.

The result of this filtering is linked to the graph output, corresponding to the Ra::Dataflow::Core::Sinks::SinkNode
**Sink< ... >**.

Once the graph is built and compile, the HelloGraph application sent different input to the graph and print the result
of the computation.

To develop such an application, the following should be done

### 1. Building and inspecting the graph

First, an object of type Ra::Dataflow::Core::DataflowGraph is instanced :
\snippet examples/DataflowExamples/HelloGraph/main.cpp Creating an empty graph

Then, the nodes are instanced
\snippet examples/DataflowExamples/HelloGraph/main.cpp Creating Nodes

and added to the graph
\snippet examples/DataflowExamples/HelloGraph/main.cpp Adding Nodes to the graph

Links between ports are added to the graph, and if an error is detected, due to e.g. port type incompatiblitiy, it is
reported
\snippet examples/DataflowExamples/HelloGraph/main.cpp Creating links between Nodes

Once the graph is built, it can be inspected using dedicated methods.
\snippet examples/DataflowExamples/HelloGraph/main.cpp Inspect the graph interface : inputs and outputs port

For the graph constructed above, this prints on stdout

```text
Input ports (2) are :
"Selector_f" accepting type function<bool (float const&)>
"Source_to" accepting type RaVector<float>
Output ports (1) are :
"Sink_from" generating type RaVector<float>
```

### 2. Compiling the graph and getting input/output accessors

In order to use the graph as a function acting on its input, it should be first compiled by
\snippet examples/DataflowExamples/HelloGraph/main.cpp Verifying the graph can be compiled

If the compilation success the accessors for the input data and the output result might be fetched from the graph
\snippet examples/DataflowExamples/HelloGraph/main.cpp Configure the interface ports (input and output of the graph)

Here, the accessor `input` allows to set the pointer on the `RaVector` to be processed while the accessor `selector`
allows to set the predicate to evaluate when filtering the collection. This predicates select values les than `0.5`

The accessor `output` will allow, once the graph is executed, to get a reference to or to copy the resulting values.

### 3. Executing the graph

Once the input data are available (in this example, the `test` vector is filled with 10 random values between 0 and 1),
the graph can be executed and a reference to the resulting vector can be fetched using
\snippet examples/DataflowExamples/HelloGraph/main.cpp Execute the graph

### 4. Multiple run of the graph on different input

As accessors use pointers and references on the data sent to / fetched from the graph, the HelloGraph example shows how
to change the input using different available means so that every run of the graph process different values.
See the file examples/DataflowExamples/HelloGraph/main.cpp for all the details.

## Examples of graphs and of programming custom nodes

The unittests developed alongside the Radium::Dataflow component, and located in the directory
`tests/unittest/Dataflow/` of the Radium-Engine source tree, can be used to learn the following :

- sourcesandsinks.cpp : demonstrate the default supported types for sources and sinks node.
- nodes.cpp : demonstrate the development of a more complex graph implementing transform/reduce
on several collections using different reduction operators.
- graphinspect.cpp : demonstrate the way a graph can be inspected to discover its structure.
- serialization.cpp : demonstrate how to save/load a graph from a json file and use it in an
application.
- customnodes.cpp : demonstrate how it is simple to develop your own node type (in C++) and
use your nodes alongside standard nodes.
\snippet unittest/Dataflow/customnodes.cpp Develop a custom node
Binary file added doc/images/HelloGraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ foreach(
APP
CoreExample
CustomCameraManipulator
DataflowExamples
DrawPrimitives
EntityAnimation
EnvMap
Expand Down
12 changes: 12 additions & 0 deletions examples/DataflowExamples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0042 NEW)

project(DataflowExamples VERSION 1.0.0)

add_custom_target(${PROJECT_NAME})
add_custom_target(Install_${PROJECT_NAME})
foreach(APP FunctionalsGraph GraphAsNode GraphEditor GraphSerialization HelloGraph)
add_subdirectory(${APP})
add_dependencies(${PROJECT_NAME} ${APP})
add_dependencies(Install_${PROJECT_NAME} Install_${APP})
endforeach()
Loading