| 491 | } |
| 492 | |
| 493 | std::string |
| 494 | LoadObj( |
| 495 | std::vector<shape_t>& shapes, |
| 496 | std::vector<material_t>& materials, // [output] |
| 497 | const char* filename, |
| 498 | const char* mtl_basepath) |
| 499 | { |
| 500 | |
| 501 | shapes.clear(); |
| 502 | |
| 503 | std::stringstream err; |
| 504 | |
| 505 | std::ifstream ifs(filename); |
| 506 | if (!ifs) { |
| 507 | err << "Cannot open file [" << filename << "]" << std::endl; |
| 508 | return err.str(); |
| 509 | } |
| 510 | |
| 511 | std::string basePath; |
| 512 | if (mtl_basepath) { |
| 513 | basePath = mtl_basepath; |
| 514 | } |
| 515 | MaterialFileReader matFileReader( basePath ); |
| 516 | |
| 517 | return LoadObj(shapes, materials, ifs, matFileReader); |
| 518 | } |
| 519 | |
| 520 | std::string LoadObj( |
| 521 | std::vector<shape_t>& shapes, |
nothing calls this directly
no test coverage detected