From 137265904638da501a175f1332ec880d77bfd214 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Mon, 16 Mar 2015 04:13:32 +0400 Subject: [.*SceneParser] Minor clean-up Change-Id: I171a3e44383f2f5160b24113de6d92725ed19fe9 Reviewed-by: Paul Lemire --- src/plugins/sceneparsers/assimp/assimpparser.cpp | 12 ++++++------ src/plugins/sceneparsers/assimp/assimpparser_p.h | 22 +++++++--------------- 2 files changed, 13 insertions(+), 21 deletions(-) (limited to 'src/plugins/sceneparsers/assimp') diff --git a/src/plugins/sceneparsers/assimp/assimpparser.cpp b/src/plugins/sceneparsers/assimp/assimpparser.cpp index 054c3ab79..5cbdc7b46 100644 --- a/src/plugins/sceneparsers/assimp/assimpparser.cpp +++ b/src/plugins/sceneparsers/assimp/assimpparser.cpp @@ -249,12 +249,12 @@ AssimpParser::~AssimpParser() * Return true if the provided \a path has a suffix supported * by the Assimp Assets importer. */ -bool AssimpParser::isAssimpPath(const QString& path) +bool AssimpParser::isAssimpPath(const QString &path) { QFileInfo fileInfo(path); if (!fileInfo.exists() || - !AssimpParser::assimpSupportedFormats().contains(fileInfo.suffix().toLower())) + !AssimpParser::assimpSupportedFormatsList.contains(fileInfo.suffix().toLower())) return false; return true; } @@ -290,7 +290,7 @@ void AssimpParser::setSource(const QUrl &source) * Returns true if the extension of \a path is supported by * the assimp parser. */ -bool AssimpParser::isExtensionSupported(const QUrl &source) +bool AssimpParser::isExtensionSupported(const QUrl &source) const { const QString path = QUrlHelper::urlToLocalFileOrQrc(source); return AssimpParser::isAssimpPath(path); @@ -303,7 +303,7 @@ bool AssimpParser::isExtensionSupported(const QUrl &source) * * Returns Q_NULLPTR if \a id was specified but not node matching it can be found. */ -QEntity *AssimpParser::scene(QString id) +QEntity *AssimpParser::scene(const QString &id) { // m_aiScene shouldn't be null. // If it is either, the file failed to be imported or @@ -328,7 +328,7 @@ QEntity *AssimpParser::scene(QString id) * Returns a Node from the scene identified by \a id. * Returns Q_NULLPTR if no node can be found. */ -QEntity *AssimpParser::node(QString id) +QEntity *AssimpParser::node(const QString &id) { if (m_scene == Q_NULLPTR || m_scene->m_aiScene == Q_NULLPTR) return Q_NULLPTR; @@ -914,7 +914,7 @@ AssimpParser::SceneImporter::~SceneImporter() delete m_importer; } -} // Qt3D +} // namespace Qt3D QT_END_NAMESPACE diff --git a/src/plugins/sceneparsers/assimp/assimpparser_p.h b/src/plugins/sceneparsers/assimp/assimpparser_p.h index 31bfb7bc1..d24472522 100644 --- a/src/plugins/sceneparsers/assimp/assimpparser_p.h +++ b/src/plugins/sceneparsers/assimp/assimpparser_p.h @@ -71,25 +71,19 @@ class AssimpParser : public AbstractSceneParser { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt3DRenderer.AssimParser") + public: AssimpParser(); ~AssimpParser(); - static bool isAssimpPath(const QString& path); - // SceneParserInterface interface void setSource(const QUrl& source) Q_DECL_OVERRIDE; - bool isExtensionSupported(const QUrl &source) Q_DECL_OVERRIDE; - QEntity *scene(QString id = QString()) Q_DECL_OVERRIDE; - QEntity *node(QString id) Q_DECL_OVERRIDE; - - QEntity *defaultScene(); - QMeshDataPtr mesh(QString id); - QMaterial *material(QString id); - QCamera *camera(QString id); - -private : + bool isExtensionSupported(const QUrl &source) const Q_DECL_OVERRIDE; + QEntity *scene(const QString &id = QString()) Q_DECL_OVERRIDE; + QEntity *node(const QString &id) Q_DECL_OVERRIDE; +private: + static bool isAssimpPath(const QString &path); static QStringList assimpSupportedFormats(); static QMatrix4x4 aiMatrix4x4ToQMatrix4x4(const aiMatrix4x4 &matrix); @@ -138,11 +132,9 @@ private : bool m_sceneParsed; AssimpParser::SceneImporter *m_scene; static QStringList assimpSupportedFormatsList; - - }; -} +} // namespace Qt3D QT_END_NAMESPACE -- cgit v1.2.3