Skip to content

Commit

Permalink
Refactor libInfo struct (#1588)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meakk authored Aug 24, 2024
1 parent 3719f70 commit 4f768e3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 27 deletions.
13 changes: 8 additions & 5 deletions application/F3DOptionsParser.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -580,13 +580,16 @@ void ConfigurationOptions::PrintVersion()
f3d::log::info("Build date: " + libInfo.BuildDate + ".");
f3d::log::info("Build system: " + libInfo.BuildSystem + ".");
f3d::log::info("Compiler: " + libInfo.Compiler + ".");
f3d::log::info("External rendering module: " + libInfo.ExternalRenderingModule + ".");
f3d::log::info("Raytracing module: " + libInfo.RaytracingModule + ".");
for (const auto& [name, enabled] : libInfo.Modules)
{
f3d::log::info("Module " + name + ": " + (enabled ? "ON." : "OFF."));
}
f3d::log::info("VTK version: " + libInfo.VTKVersion + ".");
f3d::log::info(libInfo.PreviousCopyright + ".");
f3d::log::info(libInfo.Copyright + ".");
for (const auto& cr : libInfo.Copyrights)
{
f3d::log::info("Copyright (C) " + cr + ".");
}
f3d::log::info("License " + libInfo.License + ".");
f3d::log::info("By " + libInfo.Authors + ".");
f3d::log::setUseColoring(true);
f3d::log::waitForUser();
}
Expand Down
8 changes: 6 additions & 2 deletions application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ if(F3D_MODULE_RAYTRACING)
f3d_test(NAME TestRaytracingPointCloud DATA pointsCloud.vtp ARGS -rd --samples=4 --point-size=20 THRESHOLD 0.1) # Threshold needed because of difference in rendering in VTK 9.3
f3d_test(NAME TestRaytracingDenoise DATA suzanne.ply ARGS -rd --samples=4)
f3d_test(NAME TestRaytracingNoDenoise DATA suzanne.ply ARGS -r --samples=20)
f3d_test(NAME TestVersionRaytracing ARGS --version REGEXP "Raytracing module: ON")
f3d_test(NAME TestVersionRaytracing ARGS --version REGEXP "Module Raytracing: ON")
f3d_test(NAME TestInteractionRaytracingDenoise DATA suzanne.ply ARGS --samples=4 INTERACTION) #RD
f3d_test(NAME TestRaytracingScalarBar DATA dragon.vtu ARGS -rsbd --samples=4 THRESHOLD 0.06) # Threshold needed because of difference in rendering in VTK 9.3 on macOS

Expand All @@ -485,7 +485,11 @@ else(F3D_MODULE_RAYTRACING)
endif()

if(F3D_MODULE_EXTERNAL_RENDERING)
f3d_test(NAME TestVersionExternal ARGS --version REGEXP "External rendering module: ON")
f3d_test(NAME TestVersionExternal ARGS --version REGEXP "Module ExternalRendering: ON")
endif()

if(F3D_MODULE_EXR)
f3d_test(NAME TestVersionEXR ARGS --version REGEXP "Module OpenEXR: ON")
endif()

if(F3D_PLUGIN_BUILD_ALEMBIC)
Expand Down
8 changes: 2 additions & 6 deletions library/public/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,10 @@ class F3D_EXPORT engine
std::string BuildDate;
std::string BuildSystem;
std::string Compiler;
std::string RaytracingModule;
std::string ExternalRenderingModule;
std::string OpenEXRModule;
std::map<std::string, bool> Modules;
std::string VTKVersion;
std::string PreviousCopyright;
std::string Copyright;
std::vector<std::string> Copyrights;
std::string License;
std::string Authors;
};

/**
Expand Down
22 changes: 8 additions & 14 deletions library/src/engine.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -290,28 +290,23 @@ engine::libInformation engine::getLibInfo()
libInfo.BuildSystem = detail::LibBuildSystem;
libInfo.Compiler = detail::LibCompiler;

std::string tmp;

#if F3D_MODULE_RAYTRACING
tmp = "ON";
libInfo.Modules["Raytracing"] = true;
#else
tmp = "OFF";
libInfo.Modules["Raytracing"] = false;
#endif
libInfo.RaytracingModule = tmp;

#if F3D_MODULE_EXTERNAL_RENDERING
tmp = "ON";
libInfo.Modules["ExternalRendering"] = true;
#else
tmp = "OFF";
libInfo.Modules["ExternalRendering"] = false;
#endif
libInfo.ExternalRenderingModule = tmp;

#if F3D_MODULE_EXR
tmp = "ON";
libInfo.Modules["OpenEXR"] = true;
#else
tmp = "OFF";
libInfo.Modules["OpenEXR"] = false;
#endif
libInfo.OpenEXRModule = tmp;

std::string vtkVersion = std::string(vtkVersion::GetVTKVersionFull());
if (!vtkVersion.empty())
Expand All @@ -328,10 +323,9 @@ engine::libInformation engine::getLibInfo()
libInfo.VTKVersion = vtkVersion::GetVTKVersion();
}

libInfo.PreviousCopyright = "Copyright (C) 2019-2021 Kitware SAS";
libInfo.Copyright = "Copyright (C) 2021-2024 Michael Migliore, Mathieu Westphal";
libInfo.Copyrights.emplace_back("2019-2021 Kitware SAS");
libInfo.Copyrights.emplace_back("2021-2024 Michael Migliore, Mathieu Westphal");
libInfo.License = "BSD-3-Clause";
libInfo.Authors = "Michael Migliore, Mathieu Westphal and Joachim Pouderoux";

return libInfo;
}
Expand Down

0 comments on commit 4f768e3

Please sign in to comment.