Welcome to mirror list, hosted at ThFree Co, Russian Federation.

adjacent-matrix.cpp « src « quadriflow « extern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e20ffb05f6d57725bf98a3cba50f62c4b59c9fc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "config.hpp"
#include "adjacent-matrix.hpp"
#include "dedge.hpp"
#include <fstream>

namespace qflow {

void generate_adjacency_matrix_uniform(
	const MatrixXi &F, const VectorXi &V2E, const VectorXi &E2E,
	const VectorXi &nonManifold, AdjacentMatrix& adj) {
	adj.resize(V2E.size());
#ifdef WITH_OMP
#pragma omp parallel for
#endif
	for (int i = 0; i < adj.size(); ++i) {
		int start = V2E[i];
		int edge = start;
		if (start == -1)
			continue;
		do {
			int base = edge % 3, f = edge / 3;
			int opp = E2E[edge], next = dedge_next_3(opp);
			if (adj[i].empty())
				adj[i].push_back(Link(F((base + 2) % 3, f)));
			if (opp == -1 || next != start) {
				adj[i].push_back(Link(F((base + 1) % 3, f)));
				if (opp == -1)
					break;
			}
			edge = next;
		} while (edge != start);
	}
}

} // namespace qflow