Commit 1e95e175 by Philipp Adolf

Add debug code

parent 1cbbace4
......@@ -98,6 +98,52 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
QMap<Triangle, Triangle::Neighbors> neighbors;
buildNeighborsMap(result.vertex_buffer, all_triangles, neighbors);
for (int i = 0; i < triangles.length(); i++) {
Triangle::Neighbors ns = neighbors.value(triangles[i]);
if (ns.uv.triangle == NULL) {
qDebug() << i << "uv missing";
} else if (!triangles.contains(*ns.uv.triangle)) {
Triangle::Neighbors ns2 = neighbors.value(*ns.uv.triangle);
if (ns2.uv.triangle == NULL) {
qDebug() << i << "uv uv missing";
}
if (ns2.vw.triangle == NULL) {
qDebug() << i << "uv vw missing";
}
if (ns2.wu.triangle == NULL) {
qDebug() << i << "uv wu missing";
}
}
if (ns.vw.triangle == NULL) {
qDebug() << i << "vw missing";
} else if (!triangles.contains(*ns.vw.triangle)) {
Triangle::Neighbors ns2 = neighbors.value(*ns.vw.triangle);
if (ns2.uv.triangle == NULL) {
qDebug() << i << "vw uv missing";
}
if (ns2.vw.triangle == NULL) {
qDebug() << i << "vw vw missing";
}
if (ns2.wu.triangle == NULL) {
qDebug() << i << "vw wu missing";
}
}
if (ns.wu.triangle == NULL) {
qDebug() << i << "wu missing";
} else if (!triangles.contains(*ns.wu.triangle)) {
Triangle::Neighbors ns2 = neighbors.value(*ns.wu.triangle);
if (ns2.uv.triangle == NULL) {
qDebug() << i << "wu uv missing";
}
if (ns2.vw.triangle == NULL) {
qDebug() << i << "wu vw missing";
}
if (ns2.wu.triangle == NULL) {
qDebug() << i << "wu wu missing";
}
}
}
QVector<Triangle> regular;
QVector<Triangle> irregular;
findRegular(triangles, neighbors, regular, irregular);
......
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