remove memset from align_pair.h and marching_cubes.h

This commit is contained in:
alemuntoni 2021-10-19 11:57:02 +02:00
parent ca59ed7c8d
commit 70ac3d8248
2 changed files with 17 additions and 16 deletions

View File

@ -128,22 +128,21 @@ public:
public: public:
IterInfo() IterInfo()
{ {
memset ( (void *) this, 0, sizeof(IterInfo));
} }
double MinDistAbs; double MinDistAbs = 0;
int DistanceDiscarded; int DistanceDiscarded = 0;
int AngleDiscarded; int AngleDiscarded = 0;
int BorderDiscarded; int BorderDiscarded = 0;
int SampleTested; // how many points have been tested int SampleTested = 0; // how many points have been tested
int SampleUsed; // how many points have been actually used to compute the transformation // how many points have been actually used to compute the transformation
double pcl50; int SampleUsed = 0;
double pclhi; double pcl50 = 0;
double AVG; double pclhi = 0;
double RMS; double AVG = 0;
double StdDev; double RMS = 0;
int Time; // Ending time of this iteration double StdDev = 0;
int Time = 0; // Ending time of this iteration
}; };
std::vector<IterInfo> I; std::vector<IterInfo> I;

View File

@ -26,6 +26,7 @@
#define __VCG_MARCHING_CUBES #define __VCG_MARCHING_CUBES
#include "mc_lookup_table.h" #include "mc_lookup_table.h"
#include <array>
namespace vcg namespace vcg
{ {
@ -665,14 +666,15 @@ namespace vcg
VertexPointer vp = NULL; VertexPointer vp = NULL;
size_t face_idx = _mesh->face.size(); size_t face_idx = _mesh->face.size();
size_t v12_idx = -1; size_t v12_idx = -1;
size_t vertices_idx[3]; std::array<size_t, 3> vertices_idx;
if (v12 != NULL) v12_idx = v12 - &_mesh->vert[0]; if (v12 != NULL) v12_idx = v12 - &_mesh->vert[0];
AllocatorType::AddFaces(*_mesh, (int) n); AllocatorType::AddFaces(*_mesh, (int) n);
for (int trig=0; trig<3*n; face_idx++ ) for (int trig=0; trig<3*n; face_idx++ )
{ {
vp = NULL; vp = NULL;
memset(vertices_idx, -1, 3*sizeof(size_t)); vertices_idx.fill(-1);
//memset(vertices_idx, -1, 3*sizeof(size_t));
for (int vert=0; vert<3; vert++, trig++) //ok for (int vert=0; vert<3; vert++, trig++) //ok
{ {