Commit 51432f8a by Philipp Adolf

Turn if/else into switch

parent 3a064b57
...@@ -326,15 +326,19 @@ void Subdivision::precomputeVertexTable(Subdivision::Tables &tables, QVector<Ver ...@@ -326,15 +326,19 @@ void Subdivision::precomputeVertexTable(Subdivision::Tables &tables, QVector<Ver
if (vb[ib_combined[j]].samePos(originalVertex)){ if (vb[ib_combined[j]].samePos(originalVertex)){
d.push_back(j); d.push_back(j);
unsigned int i1, i2; //indices for neighbour vertices unsigned int i1, i2; //indices for neighbour vertices
if(j%3==0){ switch (j % 3) {
case 0:
i1 = ib_combined[j+1]; i1 = ib_combined[j+1];
i2 = ib_combined[j+2]; i2 = ib_combined[j+2];
} else if(j%3==1){ break;
case 1:
i1 = ib_combined[j-1]; i1 = ib_combined[j-1];
i2 = ib_combined[j+1]; i2 = ib_combined[j+1];
} else{ break;
case 2:
i1 = ib_combined[j-2]; i1 = ib_combined[j-2];
i2 = ib_combined[j-1]; i2 = ib_combined[j-1];
break;
} }
Vertex v1,v2; //neighbour vertices; Vertex v1,v2; //neighbour vertices;
......
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