| 23 | using namespace PyMesh; |
| 24 | |
| 25 | InflatorEngine::Ptr InflatorEngine::create(const std::string& type, |
| 26 | WireNetwork::Ptr network) { |
| 27 | const size_t dim = network->get_dim(); |
| 28 | if (type == "simple") { |
| 29 | return std::make_shared<SimpleInflator>(network); |
| 30 | } else if (type == "periodic") { |
| 31 | if (dim == 2) { |
| 32 | return std::make_shared<PeriodicInflator2D>(network); |
| 33 | } else if (dim == 3) { |
| 34 | return std::make_shared<PeriodicInflator3D>(network); |
| 35 | } else { |
| 36 | std::stringstream err_msg; |
| 37 | err_msg << "Unsupported dim: " << dim; |
| 38 | throw NotImplementedError(err_msg.str()); |
| 39 | } |
| 40 | } else if (type == "reflective") { |
| 41 | if (dim == 3) { |
| 42 | return std::make_shared<IsotropicPeriodicInflator>(network); |
| 43 | } else { |
| 44 | throw NotImplementedError( |
| 45 | "Isotropic periodic inflator only support 3D mesh"); |
| 46 | } |
| 47 | } else { |
| 48 | std::stringstream err_msg; |
| 49 | err_msg << "Unsupported inflator type: " << type; |
| 50 | throw NotImplementedError(err_msg.str()); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | InflatorEngine::Ptr InflatorEngine::create_parametric(WireNetwork::Ptr network, |
| 55 | ParameterManager::Ptr manager) { |
no test coverage detected