MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / importMesh

Method importMesh

SPlisHSPlasH/Utilities/MeshImport.cpp:13–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12
13bool MeshImport::importMesh(const std::string& filename, TriangleMesh& mesh,
14 const Vector3r& translation, const Matrix3r& rotation, const Vector3r& scale)
15{
16 if (!FileSystem::fileExists(filename))
17 {
18 LOG_ERR << "File not found: " << filename;
19 return false;
20 }
21 string ext = FileSystem::getFileExt(filename);
22 transform(ext.begin(), ext.end(), ext.begin(), ::toupper);
23
24 if (ext == "PLY")
25 return importMesh_PLY(filename, mesh, translation, rotation, scale);
26 else if (ext == "OBJ")
27 return importMesh_OBJ(filename, mesh, translation, rotation, scale);
28 else
29 {
30 LOG_ERR << "File " << filename << " has an unknown file type.";
31 return false;
32 }
33}
34
35bool MeshImport::importMesh_PLY(const std::string& filename, TriangleMesh& mesh,
36 const Vector3r& translation, const Matrix3r& rotation, const Vector3r& scale)

Callers

nothing calls this directly

Calls 3

transformFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected