Commit e6ccfe75 by Philipp Adolf

Return edge_to_new_vertex from precomputeEdgeTable

parent ed3dfc77
......@@ -167,8 +167,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
buildNeighborsMap(vb, all_triangles, neighbors);
QVector<Triangle> extra_old_triangles;
QMap<Edge, unsigned int> old_edge_to_new_vertex;
subTimer.restart();
precomputeEdgeTable(tables, triangles, neighbors, (unsigned int) vb.length(), extra_old_triangles);
precomputeEdgeTable(tables, triangles, neighbors, (unsigned int) vb.length(), extra_old_triangles, old_edge_to_new_vertex);
qCDebug(log_timing) << "precomputeEdgeTable:" << formatTimeMeasurement(subTimer.elapsed());
QVector<Triangle> irregular_and_extra_triangles = triangles+extra_old_triangles;
......@@ -386,7 +388,8 @@ QVector<Triangle> Subdivision::vertexNeighbors(Triangle &triangle, Triangle::Nei
return ns;
}
void Subdivision::precomputeEdgeTable(Subdivision::Tables &tables, QVector<Triangle> &triangles, QMap<Triangle, Triangle::Neighbors> &neighbors, unsigned int offset, QVector<Triangle> extra_old_triangles) {
void Subdivision::precomputeEdgeTable(Subdivision::Tables &tables, QVector<Triangle> &triangles, QMap<Triangle, Triangle::Neighbors> &neighbors, unsigned int offset, QVector<Triangle> extra_old_triangles,
QMap<Edge,unsigned int>& edge_to_new_vertex) {
//compute edge table
//Format: first two entries: edge vertices. last two entries: distant vertices.
......@@ -592,6 +595,8 @@ void Subdivision::precomputeEdgeTable(Subdivision::Tables &tables, QVector<Trian
}
}
edge_to_new_vertex = edge_indices;
qCDebug(log_subdiv) << "Done with edge table. " << tables.edge_indices.length();
if (log_subdiv_trace().isDebugEnabled()) {
qCDebug(log_subdiv) << "Eedges found. Table: " << tables.edge_indices;
......
......@@ -64,7 +64,12 @@ private:
Tables precomputeTables(Input input);
void buildNeighborsMap(QVector<Vertex> &vb, QVector<Triangle> &triangles, QMap<Triangle, Triangle::Neighbors> &neighbors);
QVector<Triangle> vertexNeighbors(Triangle &triangle, Triangle::Neighbor current_neighbor, QMap<Triangle, Triangle::Neighbors> neighbors);
void precomputeEdgeTable(Subdivision::Tables &tables, QVector<Triangle> &triangles, QMap<Triangle, Triangle::Neighbors> &neighbors, unsigned int offset, QVector<Triangle> extra_old_triangles);
void precomputeEdgeTable(Subdivision::Tables &tables,
QVector<Triangle> &triangles,
QMap<Triangle, Triangle::Neighbors> &neighbors,
unsigned int offset,
QVector<Triangle> extra_old_triangles,
QMap<Edge,unsigned int>& edge_to_new_vertex);
void precomputeVertexTable(Tables &tables, QVector<Vertex> &vb, QVector<Triangle> &irregular_triangles, QMap<Triangle, Triangle::Neighbors> neighbors, QMap<unsigned int, unsigned int> &modified_vertices);
bool containsVertexIndex(const QVector<Vertex> &vb, const QVector<unsigned int> &vertices, const Vertex vertex) const;
QVector<unsigned int> getAllVertexIndices(const QVector<Vertex> &vb, const QVector<Triangle> &triangles);
......
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