| 11 | |
| 12 | namespace 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) { |