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

Method create

tools/Wires/Inflator/InflatorEngine.cpp:25–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23using namespace PyMesh;
24
25InflatorEngine::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
54InflatorEngine::Ptr InflatorEngine::create_parametric(WireNetwork::Ptr network,
55 ParameterManager::Ptr manager) {

Callers 1

save_meshMethod · 0.45

Calls 3

NotImplementedErrorClass · 0.85
get_dimMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected