Replace non-standard itoa() to std::to_string()

This commit is contained in:
FyloZ 2024-04-06 17:19:19 -04:00
parent 6346ab1354
commit 80375e68de
Signed by: william
GPG Key ID: 835378AE9AF4AE97
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,6 @@
#pragma once
#include <cfloat>
#include "IKSolver.h"
#include "Armature.h"
#include "SVD.h"

View File

@ -10,14 +10,13 @@ LinkUI::LinkUI(gti320::Link* _link, int _id, nanogui::Widget* _parent) : link(_l
void LinkUI::init()
{
static char buf[64];
static const auto rotateMinMax = std::make_pair<float, float>(-1.57f, 1.57f);
static const std::string baseName = "link ";
// Rotate X
panelRotateX = new nanogui::Widget(panel);
panelRotateX->set_layout(new nanogui::BoxLayout(nanogui::Orientation::Horizontal, nanogui::Alignment::Middle, 0, 20));
labelRotateX = new nanogui::Label(panelRotateX, baseName + itoa(id, buf, 10) + " (X): ");
labelRotateX = new nanogui::Label(panelRotateX, baseName + std::to_string(id) + " (X): ");
sliderRotateX = new nanogui::Slider(panelRotateX);
sliderRotateX->set_range(rotateMinMax);
textboxRotateX = new nanogui::TextBox(panelRotateX);
@ -30,7 +29,7 @@ void LinkUI::init()
// Rotate Y
panelRotateY = new nanogui::Widget(panel);
panelRotateY->set_layout(new nanogui::BoxLayout(nanogui::Orientation::Horizontal, nanogui::Alignment::Middle, 0, 20));
labelRotateY = new nanogui::Label(panelRotateY, baseName + itoa(id, buf, 10) + " (Y): ");
labelRotateY = new nanogui::Label(panelRotateY, baseName + std::to_string(id) + " (Y): ");
sliderRotateY = new nanogui::Slider(panelRotateY);
sliderRotateY->set_range(rotateMinMax);
textboxRotateY = new nanogui::TextBox(panelRotateY);
@ -43,7 +42,7 @@ void LinkUI::init()
// Rotate Z
panelRotateZ = new nanogui::Widget(panel);
panelRotateZ->set_layout(new nanogui::BoxLayout(nanogui::Orientation::Horizontal, nanogui::Alignment::Middle, 0, 20));
labelRotateZ = new nanogui::Label(panelRotateZ, baseName + itoa(id, buf, 10) + " (Z): ");
labelRotateZ = new nanogui::Label(panelRotateZ, baseName + std::to_string(id) + " (Z): ");
sliderRotateZ = new nanogui::Slider(panelRotateZ);
sliderRotateZ->set_range(rotateMinMax);
textboxRotateZ = new nanogui::TextBox(panelRotateZ);