Commit 02506fd3 by Alisa Jung

removed "==" from vertex. use samePos instead.

Conflicts: QTProject/mainwidget.cpp QTProject/subdivision.cpp
parent 6c991eac
...@@ -436,14 +436,11 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib_ ...@@ -436,14 +436,11 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib_
for (int j = 0; j < ib_combined.length(); j++){ for (int j = 0; j < ib_combined.length(); j++){
if (j != i && j != i+1 && j != i+2){ if (j != i && j != i+1 && j != i+2){
//for debugging // checking if patch is regular. //for debugging // checking if patch is regular.
if (vb[ib_combined[j]] == v3) count3++; if (vb[ib_combined[j]].samePos(v3)) count3++;
if (vb[ib_combined[j]] == v6) count6++; if (vb[ib_combined[j]].samePos(v6)) count6++;
if (vb[ib_combined[j]] == v7) count7++; if (vb[ib_combined[j]].samePos(v7)) count7++;
} }
} }
if (count3 != 5 || count6 != 5 || count7 != 5){
qCWarning(log_subdiv) << "Counts wrong! 3: "<< count3 <<", 6: " << count6 << ", 7: " << count7 << ".\nEither this patch is not regular, or you didn't pass all neighboring triangles.";
}
} }
...@@ -617,15 +614,15 @@ bool Subdivision::matchAndCompleteTriangleIndices(unsigned int sx, unsigned int ...@@ -617,15 +614,15 @@ bool Subdivision::matchAndCompleteTriangleIndices(unsigned int sx, unsigned int
bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, unsigned int sz,unsigned int tx, unsigned int ty, unsigned int &tz, QVector<Vertex> vb){ bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, unsigned int sz,unsigned int tx, unsigned int ty, unsigned int &tz, QVector<Vertex> vb){
if (vb[sx] == vb[tx] && vb[sy] == vb[ty]){ if (vb[sx].samePos(vb[tx]) && vb[sy].samePos(vb[ty])){
tz = sz; tz = sz;
return true; return true;
} }
if (vb[sy] == vb[tx] && vb[sz] == vb[ty]){ if (vb[sy].samePos(vb[tx]) && vb[sz].samePos(vb[ty])){
tz = sx; tz = sx;
return true; return true;
} }
if (vb[sz] == vb[tx] && vb[sx] == vb[ty]){ if (vb[sz].samePos(vb[tx]) && vb[sx].samePos(vb[ty])){
tz = sy; tz = sy;
return true; return true;
} }
......
...@@ -22,11 +22,6 @@ struct Vertex ...@@ -22,11 +22,6 @@ struct Vertex
bool samePos(const Vertex& other) const; bool samePos(const Vertex& other) const;
bool operator==(const Vertex& other) const
{
return samePos(other);
}
}; };
#pragma pack(pop) #pragma pack(pop)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment