diff --git a/src/Mara/RadiumPlayer.cpp b/src/Mara/RadiumPlayer.cpp index 8b9fe038b410606e01a699a16a1f2ea2c39664ae..87532d503e571c8895968fcb5cc47a5de2bb8baa 100644 --- a/src/Mara/RadiumPlayer.cpp +++ b/src/Mara/RadiumPlayer.cpp @@ -197,8 +197,9 @@ void RadiumPlayer::addRenderers() { myRenderer->setJsonFilePath( *m_graphOption ); } else { +#ifdef LOAD_DEFAULT_GRAPH auto resourcesCheck = - Ra::Core::Resources::getResourcesPath( nullptr, { "Resources/RadiumNBR" } ); + Ra::Core::Resources::getResourcesPath( &RadiumNBR::NodeBasedRendererMagic, { "Resources/RadiumNBR" } ); if ( !resourcesCheck ) { LOG( Ra::Core::Utils::logERROR ) << "Unable to find resources for NodeBased Renderer!"; @@ -206,9 +207,14 @@ void RadiumPlayer::addRenderers() { } auto resourcesPath{ *resourcesCheck }; myRenderer->setJsonFilePath( resourcesPath + "RenderGraphs/fullfeaturerenderer.flow" ); +#else + myRenderer->setJsonFilePath( "" ); + myRenderer->signalReloadJson(); +#endif } myRenderer->signalReloadJson(); + // 4 add the renderer to the mainwindow mainWindow->addRenderer( rendererName, myRenderer, controlPanel ); } diff --git a/src/libRender/CMakeLists.txt b/src/libRender/CMakeLists.txt index 6130d3769d71586c3067442c57199275bd92c114..52e8e96b0de7d7748e83f7ff3aafc7ccfc860282 100644 --- a/src/libRender/CMakeLists.txt +++ b/src/libRender/CMakeLists.txt @@ -22,8 +22,19 @@ endif () #----------------------------------------------------------------------------------- # lib nbr configuration #----------------------------------------------------------------------------------- -# Radium and Qt stuff -find_package(Radium REQUIRED Core Engine) +# Radium stuff +find_package(Radium REQUIRED Core Engine ) +message(STATUS "Found Radium version ${Radium_VERSION}" ) + +# std::uuid dependency +# Note, follow the progress of integration of uuid generator in the C++ std lib. When supported by std, remove this dependency +set(UUID_BUILD_TESTS OFF) +set(UUID_SYSTEM_GENERATOR OFF) +set(UUID_USING_CXX20_SPAN OFF) # change this when going to C++20 as language standard for Radium libs +add_subdirectory(Dependencies/stduuid) +add_library(std::uuid ALIAS stduuid) +# TODO verify correct installation and usage in Config.cmake.in + set(markdowns # doc/README.md @@ -95,6 +106,7 @@ set(sources set(public_headers # General + RadiumNBR/externals/json.hpp RadiumNBR/NodeBasedRendererMacro.hpp # Node graph @@ -180,14 +192,6 @@ set(resources Resources/RadiumNBR/RenderGraphs/fullfeaturerenderer.flow ) -# std::uuid dependency -# Note, follow the progress of integration of uuid generator in the C++ std lib. When supported by std, remove this dependency -set(UUID_BUILD_TESTS OFF) -set(UUID_SYSTEM_GENERATOR OFF) -set(UUID_USING_CXX20_SPAN OFF) # change this when going to C++20 as language standard for Radium libs -add_subdirectory(Dependencies/stduuid) -add_library(std::uuid ALIAS stduuid) -# TODO verify correct installation and usage in Config.cmake.in # Our library project uses these sources and headers. @@ -239,7 +243,7 @@ install_target_resources( TARGET ${libName} RESOURCES_INSTALL_DIR ${PROJECT_NAME} RESOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Resources/RadiumNBR/RenderGraphs - FILES fullfeaturerenderer.flow + FILES fullfeaturerenderer.flow RadiumForwardRenderer.flow volviz.flow ) #----------------------------------------------------------------------------------- diff --git a/src/libRender/Config.cmake.in b/src/libRender/Config.cmake.in index 677d8919e9aeb297668790e9667e9fb8f98514d5..34015a9dad9f6237adee11b270b53f7a907476b9 100644 --- a/src/libRender/Config.cmake.in +++ b/src/libRender/Config.cmake.in @@ -2,46 +2,52 @@ # manage required components set(_supported_components NBR NBRGui) -set(RadiumNBR_FOUND True) + set(RadiumNBR_FOUND True) -if (NOT RadiumNBR_FIND_COMPONENTS) - message(STATUS "No component requested : search for all components \(${_supported_components}\)") - set(RadiumNBR_FIND_COMPONENTS ${_supported_components}) -else() - message(STATUS "NBRLibs -- requested components are : ${RadiumNBR_FIND_COMPONENTS}") -endif() + if (NOT RadiumNBR_FIND_COMPONENTS) + message(STATUS "No component requested : search for all components \(${_supported_components}\)") + set(RadiumNBR_FIND_COMPONENTS ${_supported_components}) + else() + message(STATUS "NBRLibs -- requested components are : ${RadiumNBR_FIND_COMPONENTS}") + endif() -foreach(_comp ${RadiumNBR_FIND_COMPONENTS}) - list(FIND _supported_components ${_comp} ${_comp}_FOUND) - if (${${_comp}_FOUND} EQUAL -1) - set(RadiumNBR_FOUND False) - set(RadiumNBR_NOT_FOUND_MESSAGE "Unsupported RadiumNBR component: ${_comp}") - else() - set(${_comp}_FOUND True) - endif() -endforeach() + foreach(_comp ${RadiumNBR_FIND_COMPONENTS}) + list(FIND _supported_components ${_comp} ${_comp}_FOUND) + if (${${_comp}_FOUND} EQUAL -1) + set(RadiumNBR_FOUND False) + set(RadiumNBR_NOT_FOUND_MESSAGE "Unsupported RadiumNBR component: ${_comp}") + else() + set(${_comp}_FOUND True) + endif() + endforeach() -#------------------------------------------------------------------------------------------------------------ -include(CMakeFindDependencyMacro) -if ( NOT Radium_FOUND) - find_dependency(Radium COMPONENTS Core Engine REQUIRED) -endif() + #------------------------------------------------------------------------------------------------------------ + include(CMakeFindDependencyMacro) + if ( NOT Radium_FOUND) + if ( NOT DEFINED Radium_DIR ) + set( Radium_DIR "@Radium_DIR@" ) + endif() + find_dependency(Radium COMPONENTS Core Engine REQUIRED) + endif() -if (NBR_FOUND) - # TODO : search how to use the installed stduuid from submodule ... - include("${CMAKE_CURRENT_LIST_DIR}/NBRTargets.cmake" ) - radium_exported_resources( - TARGET RadiumNBR::NBR - ACCESS_FROM_PACKAGE "../.." - PREFIX RadiumNBR - ) -endif() + if (NBR_FOUND OR NBRGui_FOUND) + if(NOT DEFINED stduuid_DIR) + set(stduuid_DIR "${CMAKE_CURRENT_LIST_DIR}/stduuid") + endif() + find_dependency(stduuid REQUIRED) + include("${CMAKE_CURRENT_LIST_DIR}/NBRTargets.cmake" ) + radium_exported_resources( + TARGET RadiumNBR::NBR + ACCESS_FROM_PACKAGE "../.." + PREFIX RadiumNBR + ) + endif() -if (NBRGui_FOUND) - if (NOT Qt5_FOUND AND NOT Qt6_FOUND) - include(${CMAKE_CURRENT_LIST_DIR}/QtFunctions.cmake) - find_qt_dependency(COMPONENTS Core Widgets REQUIRED) + if (NBRGui_FOUND) + if (NOT Qt5_FOUND AND NOT Qt6_FOUND) + include(${CMAKE_CURRENT_LIST_DIR}/QtFunctions.cmake) + find_qt_dependency(COMPONENTS Core Widgets REQUIRED) + endif() + include("${CMAKE_CURRENT_LIST_DIR}/NodeEditor/NodeEditorTargets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/NBRGuiTargets.cmake" ) endif() - include("${CMAKE_CURRENT_LIST_DIR}/NodeEditor/NodeEditorTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/NBRGuiTargets.cmake" ) -endif() diff --git a/src/libRender/RadiumNBR/EnvMap.cpp b/src/libRender/RadiumNBR/EnvMap.cpp index 4587c2a14b339a98051d9cfabedfea209f3cdf83..3cd1733adeaf4244b8ac913f4965cab7b5b91abe 100644 --- a/src/libRender/RadiumNBR/EnvMap.cpp +++ b/src/libRender/RadiumNBR/EnvMap.cpp @@ -7,9 +7,9 @@ #include "EnvMap.hpp" -#define STB_IMAGE_IMPLEMENTATION +//#define STB_IMAGE_IMPLEMENTATION #include <stb/stb_image.h> -#undef STB_IMAGE_IMPLEMENTATION +//#undef STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_WRITE_IMPLEMENTATION #include <stb/stb_image_write.h> #undef STB_IMAGE_WRITE_IMPLEMENTATION diff --git a/src/libRender/RadiumNBR/NodeGraph/NodeFactory.hpp b/src/libRender/RadiumNBR/NodeGraph/NodeFactory.hpp index a0d0edafbff312f39c5058163e4de7428454f2b1..eb5a9cbd277d692015611dac7e75cc285c0cfcd4 100644 --- a/src/libRender/RadiumNBR/NodeGraph/NodeFactory.hpp +++ b/src/libRender/RadiumNBR/NodeGraph/NodeFactory.hpp @@ -6,7 +6,6 @@ #include <iostream> #include <unordered_map> -#include <any> namespace NodeFactory { NodeBasedRenderer_LIBRARY_API Node* createNode( std::string& nodeType, const nlohmann::json& data );