remove sprintf from meshtree and perfect_sparial_hashing
This commit is contained in:
parent
875d659719
commit
4d6c87c579
|
@ -128,8 +128,9 @@ namespace vcg {
|
||||||
void Process(vcg::AlignPair::Param& ap, MeshTree::Param& mtp)
|
void Process(vcg::AlignPair::Param& ap, MeshTree::Param& mtp)
|
||||||
{
|
{
|
||||||
std::array<char, 1024> buf;
|
std::array<char, 1024> buf;
|
||||||
std::sprintf(
|
std::snprintf(
|
||||||
buf.data(),
|
buf.data(),
|
||||||
|
1024,
|
||||||
"Starting Processing of %i glued meshes out of %zu meshes\n",
|
"Starting Processing of %i glued meshes out of %zu meshes\n",
|
||||||
gluedNum(),
|
gluedNum(),
|
||||||
nodeMap.size());
|
nodeMap.size());
|
||||||
|
@ -137,7 +138,7 @@ namespace vcg {
|
||||||
|
|
||||||
/******* Occupancy Grid Computation *************/
|
/******* Occupancy Grid Computation *************/
|
||||||
buf.fill('\0');
|
buf.fill('\0');
|
||||||
std::sprintf(buf.data(), "Computing Overlaps %i glued meshes...\n", gluedNum());
|
std::snprintf(buf.data(), 1024, "Computing Overlaps %i glued meshes...\n", gluedNum());
|
||||||
cb(0, buf.data());
|
cb(0, buf.data());
|
||||||
|
|
||||||
OG.Init(
|
OG.Init(
|
||||||
|
@ -196,8 +197,9 @@ namespace vcg {
|
||||||
// if there are no arcs at all complain and return
|
// if there are no arcs at all complain and return
|
||||||
if (totalArcNum == 0) {
|
if (totalArcNum == 0) {
|
||||||
buf.fill('\0');
|
buf.fill('\0');
|
||||||
std::sprintf(
|
std::snprintf(
|
||||||
buf.data(),
|
buf.data(),
|
||||||
|
1024,
|
||||||
"\n Failure. There are no overlapping meshes?\n No candidate alignment arcs. "
|
"\n Failure. There are no overlapping meshes?\n No candidate alignment arcs. "
|
||||||
"Nothing Done.\n");
|
"Nothing Done.\n");
|
||||||
cb(0, buf.data());
|
cb(0, buf.data());
|
||||||
|
@ -210,12 +212,12 @@ namespace vcg {
|
||||||
num_max_thread = omp_get_max_threads();
|
num_max_thread = omp_get_max_threads();
|
||||||
#endif
|
#endif
|
||||||
buf.fill('\0');
|
buf.fill('\0');
|
||||||
std::sprintf(
|
std::snprintf(
|
||||||
buf.data(), "Arc with good overlap %6zu (on %6zu)\n", totalArcNum, OG.SVA.size());
|
buf.data(), 1024,"Arc with good overlap %6zu (on %6zu)\n", totalArcNum, OG.SVA.size());
|
||||||
cb(0, buf.data());
|
cb(0, buf.data());
|
||||||
|
|
||||||
buf.fill('\0');
|
buf.fill('\0');
|
||||||
std::sprintf(buf.data(), " %6i preserved %i Recalc \n", preservedArcNum, recalcArcNum);
|
std::snprintf(buf.data(), 1024," %6i preserved %i Recalc \n", preservedArcNum, recalcArcNum);
|
||||||
cb(0, buf.data());
|
cb(0, buf.data());
|
||||||
|
|
||||||
bool hasValidAlign = false;
|
bool hasValidAlign = false;
|
||||||
|
@ -244,8 +246,9 @@ namespace vcg {
|
||||||
#pragma omp critical
|
#pragma omp critical
|
||||||
|
|
||||||
buf.fill('\0');
|
buf.fill('\0');
|
||||||
std::sprintf(
|
std::snprintf(
|
||||||
buf.data(),
|
buf.data(),
|
||||||
|
1024,
|
||||||
"(%3i/%3zu) %2i -> %2i Aligned AvgErr dd=%f -> dd=%f \n",
|
"(%3i/%3zu) %2i -> %2i Aligned AvgErr dd=%f -> dd=%f \n",
|
||||||
i + 1,
|
i + 1,
|
||||||
totalArcNum,
|
totalArcNum,
|
||||||
|
@ -258,8 +261,9 @@ namespace vcg {
|
||||||
else {
|
else {
|
||||||
#pragma omp critical
|
#pragma omp critical
|
||||||
buf.fill('\0');
|
buf.fill('\0');
|
||||||
std::sprintf(
|
std::snprintf(
|
||||||
buf.data(),
|
buf.data(),
|
||||||
|
1024,
|
||||||
"(%3i/%3zu) %2i -> %2i Failed Alignment of one arc %s\n",
|
"(%3i/%3zu) %2i -> %2i Failed Alignment of one arc %s\n",
|
||||||
i + 1,
|
i + 1,
|
||||||
totalArcNum,
|
totalArcNum,
|
||||||
|
@ -274,8 +278,9 @@ namespace vcg {
|
||||||
// if there are no valid arcs complain and return
|
// if there are no valid arcs complain and return
|
||||||
if (!hasValidAlign) {
|
if (!hasValidAlign) {
|
||||||
buf.fill('\0');
|
buf.fill('\0');
|
||||||
std::sprintf(
|
std::snprintf(
|
||||||
buf.data(),
|
buf.data(),
|
||||||
|
1024,
|
||||||
"\n Failure. No successful arc among candidate Alignment arcs. Nothing "
|
"\n Failure. No successful arc among candidate Alignment arcs. Nothing "
|
||||||
"Done.\n");
|
"Done.\n");
|
||||||
cb(0, buf.data());
|
cb(0, buf.data());
|
||||||
|
@ -289,8 +294,9 @@ namespace vcg {
|
||||||
}
|
}
|
||||||
|
|
||||||
buf.fill('\0');
|
buf.fill('\0');
|
||||||
std::sprintf(
|
std::snprintf(
|
||||||
buf.data(),
|
buf.data(),
|
||||||
|
1024,
|
||||||
"Completed Mesh-Mesh Alignment: Avg Err %5.3f; Median %5.3f; 90%% %5.3f\n",
|
"Completed Mesh-Mesh Alignment: Avg Err %5.3f; Median %5.3f; 90%% %5.3f\n",
|
||||||
H.Avg(),
|
H.Avg(),
|
||||||
H.Percentile(0.5f),
|
H.Percentile(0.5f),
|
||||||
|
|
|
@ -1462,7 +1462,7 @@ namespace vcg
|
||||||
m_OffsetTable.GetPreImageSortedPerCardinality(preimage_slots);
|
m_OffsetTable.GetPreImageSortedPerCardinality(preimage_slots);
|
||||||
|
|
||||||
char msg[128];
|
char msg[128];
|
||||||
sprintf(msg, "Building offset table of resolution %d", m_OffsetTable.GetSize());
|
snprintf(msg, 128, "Building offset table of resolution %d", m_OffsetTable.GetSize());
|
||||||
int step = int(preimage_slots.size())/100;
|
int step = int(preimage_slots.size())/100;
|
||||||
int number_of_slots = int(preimage_slots.size());
|
int number_of_slots = int(preimage_slots.size());
|
||||||
int perc = 0;
|
int perc = 0;
|
||||||
|
|
Loading…
Reference in New Issue