QVector<unsignedint>ib_combined=ib_regular+ib_irregular;//DO NOT swap regular and irregular! iteration over ib_combined starting from index in ib_regular
QMap<Triangle,QVector<Triangle>>adj;
for(inti=0;i<ib_combined.length()-2;i+=3){
unsignedinti0,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11;
unsignedinti3,i6,i7;
//alles gegen den uzs
i3=ib_regular[i];
i6=ib_regular[i+1];
i7=ib_regular[i+2];
Vertexv3=vb[i3];
Vertexv6=vb[i6];
Vertexv7=vb[i7];
intcount3=0;//counts other triangles with this vertex
intcount6=0;
intcount7=0;
i3=ib_combined[i];
i6=ib_combined[i+1];
i7=ib_combined[i+2];
if(log_subdiv_trace().isDebugEnabled()){
for(intj=0;j<ib_combined.length();j++){
if(j!=i&&j!=i+1&&j!=i+2){
//for debugging // checking if patch is regular.
if(vb[ib_combined[j]]==v3)count3++;
if(vb[ib_combined[j]]==v6)count6++;
if(vb[ib_combined[j]]==v7)count7++;
if(i<ib_regular.length()){
Vertexv3=vb[i3];
Vertexv6=vb[i6];
Vertexv7=vb[i7];
intcount3=0;//counts other triangles with this vertex
intcount6=0;
intcount7=0;
for(intj=0;j<ib_combined.length();j++){
if(j!=i&&j!=i+1&&j!=i+2){
//for debugging // checking if patch is regular.
if(vb[ib_combined[j]].samePos(v3))count3++;
if(vb[ib_combined[j]].samePos(v6))count6++;
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.";
}
}
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.";
}
}
//find triangles with shared edge. Fills i2, i4, i10.