Remove fmt::format and replace with std::format

This commit is contained in:
Alexander Bock
2024-03-24 20:19:14 +01:00
parent 9878bfc8f7
commit 3ba346a227
246 changed files with 1343 additions and 1300 deletions

View File

@@ -56,7 +56,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
// Parent node. Note that we only render one path at a time, so remove the previously
// rendered one, if any
std::string addParentScript = fmt::format(
std::string addParentScript = std::format(
"if openspace.hasSceneGraphNode('{0}') then "
"openspace.removeSceneGraphNode('{0}') "
"end "
@@ -82,7 +82,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
// Create node lines between the positions
auto pointIdentifier = [](int i) {
return fmt::format("Point_{}", i);
return std::format("Point_{}", i);
};
auto addPoint = [](const std::string& id, glm::dvec3 p) {
@@ -98,7 +98,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
"}";
global::scriptEngine->queueScript(
fmt::format("openspace.addSceneGraphNode({})", pointNode),
std::format("openspace.addSceneGraphNode({})", pointNode),
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
);
@@ -108,7 +108,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
const glm::vec3& color, float lineWidth)
{
const std::string lineNode = "{"
"Identifier = '" + fmt::format("Line{}", id1) + "',"
"Identifier = '" + std::format("Line{}", id1) + "',"
"Parent = '" + RenderedPathIdentifier + "',"
"Renderable = {"
"Enabled = true,"
@@ -121,7 +121,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
"}";
global::scriptEngine->queueScript(
fmt::format("openspace.addSceneGraphNode({})", lineNode),
std::format("openspace.addSceneGraphNode({})", lineNode),
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
);
@@ -133,7 +133,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
{
const glm::dvec3 dir = glm::normalize(p.rotation * glm::dvec3(0.0, 0.0, -1.0));
const glm::dvec3 pointPosition = p.position + lineLength * dir;
const std::string id = fmt::format("{}_orientation", pointId);
const std::string id = std::format("{}_orientation", pointId);
addPoint(id, pointPosition);
addLineBetweenPoints(id, pointId, OrientationLineColor, 2.f);
@@ -159,7 +159,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
[[codegen::luawrap]] void removeRenderedCameraPath() {
using namespace openspace;
global::scriptEngine->queueScript(
fmt::format("openspace.removeSceneGraphNode('{}');", RenderedPathIdentifier),
std::format("openspace.removeSceneGraphNode('{}');", RenderedPathIdentifier),
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
);
@@ -183,7 +183,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
// Parent node. Note that we only render one set of points at a time, so remove any
// previously rendered ones
std::string addParentScript = fmt::format(
std::string addParentScript = std::format(
"if openspace.hasSceneGraphNode('{0}') then "
"openspace.removeSceneGraphNode('{0}') "
"end "
@@ -200,7 +200,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
const std::vector<glm::dvec3> points = currentPath->controlPoints();
const std::string guiPath =
fmt::format("{}/Camera Path Control Points", DebuggingGuiPath);
std::format("{}/Camera Path Control Points", DebuggingGuiPath);
const char* colorTexturePath = "openspace.absPath("
"openspace.createSingleColorImage('point_color', { 0.0, 1.0, 0.0 })"
@@ -230,7 +230,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
"}";
global::scriptEngine->queueScript(
fmt::format("openspace.addSceneGraphNode({})", node),
std::format("openspace.addSceneGraphNode({})", node),
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
);
@@ -241,7 +241,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
[[codegen::luawrap]] void removePathControlPoints() {
using namespace openspace;
global::scriptEngine->queueScript(
fmt::format("openspace.removeSceneGraphNode('{}');", RenderedPointsIdentifier),
std::format("openspace.removeSceneGraphNode('{}');", RenderedPointsIdentifier),
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
);
@@ -297,7 +297,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
"}";
global::scriptEngine->queueScript(
fmt::format("openspace.addSceneGraphNode({});", axes),
std::format("openspace.addSceneGraphNode({});", axes),
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
);