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 rendering #1018

Draft
wants to merge 239 commits into
base: release-candidate
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
239 commits
Select commit Hold shift + click to select a range
26b52a3
[externals] Add Dataflow external stduuid
MathiasPaulin Sep 7, 2022
c0f285a
[core] add random point sets
MathiasPaulin Sep 7, 2022
5a4d94a
[unittests][core] add tests on random point sets
MathiasPaulin Sep 7, 2022
c91d8d4
[core] improve type utilities : add type traits utility and fix type …
MathiasPaulin Oct 2, 2022
aee2bfd
[cmake] Allows configuring INTERFACE library (e.g. header only)
MathiasPaulin Sep 7, 2022
5a9fd16
[scripts] generation of filelist is allows filelist per subdirectory
MathiasPaulin Sep 7, 2022
8ee90d8
[dataflow-core] first commit of dataflow component
MathiasPaulin Sep 7, 2022
5ea3a90
[examples][dataflow] add helloDataflow example
MathiasPaulin Sep 7, 2022
665d27e
[examples][dataflow] add graph serialization example
MathiasPaulin Oct 17, 2022
72fe1f4
[dataflow-qtgui] add QtGui subcomponent
MathiasPaulin Oct 17, 2022
09826ae
[examples][dataflow] add dataflow graph editor example
MathiasPaulin Oct 17, 2022
4f5201c
[dataflow-cmake] fix install of dataflow components
MathiasPaulin Sep 21, 2022
a342789
[dataflow-cmake] add missing precompilation header
MathiasPaulin Sep 29, 2022
74f5768
[dataflow-core] fix source nodes
MathiasPaulin Sep 29, 2022
486d7bb
[dataflow-rendering] add rendergraph subcomponent
MathiasPaulin Sep 29, 2022
5f993b8
[dataflow-all] improve serialization
MathiasPaulin Oct 2, 2022
794440a
[dataflow-core] improve type demangling for dataflow graph
MathiasPaulin Oct 2, 2022
120f745
[examples][dataflow] fix compilation of HelloGraph
MathiasPaulin Oct 3, 2022
e0876e3
[dataflow] introduced function communication between nodes
MathiasPaulin Oct 3, 2022
7f3db0d
[dataflow] better management of dataSetters for interface port
MathiasPaulin Oct 4, 2022
9bad6c0
[dataflow] Simplify code structure and node instanciation
MathiasPaulin Oct 4, 2022
b86c85d
[dataflow] TODO on builtinsNodes
MathiasPaulin Oct 5, 2022
7489803
[dataflow] make QtNodeEditor an external under then name RadiumNodeEd…
MathiasPaulin Oct 5, 2022
5fe9879
[dataflow] simplifies a bit Node interface
MathiasPaulin Oct 5, 2022
bc8db75
[dataflow] make port construction more robust
MathiasPaulin Oct 5, 2022
50dcb5e
[dataflow] accelerate compilation
MathiasPaulin Oct 5, 2022
f1c205a
[doc] update dependencies
MathiasPaulin Oct 6, 2022
145e552
[dataflow] disable rendering graph
MathiasPaulin Oct 6, 2022
ac93522
[dataflow] improve graph compilation/execution robustness
MathiasPaulin Oct 6, 2022
de34546
[dataflow] improve functionals
MathiasPaulin Oct 6, 2022
4b4e0c0
[example] add dataflow functionals example
MathiasPaulin Oct 6, 2022
c739b49
[dataflow] remove uneeded includes
MathiasPaulin Oct 6, 2022
a0dc724
[dataflow] improve compilation robustness
MathiasPaulin Oct 6, 2022
563c0b5
[dataflow] add reduce operator
MathiasPaulin Oct 6, 2022
1dfed68
[example] add test on reduce operator
MathiasPaulin Oct 6, 2022
7373dba
[dataflow] improve node's type readability
MathiasPaulin Oct 10, 2022
59b8219
[examples][dataflow] remove unneeded include
MathiasPaulin Oct 10, 2022
100d654
[dataflow] unify Sources, Sinks and Functional nodes declaration and …
MathiasPaulin Oct 10, 2022
7e671a7
[dataflow-core] add generic binary operator node
MathiasPaulin Oct 10, 2022
6524ca4
[unittests][dataflow] add first dataflow node unit tests
MathiasPaulin Oct 10, 2022
303dae0
[dataflow] remove dead code and fix some method profile
MathiasPaulin Oct 11, 2022
f93494b
[dataflow] add homogeneous BinaryOpNode on CoreDataType to standard f…
MathiasPaulin Oct 11, 2022
1a46b66
[unittests][dataflow] add graph load/save tests
MathiasPaulin Oct 11, 2022
0732c5d
[dataflow][rendering] improve codacy report
MathiasPaulin Oct 11, 2022
5b1e53e
[dataflow][examples] improve codacy report
MathiasPaulin Oct 11, 2022
b045281
[unittests][dataflow] improve codacy report
MathiasPaulin Oct 11, 2022
169011e
[unittests][dataflow] improve codacy report
MathiasPaulin Oct 11, 2022
dae930f
[dataflow] fix wrong log message
MathiasPaulin Oct 11, 2022
3ca1ca3
[tests] improve coverage of builtins node
MathiasPaulin Oct 11, 2022
668b3aa
[dataflow-core] improve nodes
MathiasPaulin Oct 11, 2022
5a82404
[example] include what is needed
MathiasPaulin Oct 11, 2022
bf66157
[unittests] add unit tests on sources and sinks
MathiasPaulin Oct 11, 2022
51e9b1d
[unittests] update unit tests on sources and sinks
MathiasPaulin Oct 12, 2022
d0a5150
[unittests] add unit tests on custom nodes
MathiasPaulin Oct 12, 2022
173b833
[dataflow] fix some inconsistencies in the code while improving cover…
MathiasPaulin Oct 12, 2022
a3c056a
[dataflow] improve source code readability.
MathiasPaulin Oct 13, 2022
14c4d84
[tests] add graph inspection unittest
MathiasPaulin Oct 17, 2022
6fa00f1
[dataflow] make it compiles on Windows
MathiasPaulin Oct 13, 2022
5ad5dce
[tests] simplify unittests on predefined nodes
MathiasPaulin Oct 14, 2022
ccfbffe
[dataflow] improve logging and error management
MathiasPaulin Oct 14, 2022
348cf8a
[tests] improve logging and error management
MathiasPaulin Oct 14, 2022
9c1f45e
[examples] fix snippet comments in HelloGraph
MathiasPaulin Oct 14, 2022
e24fe4f
[dataflow-core] improve class and namespace documentation
MathiasPaulin Oct 20, 2022
af2e855
[examples] fix snippet labels
MathiasPaulin Oct 20, 2022
bbc0e4a
[doc] add first documentation about node system
MathiasPaulin Oct 20, 2022
6f6f78c
[doc] node system typos.
dlyr Oct 25, 2022
9553ce1
[core] rename constexpr in Random utilities
MathiasPaulin Oct 25, 2022
0a80517
[tests] fix some typos on dataflow unittests and add doc snippets
MathiasPaulin Oct 25, 2022
167cc4f
[doc] use snippets from unittests
MathiasPaulin Oct 25, 2022
6233c15
[externals] update externals configuration
MathiasPaulin Nov 1, 2022
83a894d
[dataflow] update configuration files
MathiasPaulin Nov 1, 2022
3e38670
[dataflow-core] remove unwanted error messages
MathiasPaulin Nov 2, 2022
107a3e7
[dataflow-qtgui] improve contextual menu on node editor
MathiasPaulin Nov 2, 2022
ea6d934
[dataflow-qtgui] improve editable parameter gui and add TODO
MathiasPaulin Nov 2, 2022
20bd83e
[dataflow-core] allow sources and sinks to customize their interface …
MathiasPaulin Nov 3, 2022
2e46763
[dataflow] remove unneeded indicator
MathiasPaulin Nov 3, 2022
e396091
[dataflow-core] improve simplified type demangler
MathiasPaulin Nov 3, 2022
dc8c66b
[dataflow-core] fix comment typo
MathiasPaulin Nov 3, 2022
606eb0e
[dataflow-core] Fix singleton (static) initialization order to allow …
MathiasPaulin Nov 3, 2022
e107c45
[dataflow-core] allow to load any graph registered in a factory witho…
MathiasPaulin Nov 3, 2022
2653c72
[examples] allow to load any graph registered in a factory without kn…
MathiasPaulin Nov 3, 2022
201b6ed
[dataflow] fix typo in macro to generate code :(
MathiasPaulin Nov 3, 2022
eb770d2
[dataflow-core] add state flag to dataflowgraph
MathiasPaulin Nov 4, 2022
ffaada0
[dataflow-qtgui] add graph editor window as an available dataflow::qt…
MathiasPaulin Nov 4, 2022
ec88906
[examples] Simplify graph editor example
MathiasPaulin Nov 4, 2022
84d68c0
forget to install pre-commit -- fix format after installing
MathiasPaulin Nov 4, 2022
faf55c8
[dataflow-core] improve auto initialization of libraries
MathiasPaulin Nov 4, 2022
22af2f6
[dataflow-core] Add documentation about some type conflict in port sy…
MathiasPaulin Nov 4, 2022
090ae74
[dataflow-core] Workaround for the way the Qt Node Editor manage graphs.
MathiasPaulin Nov 4, 2022
5715441
[dataflow-qtgui] Workaround for the way the Qt Node Editor manage gra…
MathiasPaulin Nov 4, 2022
6a2a507
[dataflow-qtgui] add missing dllexport
MathiasPaulin Nov 4, 2022
4f55091
[dataflow-qtgui] fix crash at app exit
MathiasPaulin Nov 5, 2022
8b06e7b
[dataflow-core] modify node interface for better reporting.
MathiasPaulin Nov 5, 2022
213e59d
[tests] custom node update
MathiasPaulin Nov 6, 2022
53927e1
[doc] fix typo
MathiasPaulin Nov 14, 2022
8e1707e
[dataflow-core] prepare better ownership transfer
MathiasPaulin Nov 14, 2022
952ed69
[dataflow-core] refactor removeNode
MathiasPaulin Jan 11, 2023
a375125
[unittests] refactor removeNode
MathiasPaulin Jan 11, 2023
493343a
[dataflow] explicitly transfer ownership when adding a node to the graph
MathiasPaulin Jan 31, 2023
f081999
[unittests] explicitly transfer ownership when adding a node to the g…
MathiasPaulin Jan 31, 2023
e265a49
[examples] explicitly transfer ownership when adding a node to the graph
MathiasPaulin Jan 31, 2023
4064edf
[dataflow-core] remove .inl files
MathiasPaulin Jan 31, 2023
4cc6cf7
[dataflow-qtgui] remove .inl files
MathiasPaulin Jan 31, 2023
3cb978a
[dataflow-core] fix codacy warning
MathiasPaulin Jan 31, 2023
e1095a4
[dataflow-core] improve trace and robustness
MathiasPaulin Feb 1, 2023
cbc5f32
[dataflow-qtgui] improve robustness
MathiasPaulin Feb 1, 2023
9dd7b31
[dataflow-qtgui] add constraints on powerslider when available
MathiasPaulin Feb 1, 2023
fe8c591
[dataflow-core] improve NodeFactoriesManager interface
MathiasPaulin Feb 2, 2023
5c1e038
[unittests] update to use NodeFactoriesManager interface
MathiasPaulin Feb 2, 2023
1d51e7b
[examples] update to use NodeFactoriesManager interface
MathiasPaulin Feb 2, 2023
dd95895
[cmake] fix configuration issue for interface libraries on windows in…
MathiasPaulin Feb 2, 2023
ff09a82
[dataflow-core] fix double deletion problem
MathiasPaulin Feb 2, 2023
a364b93
[dataflow-core] fix memory leaks
MathiasPaulin Feb 2, 2023
000a0d7
[dataflow-core] remove compilation warning
MathiasPaulin Feb 2, 2023
3afc95b
[dataflow-core] improve error management
MathiasPaulin Feb 3, 2023
9b5f927
[unittests] improve coverage
MathiasPaulin Feb 3, 2023
dcebe95
[core] fix compilation warning
MathiasPaulin Feb 6, 2023
a55e2e9
[dataflow-core] fix compilation warning
MathiasPaulin Feb 6, 2023
02219a0
[dataflow-qtgui] fix compilation warning
MathiasPaulin Feb 6, 2023
4be73ad
[dataflow] use std::type_index instead of hash for port type management
MathiasPaulin Feb 6, 2023
2c7ae86
[dataflow] make Node's uuid generator private
MathiasPaulin Feb 6, 2023
66e7bcf
[core] add type demangler from typeindex
MathiasPaulin Feb 6, 2023
935e77b
[dataflow] add type demangler from typeindex
MathiasPaulin Feb 6, 2023
b5b880f
[unittests] add test on type demangler from typeindex
MathiasPaulin Feb 6, 2023
811b871
[core] add missing RA_CORE_API
MathiasPaulin Feb 6, 2023
d9a7879
[dataflow] add missing RA_DATAFLOW_API
MathiasPaulin Feb 6, 2023
493fa48
[core] fix typeutils on windows
MathiasPaulin Feb 6, 2023
23d3364
[core] fix merge conflicts
MathiasPaulin Mar 17, 2023
fddbb9a
[unittests] Simplify typeutils
MathiasPaulin Feb 8, 2023
6ae69dc
[dataflow-core] Simplify type demangler
MathiasPaulin Feb 8, 2023
7252078
[dataflow-core] fix missing methods
MathiasPaulin Feb 8, 2023
46a7aca
[dataflow-core] fix missing methods on graph
MathiasPaulin Feb 8, 2023
920991d
[dataflow-core] specialize some sources
MathiasPaulin Feb 8, 2023
14e41dc
[unittests] improve coverage
MathiasPaulin Feb 8, 2023
606317f
[dataflow-core] allows to access to a port through its name or index
MathiasPaulin Feb 10, 2023
b9a6b7a
[dataflow-core] simplify loading and json representation
MathiasPaulin Feb 10, 2023
45b39cd
[dataflow-core] modify default generated node creator functor
MathiasPaulin Feb 10, 2023
2c76058
[dataflow-qtgui] fix crash when ending graph edition session
MathiasPaulin Feb 10, 2023
73c5af4
[unittests] improve coverage for graph building and serialization
MathiasPaulin Feb 10, 2023
5464ed0
[dataflow-core] allows to force recompilation of a graph
MathiasPaulin Feb 10, 2023
40d026a
[unittests] update tests
MathiasPaulin Feb 10, 2023
e650df3
[dataflow-qtGui] use Radium log
MathiasPaulin Feb 10, 2023
4d4b14a
[dataflow-core] try to fix random crash : sinkNode
MathiasPaulin Feb 13, 2023
80a8859
[dataflow-core] try to fix random crash : Port
MathiasPaulin Feb 13, 2023
0875e21
[dataflow-core] try to fix random crash : Node
MathiasPaulin Feb 13, 2023
d4b57df
[dataflow-core] try to fix random crash : Graph
MathiasPaulin Feb 13, 2023
bbaa086
[unittests] try to fix random crash
MathiasPaulin Feb 13, 2023
20a704a
[unittest] try to fix random crash
MathiasPaulin Feb 13, 2023
81626a7
[dataflow] remove dependency from stduuid external
MathiasPaulin Feb 24, 2023
8102056
[dataflow-core][tests] improve Radium types demangler
MathiasPaulin Mar 20, 2023
736e44f
[dataflow-core][tests][examples] Node factory improvements
MathiasPaulin Mar 20, 2023
95643d0
[dataflow-core][dataflow-qtgui][tests] fix typos and profile for Data…
MathiasPaulin Mar 20, 2023
b4bb101
[tests] fix missing const in dataflow graph test
MathiasPaulin Mar 20, 2023
db189f7
[dataflow-qtgui] fix missing const in dataflow graph node access
MathiasPaulin Mar 20, 2023
a7a9879
[dataflow-core][tests] fix type demangler for __cxx11::basic_string o…
MathiasPaulin Mar 21, 2023
e8b5687
[gui] fix missing widget name
MathiasPaulin Mar 24, 2023
c3bd198
[dataflow-core] use find_if instead of custom loop
MathiasPaulin Mar 24, 2023
269dc91
[dataflow-qtgui] add widget
MathiasPaulin Mar 24, 2023
a872237
[dataflow-core] add a todo in Node.hpp
MathiasPaulin Apr 3, 2023
27d2e63
[dataflow-rendering] remove .inl in the Rendering package
MathiasPaulin Apr 4, 2023
924377b
[core] fix merge of Radium PR #1037
MathiasPaulin Apr 4, 2023
c7f9167
[engine] fix envmap computation when Scalar = double
MathiasPaulin Apr 4, 2023
8cfb030
[core][tests] fix Random sequences when Scalar = double
MathiasPaulin Apr 4, 2023
ba58eb6
[dataflow-rendering] fix codacy for unused component
MathiasPaulin Apr 4, 2023
94e6b98
[tests] fix random sequence when Scalar = double
MathiasPaulin Apr 4, 2023
26941c1
[general] format with new guidelines
pre-commit-ci[bot] Apr 5, 2023
89f89ff
[cmake][dataflow] update cmake min version to 3.18
MathiasPaulin Jun 30, 2023
3ccb3c8
[core] add random point sets
MathiasPaulin Sep 7, 2022
5f95dae
[core] fix compilation warning
MathiasPaulin Feb 6, 2023
ea1fdef
[core] improve type utilities : add type traits utility and fix type …
MathiasPaulin Oct 2, 2022
219a795
[core] improve type utilities : add type traits utility and fix type …
MathiasPaulin Oct 2, 2022
c8bc596
[dataflow][rendering] fix minimal dataflow renderer
MathiasPaulin Nov 3, 2022
8061346
[examples][dataflow] start rendering example
MathiasPaulin Nov 3, 2022
6b55071
[dataflow][rendering] add scene node and update renderer
MathiasPaulin Nov 3, 2022
3f0d086
[examples][dataflow] update rendering demo
MathiasPaulin Nov 3, 2022
1f77e4e
[dataflow][rendering] improve configurable renderer
MathiasPaulin Nov 3, 2022
4795899
[examples][dataflow] better comments in rendering example
MathiasPaulin Nov 3, 2022
d5ffbc2
[examples][dataflow] add rendering factory to the node editor
MathiasPaulin Nov 3, 2022
42bed33
[dataflow][rendering] start autoregistration of rendering nodes
MathiasPaulin Nov 3, 2022
065f9b1
[dataflow][rendering] move RenderingGraph class
MathiasPaulin Nov 3, 2022
ac52443
[dataflow][rendering] add texture sources and sink
MathiasPaulin Nov 3, 2022
0cf44ac
[examples][dataflow] add graph inspection in Graph rendering demo for…
MathiasPaulin Nov 3, 2022
6792eba
[dataflow][rendering] add new node and improve renderer/controller
MathiasPaulin Nov 3, 2022
cfe56c9
[examples][dataflow] extends Graph rendering demo
MathiasPaulin Nov 3, 2022
5e5467b
[dataflow][rendering] Separate RenderGraphController from Configurabl…
MathiasPaulin Nov 4, 2022
d810d3b
[examples][dataflow] update Graph rendering demo
MathiasPaulin Nov 4, 2022
ae69253
[dataflow][rendering] add simpleRenderNodes and allow resources path …
MathiasPaulin Nov 5, 2022
ce0f45e
[dataflow][rendering] compiling rendering graphs
MathiasPaulin Nov 7, 2022
3ae517e
[example][dataflow] modify rendering demo.
MathiasPaulin Nov 4, 2022
339e827
[dataflow][rendering] add environment map source node
MathiasPaulin Nov 5, 2022
22b7ac2
[dataflow][rendering] add geometry aovs node
MathiasPaulin Nov 5, 2022
53d4f7b
[dataflow][rendering] add emissivity node
MathiasPaulin Nov 5, 2022
3ff3dbb
[gui] automatically loads plugins from the directory specified on the…
MathiasPaulin Nov 6, 2022
8fe7af4
[engine] add sphere sampler, spherical random point sets mapped to a …
MathiasPaulin Nov 6, 2022
10a09b2
[dataflow][rendering] doc clearcolorNode
MathiasPaulin Nov 6, 2022
7fbfd1d
[dataflow][qtgui] Add a todo (to be moved in RadiumDataflow PR)
MathiasPaulin Nov 7, 2022
5919511
[examples][dataflow] Add geom aov to the basic graph rendering example
MathiasPaulin Nov 7, 2022
40d5a70
[dataflow][rendering] add ssao node
MathiasPaulin Nov 7, 2022
6fadce5
[dataflow][rendering] update wrt dataflow core and remove .inl files
MathiasPaulin Jan 31, 2023
e4dfbf1
[dataflow][examples][rendering] update wrt dataflow core
MathiasPaulin Jan 31, 2023
d6763bf
[dataflow][rendering] remove warnings and add missing header (windows)
MathiasPaulin Feb 1, 2023
ccbb23a
[dataflow][rendering] add environment lighting node
MathiasPaulin Feb 1, 2023
eab8d28
[dataflow][rendering] add local lighting node
MathiasPaulin Feb 1, 2023
4febaaf
[dataflow][rendering] fix window compilation.
MathiasPaulin Feb 1, 2023
e178faa
[dataflow][rendering] add TransparencyNode.
MathiasPaulin Feb 1, 2023
4975c48
[dataflow][rendering] add VolumeNode.
MathiasPaulin Feb 1, 2023
6ee973e
[dataflow][rendering] add WireframeNode.
MathiasPaulin Feb 1, 2023
bc41fb0
[dataflow][rendering] fix envmap shader for non PBR materials.
MathiasPaulin Feb 1, 2023
c372a89
[dataflow][rendering] improve node and ports naming
MathiasPaulin Feb 1, 2023
3657d6c
[dataflow][rendering] update to editable constraint
MathiasPaulin Feb 1, 2023
b470e63
[dataflow][rendering] add constraints on ssao node parameters
MathiasPaulin Feb 1, 2023
df96d3c
[dataflow][rendering] add antialiasing
MathiasPaulin Feb 1, 2023
37107c6
[dataflow][rendering] remove redundant method
MathiasPaulin Feb 1, 2023
64fece2
[dataflow][engine] update to factories manager interface
MathiasPaulin Feb 2, 2023
9444c72
[dataflow][engine] homogenize port naming
MathiasPaulin Feb 2, 2023
e5f71cc
[dataflow][rendering] fix crash when executing GraphRendering app on …
MathiasPaulin Feb 2, 2023
d243e5c
[dataflow][qtgui] fix crash when executing GraphRendering app on Linux
MathiasPaulin Feb 2, 2023
858e470
[examples][dataflow] fix codacy warning
MathiasPaulin Feb 3, 2023
ca90f7b
[unittests][dataflow] add rendering graph unittests
MathiasPaulin Feb 3, 2023
35cb1ec
[unittests][dataflowrendering] fix segfault on Linux
MathiasPaulin Feb 3, 2023
67ba8f2
[dataflow][rendering] update to dataflow core evolution
MathiasPaulin Feb 10, 2023
a968f6d
[dataflow][rendering] update rendering example
MathiasPaulin Feb 10, 2023
2eb84ca
[dataflow][rendering] update rendering example
MathiasPaulin Feb 10, 2023
96f167e
[dataflow-rendering] adapt to renderparameter PR
MathiasPaulin Mar 17, 2023
fab1e45
[examples] add support for libGLTF for graph-base rendering exemple
MathiasPaulin Mar 17, 2023
9d38602
[dataflow-rendering][tests][examples] fix missing const in dataflow g…
MathiasPaulin Mar 20, 2023
603f541
[engine] allow to set alpha to 0 or 1 (the default) when drawing skybox
MathiasPaulin Mar 22, 2023
42844e8
[dataflow-rendering-shaders] add missing ouput in no-light vertex shader
MathiasPaulin Mar 22, 2023
107d782
[dataflow-rendering] update shader code for envlighting
MathiasPaulin Mar 24, 2023
263c352
[dataflow-rendering] allow using rendering node in any order
MathiasPaulin Mar 24, 2023
5a91f03
[core] fix strange code duplication
MathiasPaulin Apr 3, 2023
d7c6d0f
[rendering] improve envmap shader for non PBR path
MathiasPaulin Apr 4, 2023
37f1fe8
[rendering] remove unsed file
MathiasPaulin Apr 5, 2023
a4a355f
[dataflow-rendering] Simplify Display Sink
MathiasPaulin Apr 5, 2023
52a920d
[dataflow-rendering] Allows ClearColor to serve its own Beaty texture
MathiasPaulin Apr 5, 2023
cdea886
[general] format with new guidelines
pre-commit-ci[bot] Apr 5, 2023
6249e73
[dataflow-rendering] fix merge error
MathiasPaulin Apr 7, 2023
d24cd02
[examples] improve dataflow-rendering demo
MathiasPaulin Apr 7, 2023
66c36f9
[cmake][dataflow] update cmake min version to 3.18
MathiasPaulin Jun 30, 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
Prev Previous commit
Next Next commit
[core] improve type utilities : add type traits utility and fix type …
…demangling on windows
  • Loading branch information
MathiasPaulin committed Jun 30, 2023
commit c91d8d49274175b15adde83c1e2d4124536e7fa7
26 changes: 26 additions & 0 deletions src/Core/Utils/TypesUtils.hpp
Original file line number Diff line number Diff line change
@@ -25,6 +25,32 @@ const char* demangleType() noexcept;
template <typename T>
const char* demangleType( const T& ) noexcept;

// Check if a type is a container with access to its element type and number
// adapted from https://stackoverflow.com/questions/13830158/check-if-a-variable-type-is-iterable
namespace detail {

using std::begin;
using std::end;

template <typename T>
auto is_container_impl( int )
-> decltype( begin( std::declval<T&>() ) !=
end( std::declval<T&>() ), // begin/end and operator !=
void(), // Handle evil operator ,
std::declval<T&>().empty(),
std::declval<T&>().size(),
++std::declval<decltype( begin( std::declval<T&>() ) )&>(), // operator ++
void( *begin( std::declval<T&>() ) ), // operator*
std::true_type {} );

template <typename T>
std::false_type is_container_impl( ... );

} // namespace detail

template <typename T>
using is_container = decltype( detail::is_container_impl<T>( 0 ) );

// TypeList taken and adapted from
// https://github.com/AcademySoftwareFoundation/openvdb/blob/master/openvdb/openvdb/TypeList.h
// Only took small part of TypeList utilities
2 changes: 1 addition & 1 deletion tests/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ set(test_src
Core/camera.cpp
Core/color.cpp
Core/containers.cpp
Core/demangle.cpp
Core/typeutils.cpp
Core/distance.cpp
Core/enumconverter.cpp
Core/geometryData.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include <Core/Containers/VectorArray.hpp>
#include <Core/Types.hpp>
#include <Core/Utils/Color.hpp>
#include <Core/Utils/TypesUtils.hpp>
#include <catch2/catch.hpp>

@@ -9,19 +12,15 @@
namespace TypeTests {
struct TypeName_struct {};
} // namespace TypeTests
TEST_CASE( "Core/Utils/TypesUtils", "[Core][Core/Utils][TypesUtils]" ) {
TEST_CASE( "Core/Utils/TypesUtils", "[Core][Utils][TypesUtils]" ) {
SECTION( "Demangle from typename" ) {
using Ra::Core::Utils::demangleType;

REQUIRE( std::string( demangleType<int>() ) == "int" );
REQUIRE( std::string( demangleType<float>() ) == "float" );
REQUIRE( std::string( demangleType<uint>() ) == "unsigned int" );
// TODO, verify type demangling on windows
#ifndef _WIN32
REQUIRE( std::string( demangleType<size_t>() ) == "unsigned long" );
#else
REQUIRE( std::string( demangleType<size_t>() ) == "unsigned __int64" );
#endif

auto demangledName = std::string( demangleType<std::vector<int>>() );
REQUIRE( demangledName == "std::vector<int, std::allocator<int>>" );

@@ -40,18 +39,27 @@ TEST_CASE( "Core/Utils/TypesUtils", "[Core][Core/Utils][TypesUtils]" ) {
REQUIRE( std::string( demangleType( i ) ) == "int" );
REQUIRE( std::string( demangleType( f ) ) == "float" );
REQUIRE( std::string( demangleType( u ) ) == "unsigned int" );
// TODO, verify type demangling on windows
#ifndef _WIN32
REQUIRE( std::string( demangleType( s ) ) == "unsigned long" );
#else
REQUIRE( std::string( demangleType( s ) ) == "unsigned __int64" );
#endif

#ifndef _WIN32
// this segfault on windows due to out_of_bound exception. why ???
std::vector<int> v;
auto demangledName = std::string( demangleType( v ) );
REQUIRE( demangledName == "std::vector<int, std::allocator<int>>" );

#endif
TypeTests::TypeName_struct tns;
demangledName = std::string( demangleType( tns ) );
REQUIRE( demangledName == "TypeTests::TypeName_struct" );
auto demangledNameFromStruct = std::string( demangleType( tns ) );
REQUIRE( demangledNameFromStruct == "TypeTests::TypeName_struct" );
}

SECTION( "Type traits" ) {
using namespace Ra::Core::Utils;
REQUIRE( is_container<Scalar>::value == false );
REQUIRE( is_container<Ra::Core::Vector3>::value == false );
REQUIRE( is_container<Ra::Core::Utils::Color>::value == false );
REQUIRE( is_container<Ra::Core::VectorArray<Ra::Core::Vector3>>::value == true );
REQUIRE( is_container<std::array<unsigned int, 2>>::value == true );
REQUIRE( is_container<std::map<size_t, std::string>>::value == true );
REQUIRE( is_container<std::vector<Scalar>>::value == true );
}
}