Added a few assert to prevent the spread to trash data during voronoi relaxation

This commit is contained in:
Paolo Cignoni 2013-12-05 22:35:25 +00:00
parent 89039d6658
commit 6c883d3cf3
1 changed files with 2 additions and 0 deletions

View File

@ -292,6 +292,7 @@ static void GetAreaAndFrontier(MeshType &m, PerVertexPointerHandle &sources,
VertexPointer s0 = sources[(*fi).V(0)]; VertexPointer s0 = sources[(*fi).V(0)];
VertexPointer s1 = sources[(*fi).V(1)]; VertexPointer s1 = sources[(*fi).V(1)];
VertexPointer s2 = sources[(*fi).V(2)]; VertexPointer s2 = sources[(*fi).V(2)];
assert(s0 && s1 && s2);
if((s0 != s1) || (s0 != s2) ) if((s0 != s1) || (s0 != s2) )
{ {
for(int i=0;i<3;++i) for(int i=0;i<3;++i)
@ -830,6 +831,7 @@ static void QuadricRelax(MeshType &m, std::vector<VertexType *> &seedVec, std::v
sources = tri::Allocator<MeshType>:: template GetPerVertexAttribute<VertexPointer> (m,"sources"); sources = tri::Allocator<MeshType>:: template GetPerVertexAttribute<VertexPointer> (m,"sources");
QuadricSumDistance dz; QuadricSumDistance dz;
std::vector<QuadricSumDistance> dVec(m.vert.size(),dz); std::vector<QuadricSumDistance> dVec(m.vert.size(),dz);
assert(m.vert.size()==m.vn);
for(VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi) for(VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi)
{ {
assert(sources[vi]!=0); assert(sources[vi]!=0);