Skip to content
Snippets Groups Projects
Commit aa4970f4 authored by Mathias Paulin's avatar Mathias Paulin :speech_balloon:
Browse files

[librender] Add stduuid dependency as submodule

parent 07249d9e
No related branches found
No related tags found
No related merge requests found
[submodule "stduuid"]
path = src/libRender/Dependencies/stduuid
url = git@github.com:MathiasPaulin/stduuid.git
...@@ -178,6 +178,14 @@ set(resources ...@@ -178,6 +178,14 @@ set(resources
Resources/RadiumNBR/RenderGraphs/fullfeaturerenderer.flow 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 ON)
set(UUID_USING_CXX20_SPAN OFF) # change this when going to C++20 as language standard for Radium libs
add_subdirectory(Dependencies/stduuid)
# TODO verify correct installation and usage in Config.cmake.in
# Our library project uses these sources and headers. # Our library project uses these sources and headers.
add_library( add_library(
...@@ -200,6 +208,7 @@ target_link_libraries( ...@@ -200,6 +208,7 @@ target_link_libraries(
PUBLIC PUBLIC
Radium::Core Radium::Core
Radium::Engine Radium::Engine
stduuid
) )
if(CMAKE_BUILD_TYPE STREQUAL "Debug") if(CMAKE_BUILD_TYPE STREQUAL "Debug")
......
...@@ -28,6 +28,7 @@ if ( NOT Radium_FOUND) ...@@ -28,6 +28,7 @@ if ( NOT Radium_FOUND)
endif() endif()
if (NBR_FOUND) if (NBR_FOUND)
# TODO : search for installed stduuid
include("${CMAKE_CURRENT_LIST_DIR}/NBRTargets.cmake" ) include("${CMAKE_CURRENT_LIST_DIR}/NBRTargets.cmake" )
radium_exported_resources( radium_exported_resources(
TARGET RadiumNBR::NBR TARGET RadiumNBR::NBR
......
Subproject commit 5c538cca02932aa0266659661d5b4726f3a317c7
...@@ -15,7 +15,8 @@ void Node::fromJson( const nlohmann::json& data ) { ...@@ -15,7 +15,8 @@ void Node::fromJson( const nlohmann::json& data ) {
#endif #endif
// get the common content of the Node from the json data // get the common content of the Node from the json data
m_uuid = data["id"]; std::string struuid = data["id"];
m_uuid = uuids::uuid::from_string(struuid).value();
std::string readTypeName = data["model"]["name"]; std::string readTypeName = data["model"]["name"];
if ( readTypeName != m_typeName ) if ( readTypeName != m_typeName )
{ {
...@@ -37,7 +38,8 @@ void Node::fromJson( const nlohmann::json& data ) { ...@@ -37,7 +38,8 @@ void Node::fromJson( const nlohmann::json& data ) {
void Node::toJson( nlohmann::json& data ) const { void Node::toJson( nlohmann::json& data ) const {
// write the common content of the Node to the json data // write the common content of the Node to the json data
data["id"] = m_uuid; std::string struuid = "{" + uuids::to_string(m_uuid) + "}";
data["id"] = struuid;
nlohmann::json model; nlohmann::json model;
model["instance"] = m_instanceName; model["instance"] = m_instanceName;
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include <RadiumNBR/externals/json.hpp> #include <RadiumNBR/externals/json.hpp>
#include <uuid.h>
#include <cstdint> #include <cstdint>
#include <iostream> #include <iostream>
#include <memory> #include <memory>
...@@ -194,7 +196,8 @@ class NodeBasedRenderer_LIBRARY_API Node ...@@ -194,7 +196,8 @@ class NodeBasedRenderer_LIBRARY_API Node
/// The uuid of the node (TODO, use https://github.com/mariusbancila/stduuid instead of a /// The uuid of the node (TODO, use https://github.com/mariusbancila/stduuid instead of a
/// string) /// string)
std::string m_uuid; //std::string m_uuid;
uuids::uuid m_uuid;
/// The type name of the node /// The type name of the node
std::string m_typeName; std::string m_typeName;
/// The instance name of the node /// The instance name of the node
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment