MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / enumerate

Function enumerate

tools/Wires/Tiler/AABBTiler.cpp:13–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12namespace AABBTilerHelper {
13 std::vector<VectorI> enumerate(const VectorI& repetitions) {
14 std::vector<VectorI> result;
15 const size_t dim = repetitions.size();
16 if (dim == 2) {
17 for (size_t i=0; i<repetitions[0]; i++) {
18 for (size_t j=0; j<repetitions[1]; j++) {
19 result.push_back(Vector2I(i,j));
20 }
21 }
22 } else if (dim == 3) {
23 for (size_t i=0; i<repetitions[0]; i++) {
24 for (size_t j=0; j<repetitions[1]; j++) {
25 for (size_t k=0; k<repetitions[2]; k++) {
26 result.push_back(Vector3I(i,j,k));
27 }
28 }
29 }
30 } else {
31 std::stringstream err_msg;
32 err_msg << "Unsupported dim: " << dim;
33 throw NotImplementedError(err_msg.str());
34 }
35
36 return result;
37 }
38
39 template<typename T>
40 void run_compatibility_check(size_t dim, const T& data) {

Callers 15

tileMethod · 0.85
slice_meshFunction · 0.85
quad_to_triFunction · 0.85
hex_to_tetFunction · 0.85
merge_meshesFunction · 0.85
get_edge_adj_facesMethod · 0.85
merge_wiresFunction · 0.85
mainFunction · 0.85
tet_to_hexFunction · 0.85
compute_cotan_fieldFunction · 0.85

Calls 3

NotImplementedErrorClass · 0.85
sizeMethod · 0.45
strMethod · 0.45

Tested by 1

get_edge_adj_facesMethod · 0.68