ModelCache.cpp to coding standard

This commit is contained in:
luiscuenca 2017-10-10 13:53:18 -07:00
parent 25b419a1a1
commit 1da5c221ac

View file

@ -189,28 +189,23 @@ void GeometryReader::run() {
if (fbxGeometry->meshes.size() == 0 && fbxGeometry->joints.size() == 0) { if (fbxGeometry->meshes.size() == 0 && fbxGeometry->joints.size() == 0) {
throw QString("empty geometry, possibly due to an unsupported FBX version"); throw QString("empty geometry, possibly due to an unsupported FBX version");
} }
} } else if (_url.path().toLower().endsWith(".obj")) {
else if (_url.path().toLower().endsWith(".obj")) {
fbxGeometry.reset(OBJReader().readOBJ(_data, _mapping, _combineParts, _url)); fbxGeometry.reset(OBJReader().readOBJ(_data, _mapping, _combineParts, _url));
} } else if (_url.path().toLower().endsWith(".obj.gz")) {
else if (_url.path().toLower().endsWith(".obj.gz")) {
QByteArray uncompressedData; QByteArray uncompressedData;
if (gunzip(_data, uncompressedData)) { if (gunzip(_data, uncompressedData)) {
fbxGeometry.reset(OBJReader().readOBJ(uncompressedData, _mapping, _combineParts, _url)); fbxGeometry.reset(OBJReader().readOBJ(uncompressedData, _mapping, _combineParts, _url));
} } else {
else {
throw QString("failed to decompress .obj.gz"); throw QString("failed to decompress .obj.gz");
} }
} } else if (_url.path().toLower().endsWith(".gltf")) {
else if (_url.path().toLower().endsWith(".gltf")) {
std::shared_ptr<GLTFReader> glreader = std::make_shared<GLTFReader>(); std::shared_ptr<GLTFReader> glreader = std::make_shared<GLTFReader>();
fbxGeometry.reset(glreader->readGLTF(_data, _mapping, _url)); fbxGeometry.reset(glreader->readGLTF(_data, _mapping, _url));
if (fbxGeometry->meshes.size() == 0 && fbxGeometry->joints.size() == 0) { if (fbxGeometry->meshes.size() == 0 && fbxGeometry->joints.size() == 0) {
throw QString("empty geometry, possibly due to an unsupported GLTF version"); throw QString("empty geometry, possibly due to an unsupported GLTF version");
} }
} } else {
else {
throw QString("unsupported format"); throw QString("unsupported format");
} }