remove sprintf from edge collapse algorithms

This commit is contained in:
alemuntoni 2021-10-20 08:48:06 +02:00
parent feb2f2c3bc
commit 875d659719
3 changed files with 18 additions and 9 deletions

View File

@ -358,9 +358,12 @@ namespace vcg{
virtual const char *Info(MeshType &m)
{
static char buf[60];
sprintf(buf,"(%d - %d) %g\n", hp->HVp()-&m.vert[0], hp->HNp()->HNp()->HVp()-&m.vert[0], -_priority);
return buf;
static std::string msg;
msg =
"(" + std::to_string(hp->HVp()-&m.vert[0]) +
" - " + std::to_string(hp->HNp()->HNp()->HVp()-&m.vert[0]) +
") " + std::to_string(-_priority) + "\n";
return msg.c_str();
}
/*!

View File

@ -115,9 +115,12 @@ public:
virtual const char *Info(TriMeshType &m) {
mt = &m;
static char buf[60];
sprintf(buf,"%i -> %i %g\n", int(pos.V(0)-&m.vert[0]), int(pos.V(1)-&m.vert[0]),-_priority);
return buf;
static std::string msg;
msg =
std::to_string(int(pos.V(0)-&m.vert[0])) + " -> " +
std::to_string(int(pos.V(1)-&m.vert[0])) +
" " + std::to_string(-_priority) + "\n";
return msg.c_str();
}
inline void Execute(TriMeshType &m, BaseParameterClass *)

View File

@ -283,9 +283,12 @@ public:
*/
const char* Info(TRIMESH_TYPE &m)
{
static char dump[60];
sprintf(dump,"%zu -> %zu %g\n", tri::Index(m,_pos.F()->V(0)), tri::Index(m,_pos.F()->V(1)),-_priority);
return dump;
static std::string msg;
msg =
std::to_string(tri::Index(m,_pos.F()->V(0))) + " -> " +
std::to_string(tri::Index(m,_pos.F()->V(1))) +
" " + std::to_string(-_priority) + "\n";
return msg.c_str();
}
/*!